rafhot
Member
Lagarto has created a very cool superjump script for my project so i decided share it here
first put this code on the character header:
then create a follow5 animations (this could be a copy paste from your jump animation)
and create a freespecial animation that will trigger the move in my game i set down up jump to activate it
so
thats it now you just need put some effects for the jump and a superjump sound
all credit goes to lagarto who did it for me
first put this code on the character header:
Code:
script @script
void main()
{
void self = getlocalvar("self");
int pindex = getentityproperty(self,"playerindex");
void attack1 = playerkeys(pindex, 0, "attack");
void down = playerkeys(pindex, 0, "movedown");
void up = playerkeys(pindex, 0, "moveup");
void moveright = playerkeys(pindex, 0, "moveright");
void moveleft = playerkeys(pindex, 0, "moveleft");
if(getentityproperty(self,"animationid")==openborconstant("ani_follow5"))
{
int a = getentityproperty(self,"a");
if(attack1) performattack(self,openborconstant("ani_jumpattack"));
if(attack1 && down) performattack(self,openborconstant("ani_jumpattack2"));
if(attack1 && up) performattack(self,openborconstant("ani_jumpattack3"));
if(moveright && a>0)changeentityproperty(self, "velocity", 0.5,NULL(),NULL());
if(moveleft && a>0)changeentityproperty(self, "velocity", -0.5,NULL(),NULL());
}
}
@end_script
then create a follow5 animations (this could be a copy paste from your jump animation)
Code:
anim follow5
dropframe 2
landframe 3
offset 94 161
bbox 86 41 20 105
delay 1
frame data/chars/Dragon/pg18.gif
delay 100
frame data/chars/Dragon/pg18.gif
delay 100
offset 98 155
bbox 89 65 25 64
frame data/chars/Dragon/pg19.gif
delay 8
offset 95 136
frame data/chars/Dragon/pg39.gif
and create a freespecial animation that will trigger the move in my game i set down up jump to activate it
so
Code:
com D U J freespecial5
Code:
anim freespecial5
@script
if(frame ==2)
{
void self = getlocalvar("self");
changeentityproperty(self, "aiflag", "attacking", 0);
changeentityproperty(self, "aiflag", "idling", 0);
changeentityproperty(self, "aiflag", "jumping", 1);
changeentityproperty(self, "takeaction", "common_jump");
changeentityproperty(self, "velocity",NULL(),NULL(),7);
performattack(self, openborconstant("ani_follow5"));
}
@end_script
delay 6
offset 95 136
bbox 85 66 26 69
frame data/chars/Dragon/pg39.gif
frame data/chars/Dragon/pg39.gif
frame data/chars/Dragon/pg39.gif
thats it now you just need put some effects for the jump and a superjump sound
all credit goes to lagarto who did it for me