dim3 Forum

Full Version: Freezing player movement while attacking
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How can I make the player not able to move while he is doing an special attack?
obj.status.freeze=true, I think. Look in the docs under 'object'. It's right there under one of the 'status' subtitles.
teh1ghool Wrote:obj.status.freeze=true, I think. Look in the docs under 'object'. It's right there under one of the 'status' subtitles.
It's obj.status.freezeInput(true);
It's most certainly not! It's =true;. (true) doesn't make any sense!
obj.status.freezeInput(true); seems to work. Strange, I didn't notice that one before Smile
teh1ghool Wrote:It's most certainly not! It's =true;. (true) doesn't make any sense!
Yeah I know. But it is (true);. Smile
Any good ideas how to avoid attack spamming? I don't want the fights to be won just by clicking one button as fast as possible. Short pause between attacks would be nice.
Yeah of course. Use weap.fire.lastFireTick();. It should go in 1/10 of a second [it might be in 1/100 of a second, can't remember] so if you do something like this, it will wait 1.5 seconds before firing again.

Code:
// Inside weapon fire function

   var fireWait=15;
   if ( weap.fire.lastFireTick()<fireWait ) weap.fire.cancel();
My game is in third person. How can I make it cancel the animations too?
ViolentCoffeeDrinker Wrote:My game is in third person. How can I make it cancel the animations too?

weap.fire.cancel() *should* stop everything and not send any animation events, if it is, then that's a bug I'll need to fix.

[>] Brian
Pages: 1 2
Reference URL's