RPG Maker MV

RPG Maker MV

mldb88 Aug 17, 2022 @ 5:55pm
Game Over Condition When TP = 0?
Trying to work out a way to make this work, with zero scripting knowledge. Does anyone know if there's a script already set for this that can be used for commercial release or one that sets up a similar system where it triggers a game over when the value hits 0?

Basically trying to have a corruption system where if it hits 100% you lose rather than an HP dropping to zero using a 3rd meter (paranormal/possession storyline). Thanks in advance!
< >
Showing 1-10 of 10 comments
MartyrmanX Aug 17, 2022 @ 7:03pm 
One script line is all it takes. TP values range from 0 to 100. If you only have one protagonist in your party, this will be easy. If not, you'll need to do a lot of math. Below is a Conditional Branch that is "Script". Copy and paste it into a Conditional Branch of an Event Running Parallel. It will trigger when Party Member 1 has zero TP. Be sure to give the Actor the "Preserve TP" flag so that TP is not random between battle or defaults to zero on the map. Increase TP before running parallel event.

Conditional Branch Script:
$gameParty.members()[1].tp === 0

What it looks like in an Event Page:

◆If:Script:$gameParty.members()[1].tp === 0
◆Game Over

:End
Last edited by MartyrmanX; Aug 17, 2022 @ 7:07pm
mldb88 Aug 17, 2022 @ 9:53pm 
Originally posted by MartyrmanX:
One script line is all it takes. TP values range from 0 to 100. If you only have one protagonist in your party, this will be easy. If not, you'll need to do a lot of math. Below is a Conditional Branch that is "Script". Copy and paste it into a Conditional Branch of an Event Running Parallel. It will trigger when Party Member 1 has zero TP. Be sure to give the Actor the "Preserve TP" flag so that TP is not random between battle or defaults to zero on the map. Increase TP before running parallel event.

Conditional Branch Script:
$gameParty.members()[1].tp === 0
What it looks like in an Event Page:

◆If:Script:$gameParty.members()[1].tp === 0
◆Game Over

:End

Awesome thanks for the help! Couldn’t figure out for the life of me how to script directly into MV (used to the old MX days where you had direct access to all the backend scripting so it was just number tweaking if you knew how to read code).
mldb88 Aug 18, 2022 @ 12:39pm 
Ok another slight followup questions. I'm a dummy and flip flopped the concept in the original post and want it to game over at 100TP. I figured out just change the 0 to 100, but now im running into another not so minor problem.... how would I set up skills that lower TP without making it a "cost"? So for example you have 20TP, but you have a recovery skills that reduces your TP by 40? Sadly the effects of recover TP don't allow for negative numbers....

Edit: Figured out how to do TP reduction using common events but still having trouble with the game over script you posted. Not sure if I'm just setting up the call function in combat incorrectly or what but it's not actually triggering the game over once TP hits 100. I've got it set up in the troops menu with the condition Don't Run.... oh god I'm dumb Don't Run means don't run the event, not don't run from combat. I AM getting an error though "Cannot read property 'tp' of undefined". I did change around the names of the stats in the system panels but would that change how the formulas and scripts refer to them as well? If so it's an easy fix of just changing the tp to whatever the abbreviation is in the terms tab i guess.

FIGURED IT OUT! The scripting is array based apparently so the way you originally set it up is calling for party member 2 not 1 (since the array starts at value 0). Thanks again for the basic setup for the script though, you're a life saver lol.
Last edited by mldb88; Aug 18, 2022 @ 1:12pm
MartyrmanX Aug 18, 2022 @ 6:13pm 
No problem. You can always experiment in the Console by pressing F8 mid playtest. Go nuts, explore! Good luck.
mldb88 Aug 18, 2022 @ 6:20pm 
Originally posted by MartyrmanX:
No problem. You can always experiment in the Console by pressing F8 mid playtest. Go nuts, explore! Good luck.

Awesome, though kind of stuck again... on something COMPLETELY unrelated... Setting up a tutorial battle to explain how combat works, and i have it set up with the conditions being Turn 1, Turn 2, etc with dialogue for each turn explaining the mechanics based on what the enemy does. The issue is that after turn 1's dialogue it just stops, it doesn't progress, and it never goes back to being the player's turn. It SHOULD be a simple event, the content being nothing but showing text, conditions being the turn number, and span being Turn or Battle (tried both, still with the same effect). I have no clue why the event just keeps getting 'stuck' somewhere.
mldb88 Aug 18, 2022 @ 6:24pm 
Originally posted by mldb88:
Originally posted by MartyrmanX:
No problem. You can always experiment in the Console by pressing F8 mid playtest. Go nuts, explore! Good luck.

Awesome, though kind of stuck again... on something COMPLETELY unrelated... Setting up a tutorial battle to explain how combat works, and i have it set up with the conditions being Turn 1, Turn 2, etc with dialogue for each turn explaining the mechanics based on what the enemy does. The issue is that after turn 1's dialogue it just stops, it doesn't progress, and it never goes back to being the player's turn. It SHOULD be a simple event, the content being nothing but showing text, conditions being the turn number, and span being Turn or Battle (tried both, still with the same effect). I have no clue why the event just keeps getting 'stuck' somewhere.

Well.... I think I figured it out. Removing the prior event (the TP one for triggering the game over set to turn end if your meter is maxed out, since you literally CANT lose here there's no point) fixed the problem, which now introduces a whole new issue... dialogue in battles where you CAN lose... hmmm....
MartyrmanX Aug 18, 2022 @ 6:47pm 
Here's a link for plugin that addresses end of battle events. It calls a common event when the conditions are met. Change its parameters to how it suits you. If you need battle specific dialogue, you may use Conditions in the Common Event. I recommend getting the Troop ID of a battle and using that ID as a condition in a Common Event.

http://sumrndm.site/battle-end-events/

This Script Command gets the Id of a Troop.

$gameTroop._troopId

If you want the Troop Id as a Variable, this Script command will set a Varaible as that value.

$gameVariables.setValue(1, $gameTroop._troopId)
[Sets Variable #0001 as Troop Id]
Last edited by MartyrmanX; Aug 18, 2022 @ 10:13pm
mldb88 Aug 19, 2022 @ 11:34am 
Awesome, thanks again! Now the other hard part, and something you definitely won’t be able to help with as much…. Making all the art….
MartyrmanX Aug 19, 2022 @ 7:20pm 
Originally posted by mldb88:
Awesome, thanks again! Now the other hard part, and something you definitely won’t be able to help with as much…. Making all the art….
You're right about that. Worry about the art later. Focus on your vision and replace the assets when you're ready. Good luck!
mldb88 Aug 19, 2022 @ 8:11pm 
Originally posted by MartyrmanX:
Originally posted by mldb88:
Awesome, thanks again! Now the other hard part, and something you definitely won’t be able to help with as much…. Making all the art….
You're right about that. Worry about the art later. Focus on your vision and replace the assets when you're ready. Good luck!
Yup lol that's what ive been doing, but I'll probably start working on them when I have some time or when I'm away from the comp
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Aug 17, 2022 @ 5:55pm
Posts: 10