Sorry if I misunderstood this command, but does it return the name of animation that is currently being played?
If so could this be used to check unit stance by checking what kind of stance (animation group of some stance) the currently played animation belongs to?
Last edited by Icarus; Nov 27 2011 at 19:22.
It returns a number. Details are in the documentation. Usage is quite problematic. Example:
Code:;only original config _lying=false _animCODE = call loadFile ":mem getplayeranim" ? _animCODE in [0,14,32,36,39,40,41,252] || _animCODE>=71 && _animCODE<=82 || _animCODE>=165 && _animCODE<=236 : _lying=true
Last edited by Faguss; Dec 1 2011 at 15:06.
Is there any way to change what number the certain animation has?
Yes, that depends on \res\config and configurations in addons. See the doc.
Extending last example. Now it includes animations from o.pbo (handgun).
Code:player switchMove "handguncrouchbase" _base = call loadFile ":mem getplayeranim" player switchMove "combat" LyingCodes = [0,14,15,32,36,39,40,41,252, _base+3, _base+138] _ranges = [71,82,165,236,_base+8,_base+12,_base+14,_base+33,_base+65,_base+68,_base+103,_base+110,_base+130,_base+135] _i = 0 _j = _ranges select _i #loop ? _j <= (_ranges select _i+1) : LyingCodes=LyingCodes+[_j]; _j=_j+1; goto "loop" ? _i < (count _ranges -2) : _i=_i+2; _j=_ranges select _i; goto "loop"
Code:_lying=false _animCODE = call loadFile ":mem getplayeranim" ? _animCODE in LyingCodes : _lying=true
Works for OFP with standard config.
Last edited by Faguss; May 4 2012 at 22:16. Reason: added link
Thank you so much!!!
If it is possible to change animation codes, than I would like to line up animations so each stance corresponds to one interval of animations.
Then (at least in theory) detecting player stance would not be difficult, and CPU intensive.
If I misunderstood something, please correct me.
Last edited by Icarus; Dec 1 2011 at 08:28.
It's not a good idea because it will work only for you and nobody else. Not mentioning how much work it would be.
It's not difficult and not CPU intensive.
It took some time to learn something about those examples you showed.
Using those Logical Operators ( ? : Ternary (shorthand for if-then-else statement)) really saves space in script that only allows 122 characters per line.
Having this limitation is it still possible to make script, that using Fwatch v1.1, would distinguish standing, crouch and prone stances, not just prone/not prone stance?
P.S. Isn't this example you showed better than that stance check script that uses "Dummy bullet"?
Thanks again for your expertise
You misunderstood, it's the Fwatch commands that are limited to 127 characters. 122 is a text limit for IGSE which usage is optional. Personally I write scripts in Notepad++ and use IGSE when testing.
Depends. For example you can use "Check Stance" on AI.Isn't this example you showed better than that stance check script that uses "Dummy bullet"?
Last edited by Faguss; Dec 4 2011 at 18:31.
So is the mem getplayeranim command only for player use?
Can it be used for bots too?