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,246
Reaction score
7,627
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,787
Reaction score
5,209
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
772
Reaction score
482
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

Just finished composing a boss battle theme!
Scripted a multi-variable weather system that randomizes wind speed, cloudiness, rain, fogginess, etc, while attempting to realistically account for interactions between them (e.g. wind speed affects fogginess, cloudiness affects rain, etc), the current weather pattern, and the player's biome e.g. swamp, beach, etc. Now I "just" have to tie visuals and sounds to the variables so stuff actually happens...
I'm having a headache balancing the combat using flat defense so I'm gonna use percentual armor, in this pic, Simon has 16 on Defense which means all the incoming damage will be reduced by 16% this will ease my burden a bit.
!Have a nice day everybody¡
SO glad they patched outer worlds for switch! I can finally play it! Weird that other peeps are still having issues. I know it was really chugging on my lite when it first came out.

Forum statistics

Threads
105,555
Messages
1,014,623
Members
137,231
Latest member
anjing_gila
Top