End Animation Help
#1
Posted 15 June 2012 - 10:18 PM
Also, can you give me the answer in Drag N Drop commands, if possible. I get confused with code.
#2
Posted 15 June 2012 - 10:37 PM
Okay so you want to check which animation you are using, that should fix the Animation End event problem
So just check if the variable sprite_index equals your dying animation.
It is the purple hexagon saying var in it, that is the one that you want.
name: sprite_index
value: *dying animation here*
operation: equals to
then after it use the variable set D&D command
name: image_speed
value: 0
p.s. Incidentally through code it is:
if (sprite_index == *dying_animation_here*){
image_speed = 0;
}
Edited by millzyman, 15 June 2012 - 10:39 PM.
#3
Posted 15 June 2012 - 10:57 PM
ERROR in
action number 1
of Other Event: Animation End
for object obj_Exploro:
Error in expression:spr_Exploro Death
position 1: Unknown variable spr_Exploro
#4
Posted 15 June 2012 - 11:36 PM
#5
Posted 16 June 2012 - 02:08 AM
This means that you can't use spaces and certain symbols in resource names if you do this.
You have two choices: either rename the sprite (recommended) or use its numeric index (which you can find by typing its name as a watch expression in debug mode).
There's a menu command to check the validity of your resource names: Scripts > Check Resource Names.
#6
Posted 16 June 2012 - 02:10 AM
Edited by millzyman, 16 June 2012 - 02:12 AM.
#7
Posted 16 June 2012 - 04:05 PM
Expressions are parsed in action properties the same way as in GML code.
This means that you can't use spaces and certain symbols in resource names if you do this.
You have two choices: either rename the sprite (recommended) or use its numeric index (which you can find by typing its name as a watch expression in debug mode).
There's a menu command to check the validity of your resource names: Scripts > Check Resource Names.
I renamed the sprite, but now the game won't play the animation all the way through.
Edit:
I fixed that problem (I had an event in the wrong place), but other events still affect the object (i.e. if you press the walk button you start moving; other objects that cause death will cause the animation to repeat). How can I make it so that no other events affect the object?
Edited by Corngamer, 16 June 2012 - 04:09 PM.
#8
Posted 17 June 2012 - 06:25 AM
Just have a change instance (make another object with dying sprite)
Then in the dying object have an animation end>destroy instance
(or some other stuff you want to happen when you die, like show highscore)
#9
Posted 18 June 2012 - 07:39 PM
That works. Thanks!Here's a very easy way.
Just have a change instance (make another object with dying sprite)![]()
Then in the dying object have an animation end>destroy instance
(or some other stuff you want to happen when you die, like show highscore)
One more thing. When the player touches an object that causes death, I want everything on the screen to stop moving except for the player. How can I do this? I know I can just use a not move action, but I have multiple instances of the same objects.
#10
Posted 18 June 2012 - 07:48 PM
#11
Posted 19 June 2012 - 07:39 AM
You mean stop it from walking/moving (or you mean the sprite, gif.)?That works. Thanks!
Here's a very easy way.
Just have a change instance (make another object with dying sprite)![]()
Then in the dying object have an animation end>destroy instance
(or some other stuff you want to happen when you die, like show highscore)
One more thing. When the player touches an object that causes death, I want everything on the screen to stop moving except for the player. How can I do this? I know I can just use a not move action, but I have multiple instances of the same objects.
In your character have a collision event with the object (the one that makes you die)
Then have moved fixed
Then this is what you should put it in:
Click Applies to "Object", then select the object that you want to stop
Click the square button in middle.
Speed to 0
And there you have it
//what this does is it stops ALL the obj_"whatever obj you picked" (since you said there are multiple instance of the same object)
So if you want to stop another object just add another move fixed
and do the same but change the "Applies to object" part (pick the new object you want to stop)
Edited by GMKn00b, 19 June 2012 - 07:44 AM.
#12
Posted 21 June 2012 - 12:15 PM
Edited by Corngamer, 21 June 2012 - 12:15 PM.
#13
Posted 22 June 2012 - 07:03 AM
....only one of the subimages is shown (only one part of animation)?
So this what you should have. (in player)
//collision with block
change instance (dying)
And (in the dying object, have the dying sprite)
//other (animation end)
delete instance
IS this what you have?
Edited by GMKn00b, 22 June 2012 - 07:19 AM.
#14
Posted 25 June 2012 - 05:34 PM
Not exactly. For the dying object, I have Create > Change sprite into dying animation, and then Animation End > Display Message (Game Over!), Show Highscore Table, Restart Game.So when the block, touches the player (the block moves?).....
....only one of the subimages is shown (only one part of animation)?
So this what you should have. (in player)
//collision with block
change instance (dying)
And (in the dying object, have the dying sprite)
//other (animation end)
delete instance
IS this what you have?
#15
Posted 26 June 2012 - 06:49 AM
of the dying object to dying animation (instead of doing change sprite)
So basically all you should have is Animation End
Edited by GMKn00b, 26 June 2012 - 06:50 AM.
#16
Posted 26 June 2012 - 04:07 PM
That didn't work.Just delete the create event, and change the sprite
of the dying object to dying animation (instead of doing change sprite)
So basically all you should have is Animation End
#18
Posted 27 June 2012 - 11:37 PM
Setting "perform events" to "yes" and putting the Create Event back into the death object seem to make it work. But I'm confused about what you are saying about it executing the events.If you did yes, it executes the original objects 'Destroy Event' turning into 'Create Event'.
If you did no, neither of those two are executed
SOURCE
#19
Posted 28 June 2012 - 12:53 AM
#20
Posted 28 June 2012 - 01:06 AM
Ok, that makes sense! Thanks guys!Setting perform events to true will make it so that the new object's create event (which is the event we are concerned about) is executed (hence the name perform events).
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











