I am trying to make a script to avoid losing momentum when using cancel with the "J" and "S" buttons. I was thinking if I record the X and A velocity in a jump animation into a local variable then in the new animation I have cancelled into have a script load up the X and A variables and apply them to current animation. This is not working it keeps crashing with error:
Script compile error in 'animationscript': Data line 36, column 4
********** An Error Occurred **********
* Shutting Down *
Can't compile script 'animationscript' data/chars/1asuka/asuka.txt
code for capturing velocity:
@script
{
void self = getlocalvar("self");
int x = getentityproperty(self, "velocity", x);
int a = getentityproperty(self, "velocity", a);
if (Data > 0)
{
setlocalvar("velx" + self, x);
setlocalvar("vela" + self, a);
}
}
@end_script
Code to apply velocity:
@script
{
void self = getlocalvar("self");
int x = getlocalvar("velx" + self);
int a = getlocalvar("vela" + self);
if (Data == 1)
{
changeentityproperty(self, "velocity", x, 0, a);
}
}
@end_script
Script compile error in 'animationscript': Data line 36, column 4
********** An Error Occurred **********
* Shutting Down *
Can't compile script 'animationscript' data/chars/1asuka/asuka.txt
code for capturing velocity:
@script
{
void self = getlocalvar("self");
int x = getentityproperty(self, "velocity", x);
int a = getentityproperty(self, "velocity", a);
if (Data > 0)
{
setlocalvar("velx" + self, x);
setlocalvar("vela" + self, a);
}
}
@end_script
Code to apply velocity:
@script
{
void self = getlocalvar("self");
int x = getlocalvar("velx" + self);
int a = getlocalvar("vela" + self);
if (Data == 1)
{
changeentityproperty(self, "velocity", x, 0, a);
}
}
@end_script