I want to create a fire trap in MV but idk how

RyanYe

RPG Game Lover
Veteran
Joined
Dec 31, 2020
Messages
123
Reaction score
47
First Language
English
Primarily Uses
RMMV
"fire trap" means if player steps onto it, the whole party will receive HP damage CONSTANTLY (like -10HP per second)

I know stupid a way which i think may consume a lot of CPU resource by setting up a parallel event with a conditional branch of a variable check, and then i set the variable to -10 when player steps on the fire event and to 0 when player gets out( set up four stupid events around the fire to make sure the variable will be set correctly and player not burn to death when stepping out)
Clipboard01.png

I want to know whether there is a DECENT/ELEGANT/NEAT way to make this happen?
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,503
Reaction score
729
First Language
indonesian
you can use parallel process event which check player coordinate... if player is on top of any event with the "FLAME" name then deal damage... else do nothing... don't forgot to add wait on the parallel process event...

you can do that by creating parallel process event... then at the top
do conditional branch -> script:
Code:
$gameMap.eventsXy($gamePlayer.x, $gamePlayer.y).length !== 0 && $gameMap.eventsXy($gamePlayer.x, $gamePlayer.y)[0].event().name.match(/flame/i)
the conditional branch script is a bit long because it also prevent crash if no event below the player.
next step... inside that conditional branch deal damage to entire party -10 hp (you can also add sound and animation effect).
then outside the conditional branch add wait 60 frame (1 second)...
finally proceed to name all your 'flame' event containing "flame" as the name... you can name it flame001, flame002, etc... as long as the name contain 'flame'

this is example parallel process event:


this is example 'flame' event:

don't forget to set it as below character so player can step on it...
hope this help
 
Last edited:

RyanYe

RPG Game Lover
Veteran
Joined
Dec 31, 2020
Messages
123
Reaction score
47
First Language
English
Primarily Uses
RMMV
It works, it works!!
OMG!OMG!OMG!OMG!OMG!!!

thank you soooooooooooooooooooooo much!
Now i think i can make a lot of things in my game!
 

Loki2020

Maestro
Member
Joined
Oct 19, 2015
Messages
19
Reaction score
28
First Language
Engrish
Primarily Uses
cool!
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

It's special day for me tomorrow so time to vanish for 24 hours lol.
So Deltarune Chapter 2 is supposed to release today... if it's out already, has anyone played it? And I can't because I have a stinking Mac and not a Windows PC.
I forgot that forums have profile walls that you can post or comment on, guess I found a new platform to specifically rant about game-related deranged thought or problems that I have. Salut mes amis!
I couldn't help myself, so I edited the tiles a bit and made a birdhouse :LZSsmile: I hope I will finish the town today!Screenshot 2021-09-17 134349.png
How do I find the threads I have watched? It's been so long I've forgotten :kaoswt:

Forum statistics

Threads
115,135
Messages
1,087,504
Members
149,643
Latest member
Loyalvib
Top