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,293
Reaction score
7,637
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,818
Reaction score
5,213
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
773
Reaction score
483
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

Evil7 added!


I did a bit of a remake on one of the maps, also I made a particle for jumping into the portal, and one for traveling through the portal. I'll probably add more sparkles later to embellish it. :LZSwink:
Polished the animation and added details :kaojoy:
Ami
What do you think about the Wood Bridge inside of Volcano?
Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.

Forum statistics

Threads
105,686
Messages
1,015,532
Members
137,362
Latest member
sdramose
Top