Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Fwatch General Scripting

  1. #1

    Fwatch General Scripting

    Continuing from this topic.

    You can also use Fwatch 1.1 to detect & set player animation.

    I can't think of any other method. Finding unit structure and acquiring any stance value is beyond my reach.
    Last edited by Faguss; Dec 1 2011 at 15:06.
    -------------

  2. #2
    Quote Originally Posted by Faguss View Post
    You can also use Fwatch 1.1 to detect & set player animation.

    I can't think of any other method. Finding unit structure and acquiring stance value is beyond my reach.
    Do you mean mem getplayeranim command?
    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.

  3. #3
    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.

  4. #4
    Is there any way to change what number the certain animation has?

  5. #5
    Yes, that depends on \res\config and configurations in addons. See the doc.

    Extending last example. Now it includes animations from o.pbo (handgun).

    Initalization
    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"

    Check
    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

  6. #6
    @Faguss

    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.

  7. #7
    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.

  8. #8
    @Faguss

    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
    Icarus

  9. #9
    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.

    Isn't this example you showed better than that stance check script that uses "Dummy bullet"?
    Depends. For example you can use "Check Stance" on AI.
    Last edited by Faguss; Dec 4 2011 at 18:31.

  10. #10
    So is the mem getplayeranim command only for player use?

    Can it be used for bots too?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •