can u help me with changing animation

Game Editor comments and discussion.

can u help me with changing animation

Postby lllllsp1d3rlllll » Sun Dec 13, 2009 6:37 pm

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);
}
}
}
for more from me check out my web site!!!
http://venom-codings.bravehost.com/index.html
lllllsp1d3rlllll
 
Posts: 27
Joined: Sun Dec 13, 2009 6:26 pm
Score: 1 Give a positive score

Re: can u help me with changing animation

Postby skydereign » Sun Dec 13, 2009 6:48 pm

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);
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: can u help me with changing animation

Postby lllllsp1d3rlllll » Sun Dec 13, 2009 7:16 pm

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....
for more from me check out my web site!!!
http://venom-codings.bravehost.com/index.html
lllllsp1d3rlllll
 
Posts: 27
Joined: Sun Dec 13, 2009 6:26 pm
Score: 1 Give a positive score

Re: can u help me with changing animation

Postby skydereign » Sun Dec 13, 2009 7:20 pm

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...
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: can u help me with changing animation

Postby lllllsp1d3rlllll » Sun Dec 13, 2009 7:23 pm

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.
for more from me check out my web site!!!
http://venom-codings.bravehost.com/index.html
lllllsp1d3rlllll
 
Posts: 27
Joined: Sun Dec 13, 2009 6:26 pm
Score: 1 Give a positive score

Re: can u help me with changing animation

Postby lllllsp1d3rlllll » Sun Dec 13, 2009 7:24 pm

thank you so much that worked i disabled repeat and it worked.
for more from me check out my web site!!!
http://venom-codings.bravehost.com/index.html
lllllsp1d3rlllll
 
Posts: 27
Joined: Sun Dec 13, 2009 6:26 pm
Score: 1 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron