Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by rki. 06/18/24 15:32
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
6 registered members (AndrewAMD, rki, Mino, Martin_HH, squik, Ayumi), 1,126 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Animation Issues HELP #95452
10/23/06 00:55
10/23/06 00:55
Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
openfire2691 Offline OP
Junior Member
openfire2691  Offline OP
Junior Member

Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
I don't know if this is the right place to put it, but I have an animation issue. I made a soccer player (actually he's just a cell-shaded stickman, but I am using him as a soccer player). One of his main animations is his "kick" animation, where he will move forward a little bit and kick the ball. His body and limbs are all bone-animated. The problem came up when I tried to implement him in my game. I typed up a script that would, when you press [space], run the animation and make him kick the ball. Unfortunatly, when you tap space the man's body goes through the motions, but his limbs don't move at all. When you hold space, though, he works just fine. Is this a common problem? Is there a simple solution? PM me if you need the script I am using, and I am working on uploading a video of my problem. Thanks!


When your script isn't working right, usually it's because it's doing exactly what you told it to. -An Unknown Programmer
Re: Animation Issues HELP [Re: openfire2691] #95453
10/23/06 19:48
10/23/06 19:48
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
try to play your animation in a while() loop.

Code:


if(key_space == 1)
{
while(1)
{
wait(1);
soccerplayer.frame += 1;

if(soccerplayer.frame > soccerplayers last frame)
{
break;
}

}

}




I dont know if it helps but your problem sounds strange anyway so give it a try

zwecklos

Last edited by zwecklos; 10/23/06 19:50.
Re: Animation Issues HELP [Re: zwecklos] #95454
10/24/06 12:33
10/24/06 12:33
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
Quote:

try to play your animation in a while() loop.

Code:


if(key_space == 1)
{
while(1)
{
wait(1);
soccerplayer.frame += 1;

if(soccerplayer.frame > soccerplayers last frame)
{
break;
}

}

}




I dont know if it helps but your problem sounds strange anyway so give it a try

zwecklos



that won't work with bones animation, you should use ent_animate like that

Code:

if(key_space == 1)
{
soccerplayer.skill1=0;
while(soccerplayer.skill1<100)
{
soccerplayer.skill1 += 1;
ent_animate(soccerplayer,"kick",soccerplayer.skill1,anm_add);
wait(1);
}
}



Re: Animation Issues HELP [Re: Shadow969] #95455
10/26/06 00:41
10/26/06 00:41
Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
openfire2691 Offline OP
Junior Member
openfire2691  Offline OP
Junior Member

Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
Here's the code I am using. As you can see, it's already in a while loop...

Code:
 
function kick_ball(){ //lets me kick the ball
performing_kick = 1;
my.skill48 = 0; //reset the animation
while (my.skill48 <= 100){ //while the animation hasn't finished
ent_animate(player,"pass",my.skill48,anm_cycle); //play the animation
my.skill48 += 2; //update the animation
if (my.skill48 == 50){
movement_ball.x = 15; //sets the ball's movement
movement_ball.z = -13;
posses = 0; //no one has the ball
kicked = 1;
}
wait(1);
}
movement_ball.x = 15;
movement_ball.z = -13;
posses = 0; //no one has the ball
kicked = 1;
wait(10); //just so I won't get the ball back immediately again
performing_kick = 0; //I'm not kicking it any more
}




When your script isn't working right, usually it's because it's doing exactly what you told it to. -An Unknown Programmer
Re: Animation Issues HELP [Re: openfire2691] #95456
10/29/06 00:46
10/29/06 00:46
Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
openfire2691 Offline OP
Junior Member
openfire2691  Offline OP
Junior Member

Joined: Sep 2006
Posts: 74
Northwestern Oregon, United St...
Oh, I figured it out. I was running this function outside of the main character action, so the action continued to run independently. This wasn't bad, but one of my lines of code said:

Code:
 
if(key_any == 0){ //if nothing is pressed...
ent_cycle("stand", my.skill46); // play "stand" frames animation
my.skill46 += 2 * time; // "stand" animation speed
my.skill46 %= 100; // loop animation
}



so when I let go of space it was assuming I was just standing there. I had to change it to

Code:
 
if(key_any == 0 [i][b]&& performing_kick == 0[/b][/i] ){ //if nothing is pressed...
ent_cycle("stand", my.skill46); // play "stand" frames animation
my.skill46 += 2 * time; // "stand" animation speed
my.skill46 %= 100; // loop animation
}



so that while I was kicking the ball, the "stand" animation wouldn't run.


When your script isn't working right, usually it's because it's doing exactly what you told it to. -An Unknown Programmer

Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1