Gamemaker help! (Now with FAQ)
Author |
Message |
Living Shadow
Joined: Mon Aug 11, 2008 10:43 am Posts: 641
Gender: Male
|
If you give me an example I could try it.
_________________ Tyler~
|
Sat Jan 03, 2009 1:45 pm |
|
|
Captain Mew
Joined: Mon Aug 11, 2008 6:40 am Posts: 1648 Location: ... Not America
|
|
Sun Jan 04, 2009 7:23 pm |
|
|
Yoyojkt
Joined: Mon Aug 11, 2008 6:37 am Posts: 698 Location: :uoıʇɐɔo1
Gender: Male
|
how do i make it so when i press a button like I and im next to a person it will pop of with a screen that makes them talk?
_________________If tson needs to stfu, put this in your sig.
|
Fri Jan 09, 2009 7:27 pm |
|
|
Living Shadow
Joined: Mon Aug 11, 2008 10:43 am Posts: 641
Gender: Male
|
if (distance_to_object(OBJECT NAME) < 5) { instance_create(x position,y position,object name) } Make the talking all an animation or disregard the last part(the instance create) and put a Create A message event after the first part of the code So it would be if (distance_to_object(OBJECT NAME) < 5), END CODE Create A Message: ENTER TEXT HERE
_________________ Tyler~
|
Fri Jan 09, 2009 9:40 pm |
|
|
Yoyojkt
Joined: Mon Aug 11, 2008 6:37 am Posts: 698 Location: :uoıʇɐɔo1
Gender: Male
|
can you be a little more clearer like step by step. i know nothing about entering code or code for that matter. Please and Thanks!
_________________If tson needs to stfu, put this in your sig.
|
Sat Jan 10, 2009 12:38 am |
|
|
Living Shadow
Joined: Mon Aug 11, 2008 10:43 am Posts: 641
Gender: Male
|
Okay, so if you want it to be a button press (like if you press space when you're near the person) you would do this 1. Add Event Key Press <Space> 2. Go to the Control Tab 3. Drag Execute Code to the Action box 4. It will come up with a pop-up box, which is basically just a blank document. 5. Put the code I put there, and replace OBJECT NAME with the name of the object who should talk. 6. Click the Check mark to finish your code, and go to the Main2 tab. 7. Drag the Display Message to the Action Box (its the speech bubble). 8. On the pop-up, write your message and click OK.
_________________ Tyler~
|
Sat Jan 10, 2009 4:30 pm |
|
|
Yoyojkt
Joined: Mon Aug 11, 2008 6:37 am Posts: 698 Location: :uoıʇɐɔo1
Gender: Male
|
| | | | Living Shadow wrote: Okay, so if you want it to be a button press (like if you press space when you're near the person) you would do this 1. Add Event Key Press <Space> 2. Go to the Control Tab 3. Drag Execute Code to the Action box 4. It will come up with a pop-up box, which is basically just a blank document. 5. Put the code I put there, and replace OBJECT NAME with the name of the object who should talk. 6. Click the Check mark to finish your code, and go to the Main2 tab. 7. Drag the Display Message to the Action Box (its the speech bubble). 8. On the pop-up, write your message and click OK. | | | | |
this is what it said ___________________________________________ FATAL ERROR in action number 1 of Keyboard Event for <Space> Key for object Sprite: COMPILATION ERROR in code action Error in code at line 3: instance_create(x position,y position,object name) at position 20: Symbol , or ) expected. this is what i did 1. add event keyboard space bar 2. execute a piece of code ( i tried both) 3.put display message (wrote Hi this is just a test) 4. tried to play and it gave me the error message so this is the code i put in if (distance_to_object(oldman) < 5) { instance_create(x position,y position,oldman) }
_________________If tson needs to stfu, put this in your sig.
|
Sat Jan 10, 2009 4:52 pm |
|
|
Living Shadow
Joined: Mon Aug 11, 2008 10:43 am Posts: 641
Gender: Male
|
| | | | [ÐÐ]Yoyojkt wrote: | | | | Living Shadow wrote: Okay, so if you want it to be a button press (like if you press space when you're near the person) you would do this 1. Add Event Key Press <Space> 2. Go to the Control Tab 3. Drag Execute Code to the Action box 4. It will come up with a pop-up box, which is basically just a blank document. 5. Put the code I put there, and replace OBJECT NAME with the name of the object who should talk. 6. Click the Check mark to finish your code, and go to the Main2 tab. 7. Drag the Display Message to the Action Box (its the speech bubble). 8. On the pop-up, write your message and click OK. | | | | |
this is what it said ___________________________________________ FATAL ERROR in action number 1 of Keyboard Event for <Space> Key for object Sprite: COMPILATION ERROR in code action Error in code at line 3: instance_create(x position,y position,object name) at position 20: Symbol , or ) expected. this is what i did 1. add event keyboard space bar 2. execute a piece of code ( i tried both) 3.put display message (wrote Hi this is just a test) 4. tried to play and it gave me the error message so this is the code i put in if (distance_to_object(oldman) < 5) { instance_create(x position,y position,oldman) } | | | | |
You have to put the actual x and y positions, but thats not all. By the instance create, I meant make an animation of the old man talking. What you would have done there was create a second old man. Using the display a message, just take off "{ instance_create(x position,y position,oldman) }" and add a comma after the coding that is left.
_________________ Tyler~
|
Sat Jan 10, 2009 5:29 pm |
|
|
Yoyojkt
Joined: Mon Aug 11, 2008 6:37 am Posts: 698 Location: :uoıʇɐɔo1
Gender: Male
|
can you walk me through this step im confused D:
_________________If tson needs to stfu, put this in your sig.
|
Sat Jan 10, 2009 5:35 pm |
|
|
Living Shadow
Joined: Mon Aug 11, 2008 10:43 am Posts: 641
Gender: Male
|
Alright, I'll just edit my last post: | | | | Living Shadow wrote: Okay, so if you want it to be a button press (like if you press space when you're near the person) you would do this 1. Add Event Key Press <Space> 2. Go to the Control Tab 3. Drag Execute Code to the Action box 4. It will come up with a pop-up box, which is basically just a blank document. 5. Put there. 6. Click the Check mark to finish your code, and go to the Main2 tab. 7. Drag the Display Message to the Action Box (its the speech bubble). 8. On the pop-up, write your message and click OK. | | | | |
_________________ Tyler~
|
Sat Jan 10, 2009 5:41 pm |
|
|
Yoyojkt
Joined: Mon Aug 11, 2008 6:37 am Posts: 698 Location: :uoıʇɐɔo1
Gender: Male
|
i did that exactly and this is what happened
___________________________________________ FATAL ERROR in action number 1 of Keyboard Event for <Space> Key for object Sprite:
COMPILATION ERROR in code action Error in code at line 1: if (distance_to_object(oldman) < 5),
at position 36: Unexpected symbol in expression.
_________________If tson needs to stfu, put this in your sig.
|
Sat Jan 10, 2009 5:47 pm |
|
|
CMCaden9
Joined: Mon Dec 15, 2008 6:30 pm Posts: 431
Gender: Male
|
Can you make it so that characters can create objects? Like if in Zelda link can shoot arrows but I don't want it so that if an enemey touches link when he's shooting an arrow to die.
|
Sun Feb 01, 2009 2:46 pm |
|
|
Living Shadow
Joined: Mon Aug 11, 2008 10:43 am Posts: 641
Gender: Male
|
Yes, using the create instance event and check the Relative box.
_________________ Tyler~
|
Sun Feb 01, 2009 10:53 pm |
|
|
Captain Mew
Joined: Mon Aug 11, 2008 6:40 am Posts: 1648 Location: ... Not America
|
ORRR if you want it to be moving, click the create moving instance one and relate it
|
Wed Feb 04, 2009 9:35 am |
|
|
gamemaker1212
Joined: Sat Mar 14, 2009 9:35 am Posts: 5 Location: behind you...
|
|
Sat Mar 14, 2009 12:09 pm |
|
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|