Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: setStance() possible?

  1. #11
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    I digged some time through the animation functions and I could set a new animation, but it was instantly resetted. Maybe this helps you to look further without redoing whats already done.

    libcod, for version 1.3 iirc:

    PHP Code:
    int BG_AnimationIndexForString(char *string) { ... } 
    https://github.com/kungfooman/libcod...bcod.cpp#L1920

    BG_PlayAnim e.g. I just hooked to look what arguments it receives. Just play a bit around with it or add a hook to dump the arguments and still execute the original function.

    The actual function calls for testing this animation stuff is here: https://github.com/kungfooman/libcod/blob/master/gsc.cpp#L1935

    I was calling the closer functions by abusing a cvar, with this: https://github.com/kungfooman/cod2_s...ugging.gsc#L10

    PHP Code:
    /rcon set closer "1100,first,second,third arg" 
    PHP Code:
            //                                         ps          animIndex   bodyPart    is_0/time   setTimer, isContinue, force
            
    case 1100: return stackPushInt(BG_PlayAnim(0x087054800x000001180x000000020x00/*000567*/101)); // reload
            
    case 1101: return stackPushInt(BG_PlayAnim(0x087054800x000000820x000000030x00/*000037*/1/*0*/11)); // strafejump
            
    case 1102: return stackPushInt(BG_PlayAnim(0x087054800x000000830x000000030x00/*000037*/101)); // oO 1
            
    case 1103: return stackPushInt(BG_PlayAnim(0x087054800x000000800x000000030x00/*000037*/101)); // oO 2
            
    case 1104: return stackPushInt(BG_PlayAnim(0x087054800x000000000x000000020x00/*001000*/111)); // nothing
            
    case 1105: return stackPushInt(BG_PlayAnim(0x087054800x000000850x000000030x00/*000600*/111)); // highjump
            
    case 1106: return stackPushInt(BG_PlayAnim(0x087054800x000000810x000000030x00/*000037*/111)); // highjump
            
    case 1107: return stackPushInt(BG_PlayAnim(0x08705480,          60x000000030x00/*000037*/111)); 
    Today I would probably use call_function_raw though: http://killtube.org/showthread.php?2...-dlsym-dlclose

    That makes it a lot faster, no need to recompile libcod and restart the server everytime etc.

    In php's CoDExtended, get_animation_index(name):

    PHP Code:
    void GScr_xtnded_anim(int a1) { ... }
    {
    "get_animation_index"GScr_xtnded_anim0}, 
    https://github.com/riicchhaarrd/CoDE...script.cpp#L16
    timescale 0.01

  2. The Following User Says Thank You to kung foo man For This Useful Post:

    filthy_freak_ (30th June 2015)

  3. #12
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Success!


  4. The Following 3 Users Say Thank You to filthy_freak_ For This Useful Post:

    kung foo man (30th June 2015),Mitch (1st July 2015),Ni3ls (1st July 2015)

Posting Permissions

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