1. Post #1
    This is a script that allows you to create dynamic animations using only Lua. Two example stances are included. It is obviously for coders. There is no use for the average gmod user.

    Use Entity(1):SetLuaAnimation("staffholdspell") or Entity(1):SetLuaAnimation("stancetest") and then turn third person mode on to see the examples. staffholdspell will only work correctly if you have a weapon out that uses the ACT_HL2MP_IDLE_MELEE2 group.

    Download API + editor:
    CURRENT (SVN): svn://noxiousnet.com/trunk/public/gmod13/animationsapi
    CURRENT (DDL): http://heavy.noxiousnet.com/boneanimlibv5.rar

    Hooking up with your addon/gamemode/whatever
    include("boneanimlib.lua") in the server code. include("cl_boneanimlib.lua") in the client code. You are now ready to make calls to the API.
    It's suggested you put this stuff in its own folder.

    Editor
    An editor is included. Type animate in the console to open it. I did not make the editor.

    FrameData table structure
    float RU, float RR, float RF - Rotate up, rotate right, rotate forward. What you'll most likely be using for all animations.
    float MU, float MR, float MF - Move up, move right, move forward. Usually not used unless you really know what you're doing or want to make some wacky looking animations.

    Animation table structure
    integer Type - The type of animation it is. Can be one of these: TYPE_GESTURE, TYPE_STANCE, TYPE_SEQUENCE, TYPE_POSTURE. See the script for more info on each.
    integer Interpolation - Can be one of these: INTERP_LINEAR, INTERP_COSINE, INTERP_CUBIC, INTERP_DEFAULT. Determines how the animation is smoothed between frames. Linear is no smoothing. Cosine is the best quality/compatibility balance. Cubic will smooth the best but your animation frames may overflow in to each other.
    table FrameData - See above and the examples inside the code.
    function PreCallback(pl, sGestureName, tGestureTable, iCurFrame, tFrameData, fFrameDelta) - Allows you to do work on the animation before being processed. Perform actions on tGestureTable.
    function ShouldPlay(pl, sGestureName, tGestureTable, iCurFrame, tFrameData, fFrameDelta, fPower) - If this exists and doesn't return true then the animation stops early.

    Awesome Strike: Source uses a few animations made with this system.
    Reply With Quote Edit / Delete Reply Show Events Useful x 48Lua King x 28Winner x 5Dumb x 4Agree x 3Artistic x 3Friendly x 2Funny x 1Optimistic x 1 (list)

  2. Post #2

    September 2009
    23 Posts
    awesome.
    Reply With Quote Edit / Delete Reply Canada Show Events Agree Agree x 18Optimistic Optimistic x 1 (list)

  3. Post #3
    I'm Better Than You
    Handsome Matt's Avatar
    August 2008
    5,535 Posts
    Nice work.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 6Dumb Dumb x 2Zing Zing x 1 (list)

  4. Post #4
    By the way, stancetest is only testing the ability to move bones. In a normal custom animation you would only want to ROTATE the bones since the engine automatically handles offsetting from the parent bone and moving child bones.
    Reply With Quote Edit / Delete Reply Show Events Useful x 4Informative x 2Agree x 1Disagree x 1Dumb x 1 (list)

  5. Post #5
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,829 Posts
    Shit, that's cool.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 4 (list)

  6. Post #6
    Sweet Roll Moderator
    Daimao's Avatar
    February 2007
    4,322 Posts
    Didn't the documentation explicitely say that BuildBonePositions wasn't meant for animations?
    Reply With Quote Edit / Delete Reply Netherlands Show Events Funny Funny x 25Agree Agree x 8Dumb Dumb x 2 (list)

  7. Post #7
    Gold Member
    esalaka's Avatar
    July 2007
    10,201 Posts
    That is why it had to be tried.
    Reply With Quote Edit / Delete Reply Finland Show Events Funny Funny x 61Agree Agree x 6Zing Zing x 2Winner Winner x 1 (list)

  8. Post #8
    TehPeeMast3r's Avatar
    October 2008
    811 Posts
    This is going to be great.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1 (list)

  9. Post #9
    Gold Member
    -TB-'s Avatar
    August 2008
    1,383 Posts
    Do you think this could be used to make npcs climb over a wall?
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1Disagree Disagree x 1Dumb Dumb x 1 (list)

  10. Post #10
    It could be used for anything you want, even having it so the animation can interact with the environment. Example, you could get the closest wall next to the npc and have their arm extend to it. It's really tedious without an editor.
    Reply With Quote Edit / Delete Reply Show Events Informative Informative x 18Agree Agree x 1Useful Useful x 1 (list)

  11. Post #11
    moo
    CowThing's Avatar
    November 2006
    4,818 Posts
    That's pretty neat.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 2 (list)

  12. Post #12
    TehPeeMast3r's Avatar
    October 2008
    811 Posts
    Wait wait.. How does this thing work.. Do you need to know how to code?

    boxes are accepted :sigh:
    Reply With Quote Edit / Delete Reply United States Show Events Dumb x 43Funny x 7Optimistic x 3Friendly x 1Agree x 1Lua King x 1 (list)

  13. Post #13
    Roiyaru's Avatar
    September 2009
    39 Posts
    Very nice Jetboom!

  14. Post #14
    Emz
    Gold Member
    Emz's Avatar
    October 2008
    2,318 Posts
    That is really cool, nice one.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 2 (list)

  15. Post #15
    yngndrw's Avatar
    March 2008
    870 Posts
    That's pretty damn cool, well done. :D
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 2 (list)

  16. Post #16
    CptFuzzies's Avatar
    June 2007
    638 Posts
    Hey! You telepathically stole my idea! That's okay. One of my concept designs is an in-game equivalent of the SDK Faceposer.

    But no one's going to work on it, so I'm safe.
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 37Agree Agree x 2Optimistic Optimistic x 1Informative Informative x 1 (list)

  17. Post #17
    This is for animations, not face posing.
    Reply With Quote Edit / Delete Reply Show Events Agree Agree x 14Dumb Dumb x 7 (list)

  18. Post #18
    CptFuzzies's Avatar
    June 2007
    638 Posts
    Faceposer entails more than face posing.

    Edited:

    This: http://developer.valvesoftware.com/wiki/Faceposer

    And if you think I wouldn't spend time doing it. You're wrong. Besides, everything looks better in Derma with my VGUI2 skin.

    Fantastic work on the animation API, by the way.
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 22Disagree Disagree x 1Agree Agree x 1Optimistic Optimistic x 1 (list)

  19. Post #19
    LauIsFun's Avatar
    August 2009
    69 Posts
    Faceposer entails more than face posing.

    Edited:

    This: http://developer.valvesoftware.com/wiki/Faceposer

    And if you think I wouldn't spend time doing it. You're wrong. Besides, everything looks better in Derma with my VGUI2 skin.

    Fantastic work on the animation API, by the way.
    Now I can masturbate in game too!
    Reply With Quote Edit / Delete Reply United States Show Events Funny x 25Optimistic x 3Dumb x 1Informative x 1Agree x 1 (list)

  20. Post #20
    Pass along
    commander204's Avatar
    May 2008
    4,065 Posts
    Yes :d
    Reply With Quote Edit / Delete Reply France Show Events Dumb Dumb x 1 (list)

  21. Post #21
    Gold Member

    June 2007
    5,036 Posts
    Euphoria HERE I COME!
    Reply With Quote Edit / Delete Reply Netherlands Show Events Optimistic Optimistic x 1Funny Funny x 1Agree Agree x 1 (list)

  22. Post #22
    Pass along
    commander204's Avatar
    May 2008
    4,065 Posts
    Could you please Explain a bit what everything means please? :3
    Reply With Quote Edit / Delete Reply France Show Events Dumb Dumb x 2Bad Reading Bad Reading x 1Agree Agree x 1 (list)

  23. Post #23
    Chill Moderator
    Grea$eMonkey's Avatar
    May 2007
    6,302 Posts
    Pretty cool, but for a lot of custom animations I'd think an actual editor would be better. But this could be very useful for small details in a game.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 6Dumb Dumb x 2 (list)

  24. Post #24
    TehPeeMast3r's Avatar
    October 2008
    811 Posts
    Hey! You telepathically stole my idea! That's okay. One of my concept designs is an in-game equivalent of the SDK Faceposer.

    But no one's going to work on it, so I'm safe.
    do it. do it.
    Reply With Quote Edit / Delete Reply United States Show Events Disagree Disagree x 1 (list)

  25. Post #25
    likes men
    Python1320's Avatar
    May 2007
    1,720 Posts
    http://img225.imageshack.us/img225/7681/gmconstruct0005.jpgGive me that before you hurt someone with it.
    Reply With Quote Edit / Delete Reply Finland Show Events Funny Funny x 22 (list)

  26. Post #26
    Salads's Avatar
    November 2008
    176 Posts
    http://img225.imageshack.us/img225/7681/gmconstruct0005.jpgGive me that before you hurt someone with it.
    The position Kleiner's right arm is in looks painful.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 8Funny Funny x 2 (list)

  27. Post #27
    I'm Better Than You
    Handsome Matt's Avatar
    August 2008
    5,535 Posts


    "Pick up that can!"
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Funny Funny x 30Dumb Dumb x 2Optimistic Optimistic x 2Winner Winner x 1 (list)

  28. Post #28
    Chill Moderator
    Grea$eMonkey's Avatar
    May 2007
    6,302 Posts
    I may get some use out of this. :biggrin:
    Reply With Quote Edit / Delete Reply United States Show Events Optimistic Optimistic x 6Dumb Dumb x 1Agree Agree x 1 (list)

  29. Post #29
    foxcock
    Bletotum's Avatar
    June 2008
    6,873 Posts
    Win. I would imagine the noxiousnet developers might use this, for the ZS.

    I suppose an editor would save text files that can be called by this script?
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 12Funny Funny x 1 (list)

  30. Post #30
    the noxiousnet developers
    me?

    I suppose an editor would save text files that can be called by this script?
    No, it would output plain text which you put in to a shared script.
    Reply With Quote Edit / Delete Reply Show Events Funny Funny x 3 (list)

  31. Post #31
    Gold Member
    Megalan's Avatar
    October 2005
    561 Posts
    Win. I would imagine the noxiousnet developers might use this, for the ZS.
    As far as i know jetboom already using this in some noxiousnet gamemodes
    Reply With Quote Edit / Delete Reply Russian Federation Show Events Late Late x 2Bad Reading Bad Reading x 2 (list)

  32. Post #32
    Gold Member
    Gbps's Avatar
    December 2008
    3,641 Posts
    I absolutely love you for this.

    Edited:

    Babies, let me have them
    Reply With Quote Edit / Delete Reply United States Show Events Informative Informative x 9Funny Funny x 3Optimistic Optimistic x 1 (list)

  33. Post #33
    Gold Member
    Carnag3's Avatar
    March 2006
    275 Posts
    Could you tell what MU, MR , MF, RU, RF, RR are i know MU is up/down but i don't really know what the others are without testing them all.

  34. Post #34
    Gold Member
    Gbps's Avatar
    December 2008
    3,641 Posts
    MU is up. Negative MU is down.
    MR is right. Negative MR is left.
    MF is forward. Negative MF is backwards.
    RU is rotate up. Negative RU is rotate down.
    RF is rotate forward. Negative RF is rotate backwards.
    RR is rotate right. Negative RR is rotate left.

    Correct me if I'm wrong, but that's what I believe to be correct.
    Reply With Quote Edit / Delete Reply United States Show Events Informative Informative x 9Agree Agree x 1Winner Winner x 1Friendly Friendly x 1 (list)

  35. Post #35
    Gold Member
    Carnag3's Avatar
    March 2006
    275 Posts
    Thanks
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 1 (list)

  36. Post #36

    September 2009
    12 Posts
    Now, i might throw this phrase around occasionally,but often i dont mean it. Now however, i really really really want to say that this is made of so much win that you deserve a cake that is both delicious and moist!
    Reply With Quote Edit / Delete Reply Finland Show Events Funny Funny x 6Dumb Dumb x 4 (list)

  37. Post #37
    TehPeeMast3r's Avatar
    October 2008
    811 Posts
    -snip-

    To lexi: No.
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 8 (list)

  38. Post #38
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    Rate me dumb if you must but I have a question.. How do you use this? :saddowns:
    Are you a developer working on a project that needs players to make gestures that they are not programmed to do?
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Funny Funny x 8Agree Agree x 1 (list)

  39. Post #39
    foxcock
    Bletotum's Avatar
    June 2008
    6,873 Posts
    Usefull and fun reguardless of whether it needs it, I know that users on my server would like something like this, with an editor. (Not for IN the server, unless the supposed editor could support live making it, and then being able to use it, admin or not.) . I know that I'd want to add animations into sweps that I download. (Ex: The hax swep, simply pointing.) .
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 2Bad Spelling Bad Spelling x 1 (list)

  40. Post #40
    cheiftiger's Avatar
    March 2009
    231 Posts
    I am SOOO making a middle finger animation with this xD
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 15Funny Funny x 2Agree Agree x 2 (list)