How do I...call a common event with a State?

Joined
Jul 12, 2020
Messages
95
Reaction score
18
First Language
English
Primarily Uses
RMMV
I'm trying to figure this out...

Okay so, you know how RPG Maker gives you the Knockout (state) by default?
Well, I'm trying to make it to where, when the player enters this state, (HP drops to 0), a unique death-cutscene plays before cutting away to the Game Over screen.
My first instinct was to link the state to a common event, but...there's no options for that.


Problem is, I can't find a proper trigger for it to be a global thing...
How would I go about doing that?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,233
Reaction score
7,616
First Language
German
Primarily Uses
RMMV
it can't be done by default that way, because a state cannot call a common event.

what is possible to do is using a troop event, but that needs an additional trick.

you need one troop event that gives a temporariy immortal state at the beginning of the battle, and then one troop event for each possible target/actor to check for HP=0, then play the cutscene, then remove the immortal state.

you can use a base troop plugin to copy those troop events to every battle...
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,768
Reaction score
5,204
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 
Joined
Jul 12, 2020
Messages
95
Reaction score
18
First Language
English
Primarily Uses
RMMV
Hey guys!
Thanks for the replies so far!

I sort of overl
You can use Yanfly State Core Plugin http://www.yanfly.moe/wiki/Buffs_&_States_Core_(YEP) and then add this to the Death State's Notetag:

Code:
<Custom Apply Effect>
$gameTemp.reserveCommonEvent(1);
</Custom Apply Effect>
Replace the 1 with the ID of your Common Event

Ohhhh my gosh it played the common event!!!!!

Thank you sooo much dude x//3



By the way, I'm sorry I forgot to mention this guys, but there really is no battle system in my game. I meant to say that when the player enters the state in the overworld! Because the player can only really die in the overworld.
 
Joined
Jul 12, 2020
Messages
95
Reaction score
18
First Language
English
Primarily Uses
RMMV
Wait, actually...

Okay, I just realized something small:
So the common event DOES play with that coding @Aerosys
The only small problem now is like...the animation sorta plays before being abruptly cut off by the game over screen. I think what's happening is that the game detects its in the KO state, so it takes me to the game over screen WHILE playing the common event (animation) at the same time.

Any way I could tell the game to wait till the animation's over?
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
767
Reaction score
476
First Language
English
Primarily Uses
RMMV
Wait, actually...

Okay, I just realized something small:
So the common event DOES play with that coding @Aerosys
The only small problem now is like...the animation sorta plays before being abruptly cut off by the game over screen. I think what's happening is that the game detects its in the KO state, so it takes me to the game over screen WHILE playing the common event (animation) at the same time.

Any way I could tell the game to wait till the animation's over?
Since the event begins playing, you could remove the death state at the beginning of the event, to prevent the game update from realizing you're dead at all, and then only the event will cause the gameover.
 
Joined
Jul 12, 2020
Messages
95
Reaction score
18
First Language
English
Primarily Uses
RMMV
Oh my gosh!! It works like a charm!

Thank you all so much for helping me. I honestly don't feel like I'd be able to make this game without knowing I can reach out over here for help : )
 

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

Latest Threads

Latest Posts

Latest Profile Posts

rux
The most words I have ever written in an entire document is in my game's script, jeez i have a lot of characters that ramble on
Yes! I finally did something! This is a picture I drew of what I wish I looked like; I hope that you guys like it!
Finished that egg-sitting mini-game I mentioned here a couple weeks back. Now to fix the weather system so it doesn't rain indoors while you're playing it. >.> A simple fix in itself; leave it to me to take it as an excuse to completely revamp the time/weather/lighting system from scratch.
I'm really tempting to pre order cyberpunk 2077... should I do it or not :/ I really want to play the game but don't want to take a big hit to my saving because of it

Forum statistics

Threads
105,488
Messages
1,014,128
Members
137,142
Latest member
OscarCobblepot
Top