Reset momevents to avoid bugs against noaicontrol

White Dragon

New member
When I set noaicontrol ON to perform actions and then turn it OFF, I'm going to encounter a few BUGS if I mash random buttons in the animation between noaicontroll ON and OFF. Ex. my player is blocked LOL
I've tried everything! setidle (self) and other things but nothing works!

The only solution I could find is damageentity(self) that resets everything!

Is there any best solution? Please =(
With damageentity I waste my ATK_NORMAL# that are ONLY 10 and I would need many more (I hope one day you increase this limit).
 
Use maxattacktypes 99 in models.txt you have more than you need.



Oh, it seems there is no direct way currently. Unless you assume ATK_NORMAL11 is 19+1 (current version) and so on.
 
I tried but openBOR crash!!!
if I set ATK_NOMRAL10..9..8 etc. it's OK but from 11 to 99 openBOR autocloses =(((
Any solution? (I hope you fix this bug)
And other solution instead of damageentity?
 
I mean, use 20 directly for openborconstant("ATK_NORMAL11").
But why do you need to use that? Doesn't ATK_NORMAL works?
 
For example this is the code to get an item on touch.
Ex pizza in my TMNT project is an item on touch.
When the hero touches pizza actives this code:
Code:
                changeentityproperty(player, "noaicontrol", 1); // here I disable all keys
                changeentityproperty( player, "health", getentityproperty(player,"maxhealth") );
                changeentityproperty(player, "animation", openborconstant("ANI_FOLLOW42")); // Get PIZZA animation
                changeentityproperty(player, "velocity", 0, 0, 0); // important to stop movements!

then I reacrive noaicontrol ( changeentityproperty(player, "noaicontrol", 0) ) in the last frame of ANI_FOLLOW42 and I set setidle(self).
In this way the animation has a bug. That is if I get pizza while I press random buttons (to test the strength of my code)
the hero stops all movements...
Instead if I put damageentity in this way:
Code:
                damageentity(player,player,0,0,openborconstant("ATK_NORMAL7"));    // <-----------------------------------            
                changeentityproperty(player, "noaicontrol", 1); // here I disable all keys
                changeentityproperty( player, "health", getentityproperty(player,"maxhealth") );
                changeentityproperty(player, "animation", openborconstant("ANI_FOLLOW42")); // Get PIZZA animation
                changeentityproperty(player, "velocity", 0, 0, 0); // important to stop movements!

I solved all bugs because damageentity resets all movements. But I waste precious ATK_NORMAL#...
 
What if you use performattack(player, openborconstant("ANI_FOLLOW42")) instead of change animation, you can forget noaicontrol because you can't do a thing while you are "attacking".
 
Back
Top Bottom