Health based overworld events

Race Hutson

Villager
Member
Joined
Sep 22, 2017
Messages
17
Reaction score
0
First Language
English
Primarily Uses
RMVXA
I can't seem to figure out a way to make it so that if you only have "1 hp or less" then an event activates in the overworld.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,252
First Language
Spanish
Primarily Uses
RMVXA
you can set up a common parallel event, or add a couple of lines to the function that watches the health regeneration.
if that 1 hp comes as a result of a battle, you can use the battle system itself
 

Race Hutson

Villager
Member
Joined
Sep 22, 2017
Messages
17
Reaction score
0
First Language
English
Primarily Uses
RMVXA
you can set up a common parallel event, or add a couple of lines to the function that watches the health regeneration.
if that 1 hp comes as a result of a battle, you can use the battle system itself
Can you please describe this a little more? I'm somewhat of a noob at this. Thanks!
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,252
First Language
Spanish
Primarily Uses
RMVXA
how does the character get to 1 HP from full HP?
 

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
For the Overworld, you can create an event (ideally in an unreachable corner), then choose Parallel Processing from that event's Triggers. PP will make the contents of that event loop over and loop without interrupting your character's movement. Do not mistake this for Autorun, which will pause player movement like a regular event would.

For the event itself, there's no condition to automatically detect your player's HP, so instead, the page should have a Conditional Branch. If there's no option to determine the player's HP there, you would have to use the Script line at the last page of Conditional Branch and write $game_player.actor.hp <= 1 (The leader's HP is less than or equal to 1). More math would be needed if you're planning to determine the average or highest amount of the party's HP

Keep in mind that Parallel Processing and Autorun are designed to repeat themselves. Without knowing what you want that event to do, there are several ways to disable that PP event like Erase Event (disable until you reenter the map), turning on a switch to activate a blank page, teleporting to another map, or healing up.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,661
Reaction score
563
First Language
English
Primarily Uses
RMVXA
What Harosata said. Also you can use a variable to get the current HP of the actor. If you have more than one actor and want to check all of them then multiple variables and conditional branches.
Variable -> Game data -> Actor -> hp
Conditional branch -> (variable <= value)
wait (so that it doesn't run 60 times per second or how often it checks)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,231
Members
137,607
Latest member
Maddo
Top