Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

random animation with different costumes

  • #10, by sebastian 11 years ago Zitieren
    i dont know what CharacterCurrentOutfit will return when you save it into a lua variable.
    on top of the script you could save the current outfit into a variable and check later if its outfit a or b or c or...
    depending on that call the function for that specific outfit. Im pretty new to lua and dont know how to call the data structure stuff out of my head but i think in the wiki is an example after the most data structure names which explain how to grab these.
  • #11, by afrlme 11 years ago Zitieren
    Please update to the latest build 1182.

    I wrote this ages ago. You should only need a single script. Please try editing the startAnimation lines like so...
    startAnimation( game.CurrentCharacter.CurrentOutfit.CharacterAnimations["useinv_n"] )
    

    -- shorthand code works best in the latest build.
    or you can use longhand code in the build you are using...
    startAnimation("Game.GameCurrentCharacter.CharacterCurrentOutfit.OutfitCharacterAnimations[useinv_n]")
    

    ... either of those should work for returning the animation of the current outfit.

    P.S: you could actually make this script more global by turning it into a function which you could input the animation you want to start. As long as the prefix on the end of the animation names were always the same, i.e: use_n, use_nw, take_n, take_nw, etc, then it would be a much better option than writing a script for each interaction.