How to have no game over on random encounters

I'm very new to rpg maker (just downloaded the trial yesterday), and I've been trying to allow the player to lose random encounters, similar to event encounters.


After searching around for answers, I started digging into the core rpg maker files, and came up with this script:


BattleManager._canLose = true


When used as a Turn 0 battle event, this seems to do just what I wanted (override the game over behaviour). However, this kind of thing wasn't mentioned anywhere (from what I found).


So, I was wondering if that code is flawed, or something (everyone said you'd need a plugin).
Most people don't like random encounters, because those can become tedious and fun-destroying easily - and as a result, methods to handle their problems aren't often asked for.


Additionally, that more or less requires the default battlesystem - you can't guarantee compatibility when using it in combination with plugins that rewrite the main battlesystem.
Well...if you change that to true and it was false before it is a kind of Plugin.


A really simple one ^^


...usually you do that changes with plugins. If u decided to do it in the main file you could get confused later on, when there are errors or something.
...


BattleManager._canLose = true


When used as a Turn 0 battle event, this seems to do just what I wanted (override the game over behaviour)....



Maybe a daft question from an inexperienced User, but I'm a little confused by the apparently contradictory terms used. If I understand rightly (far from certain..!), this snippet of code will allow a Party that has been defeated in an Event Encounter (one with a Turn 0 Event...) to survive the defeat, and so not suffer a 'Game Over'. Is this correct, or how does it actually affect the Battle outcome..?


So far,  my method for invoking a Battle has been to issue an Event command 'Battle Processing', which includes the options 'Can Escape' and 'Can Lose'. How is this script call any different from the latter, if at all..?


Thanks in advance for some clarification for this old duffer.
Maybe a daft question from an inexperienced User, but I'm a little confused by the apparently contradictory terms used. If I understand rightly (far from certain..!), this snippet of code will allow a Party that has been defeated in an Event Encounter (one with a Turn 0 Event...) to survive the defeat, and so not suffer a 'Game Over'. Is this correct, or how does it actually affect the Battle outcome..?

I think it's the same as the event encounter. If the player loses, the game continues.


The event command does the same thing. Just sets BattleManager._canLose to true or false...
Thanks for that; I've always taken it to be the opposite. I did a quick test, and now have seen the light. Cheers..! Up until now, I've been provoking my own 'Game Over' inthe 'Lose' part; no bad thing, but I thought  I was doing the same as the Machine. D'oh..!


Still, my other self interrogation remains. How does this line of Script get used to affect Random encounters, if there's no Event..? (...Wanders off to sounds of head scratching and chin stroking...)
Thanks for that; I've always taken it to be the opposite. I did a quick test, and now have seen the light. Cheers..! Up until now, I've been provoking my own 'Game Over' inthe 'Lose' part; no bad thing, but I thought  I was doing the same as the Machine. D'oh..!


Still, my other self interrogation remains. How does this line of Script get used to affect Random encounters, if there's no Event..? (...Wanders off to sounds of head scratching and chin stroking...)

The line of code would be used as a script in the battle events section of the troops. For example, if I put it in the Bat*2 troop, then I would have no game over when i lose to them in a random encounter. It is technically an event, but not a map event.
Have I mis-understood the post's title, then (' How to have no game over on random encounters '...)..? A useful line of script, but with no effect on random encounters..? Just checking, as I'm still confused, sorry.
Have I mis-understood the post's title, then (' How to have no game over on random encounters '...)..? A useful line of script, but with no effect on random encounters..? Just checking, as I'm still confused, sorry.



It's a line of script that would work in any kind of battle, unless you manually activated a game over. Here's how it'd be implemented: script example 1.png


Then, any battle with that troop would not result in a game-over, even random battles, or event battles which you don't check "can lose".
Aha..! I see it now; thanks for that. Useful; I'll add it to my modest collection of 'snippets', gleaned here and there in the perusal of these pages. It's sometimes the most simple things that go unsaid. Cheers.
Well...if you change that to true and it was false before it is a kind of Plugin.


A really simple one ^^


...usually you do that changes with plugins. If u decided to do it in the main file you could get confused later on, when there are errors or something.

I did later turn it into a plugin with some added features, which can be viewed here: https://forums.rpgmakerweb.com/index.php?threads/canlose-control-defeat-behavior.67022/

Original thread: https://forums.rpgmakerweb.com/threads/how-to-have-no-game-over-on-random-encounters.66146/