Undo condition

  • #1, by elecWednesday, 07. June 2017, 13:37 3 years ago
    Hey, its me again.
    So i wanted to ask if theres a possibility of undo-ing all conditions and values without changing every single one. When you finish the game and get back to the start menu and then start the game again it starts with all conditions and outfits of the last playthrough.
    Last Problem till finishing the game i swear haha

    Forum Fan

    109 Posts


  • #2, by afrlmeWednesday, 07. June 2017, 14:24 3 years ago
    There's multiple methods you can use for resetting all the data.

    1. manually, but as you said. That will take way too long.

    2. using the quicksave/autosave system. You need to create an autosave at the beginning of the game or after pressing the new game button during the initial scene or something. You need to wrap it inside of an if query like so...

    if autosave #1 exists
    else
     pause 500ms
     execute autosave #1
    end if


    Something along the lines of that.

    3. You can use the replaceGame() Lua function which will essentially restart the game from the beginning like how you used to be able to do on sega/snes games etc by holding down x buttons together on the gamepad.
    replaceGame("data.vis") -- replace data.vis with whatever you called the exported vis file when you compiled your game
    1

    I think option 3 is only valid for exported games. I'm not sure if you can reload ved file from the editor. I think it's vis files only.

    Imperator

    6812 Posts

  • #3, by MachtnixWednesday, 07. June 2017, 14:52 3 years ago
    I need a reset too. Example Nr. 3 looks good. What happens if I build a reset button into the game with this Lua code line? I have to reset more than 50 values to zero and to make 25 objects visible. 

    Thread Captain

    1065 Posts

  • #4, by MachtnixWednesday, 07. June 2017, 14:54 3 years ago
    It's 4.25. 

    Thread Captain

    1065 Posts

  • #5, by MachtnixWednesday, 07. June 2017, 15:15 3 years ago
    Oh, shit, this autosave-thing works great! Trying 2 weeks with Lua was pointless. Thanks AFRLme for this stupid simple solution I never have had in my mind smile

    I hope it's possible on every pc, because you need to write into an user folder, mostly C:/eigene Dateien or s.th like that. 

    Thread Captain

    1065 Posts

  • #6, by afrlmeWednesday, 07. June 2017, 15:47 3 years ago
    replaceGame() is available since 4.1 or 4.2 I think. It basically reloads the main vis file. Think of it like pressing reset button on a playstation or something.

    Imperator

    6812 Posts

Write post