Solved Difference between changeentityproperty and perform attack

Question that is answered or resolved.

O Ilusionista

Captain 100K
Hi,

What is the difference between the two cases, if I use an attack animation:

Case 1
Code:
changeentityproperty(vSelf, "animation", openborconstant("ANI_FREESPECIAL"));

Case 2
Code:
performattack(vSelf, openborconstant("ANI_FREESPECIAL"));

Its the same thing?
 
1) performattack() is a func that performs an attack and in that time the player/enemy cant change its animation (with a player u cant move it).
The attack will terminate and then the entity will auto-set to idle!!

2) with changeentityproperty "animation" the animation will change in another animation. at the end of the animation the entity will not return to idle!! So if the end of animation doesn't provide the return to idle (or a change of animation) the last animation will be in loop at the last frame. also if your animation provide that u can move your player/enemy (ex. jump/walk etc..) u can be able to move your character in that animation.
 
O Ilusionista said:
in C++ (and C if I am not wrong) we can use short, long, etc.
short int consumes less memory.

thanks

Yeah I know ^__^ but in openBOR u're using a script and so it's only "int" ;)
 
Actually the perform attack puts the entity into an attack state and changes the animation which in turns tells the openbor system a whole bunch of things about the entity. This should always be used when changing to an attack animation.

The  changeentityproperty "animation"  literally does that, it only changes the entities animation but doesn't change the state of the entity, so if he was in idle status and you use the changeentityproperty "animation" command that does an attack, then the system still thinks that the entity is in idle state and will behave as if you still where in idle mode.

Its pretty important to the AI to have the correct status per animation, both player and enemy.
 
some important info to share: MatMan is right.
I had a strange bug on Hulk, which was the only char which can hurt other players in some moves (even with a VERSUSDAMAGE disabled) and even if I set candamage to only enemy and obstacle.

I was using this script
Code:
void anichange(void Ani)
{// Animation changer
    void self = getlocalvar("self");

    changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
}

As MatMan said, the engine just changes the animation, it doesn't knows that you are, actually, attacking and bugs the move.

Now I use this script for attacks

Code:
void anichangeattack(void Ani)
{// Animation changer
    void self = getlocalvar("self");

    performattack(self, openborconstant(Ani)); //Change the animation
}

And the bug is gone.
 
Back
Top Bottom