+Plateo et Ana Posted November 5, 2016 Share Posted November 5, 2016 (edited) Hi there, Folks from this forum have already helped me a LOT, so I allow myself to post another question. I'm not an urwigo nor an LUA guru, so it helps a lot. In Urwigo, there's an action you can use in order to save and close the game. For my cartridge, I want to create an event when the cartridge closes without saving the game. I want to do save states at specific times during gameplay, and I also want to be able to close the game at very specific times. Is there a way to do that with an LUA function ? Edited November 5, 2016 by Plateo et Ana Quote Link to comment
+charlenni Posted November 6, 2016 Share Posted November 6, 2016 We had this discussion here in the forum some time ago. The consensus was, that it is no good behavior to do this, because the players are frustrated. It will be no good encouragement. If you want to do it anyway, than you could use a Lua command to crash the cartridge. Try local func = nil func() It's not good to do this at all, because the Wherigo players are in an undefined state, but should do, what you want. Quote Link to comment
Ranger Fox Posted November 6, 2016 Share Posted November 6, 2016 There's an easier way to get what you want. Close the cartridge Just deactivate all your zones and tell the player they lost the game. (There is a call to exit the game, but I think that is usually accompanied by saving the game.) Save only during certain times Maintain a number variable. At certain stages in the cartridge, increment the variable. This represents the player passing a checkpoint. As for resuming the cartridge, there's an event for that. Write something that tests for the checkpoint variable's value and then set the cartridge objects up (zones, items, characters, etc.) in the way they should be right after passing the checkpoint. It now no longer matters when the player saves because you are controlling what the cartridge looks like when it is resumed. Close the cartridge, reprised Instead of closing the cartridge, tell the player they lost and call your script to resume the cartridge at the checkpoint variable. Quote Link to comment
+watersphere Posted May 1, 2021 Share Posted May 1, 2021 A few years later I am also looking for an implementation of something like "checkpoints" (= reset the gameplay to a specific time / situation). The difficult part for me is Quote ...then set the cartridge objects up (zones, items, characters, etc.) in the way they should be right after passing the checkpoint. From the checkpoint to the time when the game is to be reset, there may have been quite a lot of changes. It can be quite challenging to get all of them back to the state of the checkpoint. So I was wondering if there is a way to save and load the current state of the gameplay under a qualified name (something like "Save As" via a Lua command for example)? Quote Link to comment
+Kalkendotters Posted May 1, 2021 Share Posted May 1, 2021 2 hours ago, watersphere said: So I was wondering if there is a way to save and load the current state of the gameplay under a qualified name (something like "Save As" via a Lua command for example)? No, there is only a 'save' command. No way to save under another name. You could make some variables that remember the state at some point and save them too. Then you could reload in your cartridge the stage-variables back into the 'running'variables... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.