Jump

Topics regarding Scripting with Reality Factory
Post Reply
Masta_J
Posts: 37
Joined: Tue Apr 17, 2007 1:35 pm
Location: Johannesburg South Africa

Jump

Post by Masta_J »

I have a scripted player, and I'm trying to add a jump order where the player stays in the air (fly's). So far, I can get the player to jump, but he doesn't float or return to his start order (in this case, "run player"). Instead, he keeps on bouncing in the same spot. Here's the code I added:

[/code]
Jump[()
{

ForceUp(FORCEUP*SCALE); // shoot the projectile (= do the damage)
}

if(self.animate_at_end) // check if the animation has finished
{
Gravity(false);
self.think="RunPlayer"; // go back to the basic routines
return 0;
}

} ]

}
A good warrior knows his limits, but a great warrior finds his way around them.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

Jump[()
{

ForceUp(FORCEUP*SCALE); // shoot the projectile (= do the damage)
} <- I don't think this is supposed to be here

if(self.animate_at_end) // check if the animation has finished
{
Gravity(false);
self.think="RunPlayer"; // go back to the basic routines
return 0;
}

} ]

} <- This neither
Pain is only psychological.
Masta_J
Posts: 37
Joined: Tue Apr 17, 2007 1:35 pm
Location: Johannesburg South Africa

Post by Masta_J »

Thanks alot man, got it working...
A good warrior knows his limits, but a great warrior finds his way around them.
Post Reply