Page 1 of 1

can u help me with changing animation

PostPosted: Sun Dec 13, 2009 6:37 pm
by lllllsp1d3rlllll
my name is doug iv done all kinds of programing i was using bsp and now im making a little game with game editor but im having a big problem.
i want with one button to change the image every time u press the space bar down it only changes the image to the first image i say change to so it will not chancge to c3.
ok the point im trying to achieve is to half to press the button fast to change the image to the next image in the sprite to pull the actors gun out the holster to shoot im making a western shooting game.my email is vb.venom@yahoo.com please email if u have any answeres for me.thank you

if("main_actor", "c1") {
ChangeAnimation("main_actor", "c2", FORWARD);
}
else {
if("main_actor", "c2") {
ChangeAnimation("main_actor", "c3", FORWARD);
}
else {
if("main_actor", "c3") {
ChangeAnimation("main_actor", "c4", FORWARD);
}
}
}

Re: can u help me with changing animation

PostPosted: Sun Dec 13, 2009 6:48 pm
by skydereign
I won't email you, but I'll respond here. I changed your code around, but the main problem was your if statements. The main_actor check for the animation was not right, instead you can use getAnimIndex and check it with the current animindex. One thing is that this code has to be run by main_actor. If this is not what you need I can make a version that any actor can execute.

Code: Select all
if(getAnimIndex("c1")==animindex)
{
    ChangeAnimation("main_actor", "c2", FORWARD);
}
else if (getAnimIndex("c2")==animindex)
{
    ChangeAnimation("main_actor", "c3", FORWARD);
}
else if (getAnimIndex("c3")==animindex)

    ChangeAnimation("main_actor", "c4", FORWARD);
}

Re: can u help me with changing animation

PostPosted: Sun Dec 13, 2009 7:16 pm
by lllllsp1d3rlllll
main actor is the name that i named the main actor in the game the actor or caractor that will b controled and used through the hole game
c1 c2 so on are indavidule images but ill try ur code an let ya know. ok no it dont work it jumps to the last index the c4 image and makes the actor that image when u press the space bar the first time so....

Re: can u help me with changing animation

PostPosted: Sun Dec 13, 2009 7:20 pm
by skydereign
It is C with 'actors'... So you pretty much have to deal with C. The problem you have is your trigger event. I am assuming you have keydown space, but most likely you need to set that event to disable repeat events. So edit the event, the spot to set repeat to disable is pretty obvious, but if you need any more assistance just ask. This would make it so you have to rapidly press the key to cause it to repeat...

Re: can u help me with changing animation

PostPosted: Sun Dec 13, 2009 7:23 pm
by lllllsp1d3rlllll
yea i know were to disable it i think ill have to look but it be cool if you could add me to yahoo messenger hell maybe we can be friends. i also do vb and web sites and im good with images so this sprite crap is nothing to me im atleast glad im good with the images and crap.tho im about to give up on game editor.

Re: can u help me with changing animation

PostPosted: Sun Dec 13, 2009 7:24 pm
by lllllsp1d3rlllll
thank you so much that worked i disabled repeat and it worked.