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

Load autosave using Lua

  • #1, by dror-ben-hur 8 years ago Zitieren
    Hi all,
    How can I implement this code in Lua script?


    Thanks.
  • #2, by sebastian 8 years ago Zitieren
    Hi, 

    currently there is no possible way to load a savegame via lua directly.
    You may need to start the action via lua which contains your actionparts :

    startAction("Actions[name_of_action]") 
  • #3, by dror-ben-hur 8 years ago Zitieren
    Thanks for the help.
    Sorry for the question but how do I know the 'name_of_action'?
    This Action (in the screenshot) is located under entry/button of menu called 'menuGameRestart'.

  • #4, by esmeralda 8 years ago Zitieren
    Rightclick on the action and select "copy Lua path". 
  • #5, by dror-ben-hur 8 years ago Zitieren
    On RightClick I have only a view option...
    I am using visionaire v 4.2.5
  • #6, by esmeralda 8 years ago Zitieren
    Ah sorry, this function must be new in Visionaire5.

    In your case the Lua path should be:

    Scenes.menuGameRestart.Objects.YesBttn.Actions["'Left click' executed"]

    (I filled in the bold parts according to your screenshot)
  • #7, by dror-ben-hur 8 years ago Zitieren
    Thanks, 
    that one works like charm! smile
  • #8, by afrlme 8 years ago Zitieren
    Out of curiosity why are you using Visionaire Studio 4.2.5 instead of 5.x?
  • #9, by dror-ben-hur 8 years ago Zitieren
    I found it very herd to start learning Visionaire Studio and Lua. 
    All of the code, resources and tutorials that I'm using are on 4.2.5 so it was the obviously choice...
  • #10, by afrlme 8 years ago Zitieren
    It doesn't matter. Old Lua scripts will still work in 5.x, but you now have some newer methods available too for extra shorthand.

    While 5.x might look a lot different to 4.2.5 & below, in large part due to the new GUI, it still more or less works the same. I recommend starting with 5.x for many reasons. 4.2.5 is outdated, has various unaddressed bugs & will not be getting any new updates to fix said bugs.

    Now in regards to Lua script... do you already know any scripting/programming languages or is this the first scripting language you are learning? if it is then I'd just focus on learning how to use Visionaire Studio itself first rather than diving ass first into the deep end (as I like to call it).
  • #11, by dror-ben-hur 8 years ago Zitieren
    AFRLme, 
    first I like to say I am appreciate your commitment to every post, Thank you.

    Now I dive into Visionaire I do feel safe to upgrade my environment to 5.x, is thet change is straightforward?

    About the scripting, I am developer and using in my day job many scripting and programming languages, tell the truth, I am felling more comfortable will reading Lua code  smile