License from €75 Log in
DE EN FR ES IT CZ

Zufallsanimationen Zeiteinstellungen | Random Animations Set Time

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 9 years ago
    hallo!

    ich habe das forum bereits zu diesem thema durchsucht, aber alle beiträge
    sind zwischen 3-5 jahre alt... vielleicht gibt es mittlerweile ja eine einfache/andere lösung dazu.

    ich möchte die zeit einzustellen, wann eine random animation abgespielt werden soll.
    im moment dauert es automatisch ca. 20-30 sekunden bis die random animation abgespielt wird. das finde ich zu lange.

    liebe grüsse

    irina

    hello!

    i would like to shorten the time for displaying random animations for my characters.
    is there an easy way to do so? at the moment it is approx. 20-30 seconds by default, which i find too long.

    kind regards

    irina
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license.

    See licenses Try it for free
  3. · 9 years ago
    Quick note: the data structure fields for changing the random animation min & max times are not actually scriptable which means that even though you can change them, the updated values won't get stored in the save game files.

    I also use custom random animation times too, so what I did was create a script in the script section of the editor & wrote a small loop to listen out for scene changes, if the scene changes then it updates the random animation min & max data structure fields - with this we can skirt around the issue of the times not being stored in save game files.
    local scn = nil
    
    function scene_change()
     if not game.CurrentScene:isEmpty() and game.CurrentScene:getName() ~= scn then
      scn = game.CurrentScene:getName()
      game.CurrentCharacter.CharacterCurrentOutfit.OutfitRandomMinTime = 10000
      game.CurrentCharacter.CharacterCurrentOutfit.OutfitRandomMaxTime = 20000
     end
    end
    
    registerEventHandler("mainLoop", "scene_change")

    time values are in milliseconds.
  4. · 9 years ago
    Hello,

    you can overwrite the RandomMinTime and RandomMaxTime values in the outfit via lua, but these dont get saved in the save files, so you may need to change them in the first frame of a started random animation:

    Characters["charname"].CurrentOutfit.RandomMaxTime = XXX (integer)
    Characters["charname].CurrentOutfit.RandomMinTime = XXX (integer)

    Edit: Damn, should go to lunch while posting xD
  5. · 9 years ago
    Hello,

    you can overwrite the RandomMinTime and RandomMaxTime values in the outfit via lua, but these dont get saved in the save files, so you may need to change them in the first frame of a started random animation:

    Characters["charname"].CurrentOutfit.RandomMaxTime = XXX (integer)
    Characters["charname].CurrentOutfit.RandomMinTime = XXX (integer)

    Edit: Damn, should go to lunch while posting xD
    Your method is valid too. Mine is a bit more global, but the less system intensive method would probably be to add the random min/max time changes into the first frame of each & every random animation - like you said. In our case, we have quite a lot of random animations so I used my method to save some time.

  6. · 9 years ago
    Thank you @AFRLme & Sebastian for your workaround tips!
    I tried it with AFRLme's Script, inserted it into the script section and saved it there under "randomanimation" and unchecked the box "definitions skript". but now i don't know what to do, because it does not seem to work. do i have to do some additional things? (i am not familiar with scripts)

    thank you for your help!
  7. · 9 years ago
    it has to be a definition script 
  8. · 9 years ago
    it has to be a definition script 

    tank you! i tried to run it with checked & unchecked definition script before writing, and now i found out that the alignment of the random animations somehow was wrong and therefore wouldn't play. a mix of everything (as always) made it not work :|

    but now it works fine, thank you guys a lot!

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?