Mattaroni

Regular
Regular
Joined
Jan 5, 2014
Messages
145
Reaction score
28
First Language
English
Primarily Uses
RMMV
In my project, I'm using Yanfly's Buff&States core plugin and I have a state that acts like poison to an actor's MP, but I also want this state to possibly kill the actor based on a random interval.

Say for example, it generates a random number between 1-50 and if the number is >= 40, it kills the actor.

Does anyone know how I can do this with the Lunatic Mode?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,910
First Language
English
Primarily Uses
RMVXA
You will need to use one of the notetags listed here or in the plugin's help file. I recommend doing an effect like this on Turn Start - so use the
<Custom Turn Start Effect> notetag on your State. (Turn End could also be fine.)

I think the notetag would go something like this:
<Custom Turn Start Effect>
var ko_pick = Math.random() * 50;
if (ko_pick >= 40) {
self.addState(1);
}
</Custom Turn Start Effect>

This assumes your KO/Death State is 1. If not, replace "1" with the State ID of the KO State.
 

Mattaroni

Regular
Regular
Joined
Jan 5, 2014
Messages
145
Reaction score
28
First Language
English
Primarily Uses
RMMV
sounds good, although the game also uses the ATB battle system and has a Tick-based regen system. I was more thinking it would do it on Regeneration.
<Custom Regenerate Effect>
You think this could work?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,910
First Language
English
Primarily Uses
RMVXA
sounds good, although the game also uses the ATB battle system and has a Tick-based regen system. I was more thinking it would do it on Regeneration.
<Custom Regenerate Effect>
You think this could work?
Maybe! I've never done a deep dive on the way that Yanfly's core scripts handle the timing of Regeneration. Try it for yourself and see what happens!
 

Mattaroni

Regular
Regular
Joined
Jan 5, 2014
Messages
145
Reaction score
28
First Language
English
Primarily Uses
RMMV
I tried inputting the code into the notebox of the state, but it doesn't appear to be doing anything. I even set it to just add the state upon regen and it's not doing anything. Is there something I'm missing?
 

Latest Threads

Latest Profile Posts

I want to go play piano now. This is gonna be my stopping point today (yes, I’m very slow at drafting). Might have a few too many curly Qs? Obviously gotta finish the limbs and clean up. There are a few more outfit details I need to add. Probably going to do a background so that the pose makes sense, LOL.

IMG_0515.jpeg
Do you believe me now?

BTW not my insta, not my post. Different John.
It's been long time since last I'm tinkering with RPG Maker ~
Turns out. I wasn't in my head accounting for when the Actor doesn't have a weapon equipped but DOES still have a Grimoire equipped... 40+ SV Spritesheets!!! D'x

Forum statistics

Threads
135,049
Messages
1,253,307
Members
178,023
Latest member
nemesiszero
Top