• All, I am currently in the process of migrating domain registrations. During this time there may be some intermittent outages or slowdowns. Please contact staff if you have any questions.

Using "CANT" animation

How do I use "CANT" animation?

Let see what the manual http://dcemulation.org/?title=OpenBORManual#Animation_Types says first:

CANT (For players)

~Used together with MP.
~If a player has this animation, and they attempt to use an attack which costs more MP than they have at the moment, they will play this animation and can't dodge or attack until it ends.
~If the attack they were using had the Special button as input, they will block instead of playing this animation.

Unfortunately, CANT animation does NOT work by itself. Here's why:

"I've looked at the code to get it working and never could figure a way to do it without revamping way too much stuff to be worthwhile. The animation itself is valid though, and you can use script to trigger/play it." - DC

The script and explanation below (courtesy of Bloodbane), is all you need:

@script
void vSelf = getlocalvar("self");
int iMP = getentityproperty(vSelf, "mp");
if ( frame == 0 && iMP < 10 )
{
//then play can't animation
performattack(vSelf, openborconstant("ANI_CANT"), 1);
}
if ( frame == 4 ){
changeentityproperty(vSelf, "mp", iMP - 10);
}
@end_script

This script does everything you need it to, but to clarify:

This Line: if ( frame == 0 && iMP < 10 )

RED: Determines at which frame the animation should begin.
GREEN: Determines how much MP is required to trigger it

This Line: performattack(vSelf, openborconstant("ANI_CANT"), 1);

Determines what animation is played when the above requirements are met.

and finally, this line: changeentityproperty(vSelf, "mp", iMP - 10);

Replaces the "ENERGYCOST" command you would normally use while setting freespecials. Also, if your entity consumes 10 MP at 5th frame and it's MP falls below 10, it won't accidentally switch to "CANT" animation.

For more information you could check out http://openbor.boards.net/index.cgi
but you're pretty much already in the best place for that sort of thing already.  ;D

If i forgot anything, point it out in a reply and I'll add it to this post. Enjoy.

Read more: http://openbor.boards.net/index.cgi?action=display&board=scripthelp&thread=37#ixzz2FQyRrXgZ
 
Back
Top Bottom