Licence od 75 € Přihlásit se
DE EN FR ES IT CZ

Stop animation in specific frame

Toto téma je několik let staré. Některé údaje se mohou týkat starší verze Visionaire Studia. Aktuální návody

  1. · 11 years ago
    Hi
    Sorry maybe it's a easy question but I can't find answer in forum .VS manual is not great too.
    I want more than 1 frame in standing animations.How can I stop it in last frame?
  2. Pracujete na hře?

    Bezplatná verze umožňuje až 25 scén na projekt. Pro více scén a pro prodej hry potřebujete licenci.

    Zobrazit licence Vyzkoušet zdarma
  3. · 11 years ago
    It's in the wiki!

    setAnimFrames("anim_name", first_key, last_key)
    


    Example:

    You create an animation named "my_anim" with 15 frames.
    Then use:
    setAnimFrames("my_anim", 5, 8)
    

    It will play animation "my anim" from frame 5 to frame 8.


    If you want to freeze on last frame, you can do:
    setAnimFrames("my_anim", 15, 15)
    


    Good luck!
  4. · 11 years ago
    He also needs to include the actual setAnimFrame function inside of a definition script, can't forgot about that otherwise it won't do anything. It's a workflow I created & thus is not an internal function.

    Add this inside of a definition script inside of the script section of the editor...
    function setFrames(anim, a, b)
     if b == nil then b = a end -- fallback in case only a value was entered
     -- + --
     ActiveAnimations[anim].AnimationFirstFrame = a
     ActiveAnimations[anim].AnimationLastFrame = b
    end
    

    Now to use this you would create an execute a script action part (wherever you need it - in an action block or inside of a specific frame of an animation).
    setFrames("test", 3, 8) -- play / loop animation "test" between frame 3 to frame 8
    

    or...
    setFrames("test", 3) -- force animation "test" to play / loop frame 3 only
    
  5. · 11 years ago
    Sorry I'm beginner and couldn't still success.
    I make new script in script editor and put this code there
    setFrames(anim, a, b)
     if b == nil then b = a end -- fallback in case only a value was entered
     -- + --
     ActiveAnimations[anim].AnimationFirstFrame = a
     ActiveAnimations[anim].AnimationLastFrame = b
    end
    


    And put this code in frame 1 of standing animations (I have two frames, 0 and 1)
    setFrames("right2", 1)
    

    right2 is my name of right direction in standing animation

    I haven't stop animation. where is my wrong?


  6. · 11 years ago
    Indeed I had forgotten the main definition script grin
    Anyway...

    TinTin:
    “
    I make new script in script editor and put this code there„
    Good! (make sure it is a definition script, not execution script)

    “
    And put this code in frame 1 of standing animations„
    I think this is why it doesn't work: don't put this code inside the animation, and call it from somewhere else.
    For example:
    - on left click, execute script (copy/paste the code).
    (There is an Action "Execute A Script" where you can write your own scripts)
  7. · 11 years ago
    Yes, you can put it in your animation.

    The problem is that the editor says frame 0 but you can ignore that because the first frame index value is always 1, so the last frame of your 2 frame animation would be 2. wink
    setFrames("right2", 1)
    

    P.S: you actually want to add the execute a script action part containing the function & parameters into the frame that you want to stop it on. So add it to the final frame.
  8. · 11 years ago
    Sorry but it doesn't work yet.
    @Simon
    I paste it another location and not happened
    @AFRLme
    I paste it in last frame in standing. And not work.
  9. · 11 years ago
    Could you post some screenshots of exactly what you did please?
  10. · 11 years ago
    I make same method that you said.
    1.I made a script0 in script editor and pasted :

    setFrames(anim, a, b)
    if b == nil then b = a end -- fallback in case only a value was entered
    -- + --
    ActiveAnimations[anim].AnimationFirstFrame = a
    ActiveAnimations[anim].AnimationLastFrame = b
    end

    2.I pasted this code in frame 2 ( frame 1 in editor and it's last frame ). right2 is for standing animations :

    setFrames("right2", 2)

    It doesn't work even with 1 number too.

    I have this log :

    Implicit cast from 'int' to 'float'

    Script local label
    If use Tabletoolbar then label = "#Scripts" else label = nil end
    Objectlist ("Visobjects",took 111 ms
  11. · 11 years ago
    Do all your characters use the same animation names? If you have multiple characters on screen at the same time & they all have the same animation names, then the engine may be struggling to determine which ActiveAnimation to access.

    Would you mind sending me your ved & resource files? afrlme (at) outlook (dot) com.
  12. · 11 years ago
    I sent it.
    Sorry but my project was heavy so I made another project as default and paste your codes.please check your mail

    Thanks so much

Toto téma je uzavřené, protože tu přes rok nikdo neodpověděl. Svůj dotaz můžete položit v novém tématu.

Nové téma

Opravdu smazat tento příspěvek?