Limited lives (no plug-ins on this one)

I am just trying to make a basic -- but awesome, of course!! -- game so I can learn the engine. I am a bit afraid to add plug ins before I spend some serious hours with the vanilla version of MV because if something doesn't work, I want to be sure it's not just me making a rookie mistake as opposed to something wrong with my plug-ins. I will be glad to post updates and/or the game to this website or whoever will allow me to, once it's done -- if it matters at all.

Here's my question: I don't have any plug-ins currently, and am trying to event a lives system that functions with continues, like a platformer. For instance, you start out with x lives, and every time the Knockout state is inflicted, you lose a life and load from a checkpoint of my choosing. At zero, you instantly game over, even if you load a previous save.

Is this possible in the vanilla version with just eventing? I'm trying to use states to test just the "lives" part, no continues quite yet. I'm using events within a map to inflict a state with turns on a switch, which triggers a parallel common event that reduces the number of my "lives" variable. Then I'm using a conditional branch to check if the variable < 1, if so, to gameover.

However, I'm having trouble with loading up the previous save causing this to not take place (I think). I'm able to test this successfully, but I just load up my previous save and I'm back at my max lives.

Any post that solves this issue, I'll gladly include the poster(s) (in any form you prefer) in my credits. Please let me know if you need any more info, pics, etc.

Thanks!
Well, giving an enemy an Immortal state will stop battles ending when the last enemy is killed, allowing you to run more troop commands before exiting the battle. Might be worth trying the same on your actor. Give them an Immortal state as soon as the game begins. Then in battles have a condition that checks for actor HP = 0, and when that happens give them some HP back, remove the Immortal state and abort the battle. Use events to initiate the battles, and after each one give the Immortal state back again, ready for the next battle.

Or give the state right at the start of battle, if you don't want the actors having it while on the map.

I don't know if this will work - haven't tried it.
Hi there!

I don't know if it is possible to do that in that way without plugins.
Because the Game Variables are attached by default to a save file.
So if you save with variable X = 10, when you die and lost -1 of X, then you load the game, your variable will return its value from the point you saved.

In my point of view, the only way to do that without a plugin, is instead you load a game when the player dies, you can create a fake checkpoint.

Meaning that every time the player reaches that fake checkpoint, you will have to store every information you need on switches or variables, so you can restore the game to its previous value.

Like, let's say the player finds a checkpoint. At that same moment:
  • the event ID 10, has its Self Switch A turned off
  • The variable value 3 is equal to 27
  • The event ID 2 is on the coordinates 13, 10
  • The player has 15 HP
And the list can go on... The thing is, when the player fake loads back to the checkpoint, you will need to adjust the events, variables, and everything else listed above to be with that values/states.

I can think of some ways for doing that without plugins but will require some script calls. And it is not sure that it will work.

I suggest you avoid that for now and try to find a workaround for that feature since your goal is to learn the engine avoiding using plugins. And honestly, you are doing great with that way of thinking. That is what people should do before going into the plugins.
Perhaps we could combine both methods -- it's imperfect, but could still work. Disable save anywhere. Only have checkpoints for saves. Set immortality for battles, so that "post-battle actions" can occur. Then, if HP<1, inflict the state which triggers my common event check for variable. If variable >0, return to checkpoint, prompt to save, and restore party. If <1, gameover. It's not the kind of "punishment" I imagined, but it's possible to be a major punishment if I spread checkpoints out far from eachother.
I want to include "lives" as a usable item which could increase variable, so I think this could be a good work-around for now. I'll include both of you in my credits! I dunno how PM works, so if you want to PM me or just post what you'd like me to include for your name, I'll happily put them in!
Let's come at this from a different angle: if you were using plug-ins/writing your own scripts/etc, what would you use and how would it be used? I might as well ask now for later, as I do want this system to work as envisioned at some point for another game (or extension/update for this one, possibly).
in case you want a variable + game over, you need a persisted variable
plugin like Olivia_MetaControl, than when you are game over, the value
of the variable stays the same (globally or locally).

if you have a save game, so game over or not.

without a plugin is what Eli said, a fake checkpoint/game over.
with option continue or not, if not, the real "game over" scene.

but that is entirely up to you, but that plugin is probably the only
thing you need for this kind of mechanic to make it smoothly.
in case you want a variable + game over, you need a persisted variable
plugin like Olivia_MetaControl, than when you are game over, the value
of the variable stays the same (globally or locally).

if you have a save game, so game over or not.

without a plugin is what Eli said, a fake checkpoint/game over.
with option continue or not, if not, the real "game over" scene.

but that is entirely up to you, but that plugin is probably the only
thing you need for this kind of mechanic to make it smoothly.

This looks like exactly what I need -- for the future. However my MV is 1.6.2 and this was built for 1.6.1. This is the part where I get scared something's gonna break and I wont know if it's the plugin or just me.
MV 1.6.1 and 1.6.2 are basicly the same and does work (as I have both versions).
it mostly work on "load save" within a game, not sure on game over.

but you can try it, if that works too. but I like this plugin alot for some neat
mechanics.

see if it works, if it does, your good to go =)
just read the helpfile carefully though. or the tutorial on the website.
In the End Players could just circumvent the Deletion/Perma Death of there Safe File by
copy pasting them elsewhere on the pc and when they die they replace the new one with the old one on there pc.

The Game "The Long Dark" got Perma Death where your Safe File is gone after you Die, but Players work around it like mentioned above.
Alternatively they would just deinstall and reinstall the Game and than insert the Safe File.

So is it worth building something that will be circumvented anyway? Iam not sure it depends i guess...

I believe i would try something like deleting all Safe Files after Death, that would maybe be possible with Scriptline,
but i guess it could also be worked around like in the above example.
But deleting all? What about the Safes of the Sister or Brother who also Plays this Game, so only deleting all Safes of one particular Playthrough.
So everytime the Game starts you would need a unique ID number for that Playthrough which is also in the Safefile or Safefile Name.
Maybe:
Only 1 Safefile allowed per Playthrough? But that solves one Problem and creates several new ones.

I don't know how to build this with Scriptlines or Plugins. But maybe this somehow helps.

Edit: I would try the Plugin @ShadowDragon mentioned.
Double-post notice: @z0sa

Please use the edit button to add more to your post if nobody else has replied, rather than making multiple posts in a row.
Double-post notice: @z0sa

Please use the edit button to add more to your post if nobody else has replied, rather than making multiple posts in a row.

My bad, won't happen again

Original thread: https://forums.rpgmakerweb.com/threads/limited-lives-no-plug-ins-on-this-one.147274/