Stop animation in specific frame

  • #10, by TinTinFriday, 29. January 2016, 16:32 3 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

    Forum Fan

    187 Posts


  • #11, by AFRLmeFriday, 29. January 2016, 16:57 3 years ago
    haha... sorry. Was my fault. I forgot to declare the script as a function.
    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
    1
    2
    3
    4
    5
    6
    7

    ... that is the reason it was returning an error. Should work if you replace the script with the fixed block I just added (above).

    Imperator

    6516 Posts

  • #12, by TinTinFriday, 29. January 2016, 17:06 3 years ago
    Great!!!. It works perfect now .
    Thanks a lot

    p.s : would you mind please lead me for a reference or book absolute beginner for Lua.

    Forum Fan

    187 Posts

  • #13, by AFRLmeFriday, 29. January 2016, 17:40 3 years ago
    I recommend looking at the wiki. I've added tons of Lua stuff to it, but yeah sure, for a non-Visionaire Studio related Lua I really recommend checking out this blog: http://www.phailed.me/2011/02/learn-lua-the-hard-way-1/ as it's very easy to follow. There's also various exercises listed on it to try out.

    P.S: I recommend downloading and installing a text editor. Sublime Text is the best one (I use that). Alternatively GitHub have created a nice editor "Atom" that is almost on par with Sublime Text & it's 100% free. wink

    Imperator

    6516 Posts

  • #14, by TinTinSaturday, 30. January 2016, 05:23 3 years ago
    Thanks a lot. I appreciate for your helps.

    Forum Fan

    187 Posts

  • #15, by ke4Saturday, 30. January 2016, 09:41 3 years ago
    I'm using Atom now and it's nice... smile

    Key Killer

    810 Posts

  • #16, by TinTinSaturday, 30. January 2016, 13:20 3 years ago
    Is it possible auto complete VS write coding in Sublime Text or Atom?

    Forum Fan

    187 Posts

  • #17, by AFRLmeSaturday, 30. January 2016, 14:02 3 years ago
    Yes to a degree. Both Sublime Text & Atom have auto-complete features for many languages, including Lua script, however, they will not auto-complete Visionaire Studio data structure fields, seeing as there is no way of directly tying in the VisObj system into the text editor.

    I believe Simon plans on adding auto-complete to the internal VS script editor at some point in the future. Auto-complete, search & replace, & multi-line / word editing are features I heavily use in Sublime Text, which is why I write all my scripts in Sublime.

    P.S: There is supposed to be a method for remotely debugging your VS scripts by a third party application. http://wiki.visionaire-tracker.net/wiki/Remote_Debugging - It's not something I personally use as I tend to rely on my own cognitive logic & the basic errors / warnings returned in the messages log file, when I mess up! wink

    Imperator

    6516 Posts

  • #18, by TinTinSaturday, 30. January 2016, 16:11 3 years ago
    Nice job.Remote debugging is great for check errors. Thanks a lot smile
    I hope Simon make more user friendly for script editor . I can't see 'find' tool for search even.

    Forum Fan

    187 Posts

  • #19, by AFRLmeSaturday, 30. January 2016, 16:50 3 years ago
    Yeah the current text editor in VS is just the basic functions of Scintilla which is what Sublime Text is also based up. In other words it's technically possible for Simon or one of the other devs to create similar features that Sublime Text / Atom have, but only time will tell.

    P.S: I believe David intended on adding debugging directly into the engine itself. I don't know if he still plans on sorting that out at some point or not.

    Imperator

    6516 Posts

  • #20, by zurikTuesday, 26. February, 19:44 2 months ago
    Hi. I found this post and trying to do the same, but obviously I am doing something wrong.
    To play an animation and stop it on a specific frame. For example if I am animating a Battery or a Fuel status bar. I put that script in the Script tab, but how do I run the function? From the animation frames or action parts?

    Thanks

    Newbie

    19 Posts

Write post