Help to turn off Yanfly's Trance state

yellowvictory

Warper
Member
Joined
May 16, 2017
Messages
4
Reaction score
0
First Language
Indonesian
Primarily Uses
RMMV
Hi, all!
I'm using this http://yanfly.moe/2016/08/24/tips-tricks-trance-final-fantasy-9-rpg-maker-mv/ for trance state.
It works really well, except I want to turn it off after battle end.
I tried checking the "remove at battle end" box, but didn't solve the problem.
So, I think I have to make a common event that works in parallel if party have certain state on, it would be removed. The problem is, the event must be triggered by a switch.
Is it possible to turn on a switch from inside a state?
Please help me.
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,404
Reaction score
4,801
First Language
English
Primarily Uses
RMVXA
My guess is that inside the Lunatic Code where you are setting user._trance = true, you could also directly set a Switch using:
$gameSwitches.setValue(15, true)
(Replace 15 with the Switch # you want to use in your Parallel Event, and MAKE SURE you set that Switch OFF at the end of the Event).

If that doesn't work for some reason, you could always simply turn the Switch ON at the beginning of each battle using a Troop Event (Turn 0, Timing: Battle) instead. This will force the Parallel Event to run once at the end of every battle and you can use it to remove the Trance from every character. Again, make sure you turn the Switch OFF at the end of the Event.
 

yellowvictory

Warper
Member
Joined
May 16, 2017
Messages
4
Reaction score
0
First Language
Indonesian
Primarily Uses
RMMV
Thank you for fast response, I'll try it out. But, I'm just casual maker, not a lunatic(expert), so I can only copy paste or do a little adjustment.. where should I put $gameSwitches.setValue(15, true) in these:
<Custom Passive Condition>

// Check if the party is in battle.

if ($gameParty.inBattle()) {

// Default the user's trance state to false.

user._trance = user._trance || false;

// Sets the condition for the user to be either in the trance state or if the user's TP matches the user's MaxTP.

condition = user._trance || user.tp === user.maxTp();

} else {

// Otherwise, the condition is false.

condition = false;

}

// If the condition passes...

if (condition) {

// And if the user isn't in the trance state...

if (!user._trance) {

// Then play an animation as the user enters trance.

user.startAnimation(130);

}

// Set the user's trance state to true.

user._trance = true;

}

</Custom Passive Condition>



<Custom Regenerate Effect>

// Set the TP drain amount.

var tp = 25;

// Reduce the user's TP.

user.gainTp(-tp);

// If the user's TP is 0...

if (user.tp === 0) {

// ...then turn off trance.

user._trance = false;

}

</Custom Regenerate Effect>

exactly? Is it too much if I ask a full lunatic code? Thank you in advance
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,404
Reaction score
4,801
First Language
English
Primarily Uses
RMVXA
Place it directly below user._trance = true; (it's about halfway through what you pasted, near the end of the Custom Passive Condition block) and make sure it's above the following } curly-bracket symbol.
 

Lionheart_84

Veteran
Veteran
Joined
Oct 27, 2015
Messages
508
Reaction score
44
First Language
Italian
Primarily Uses
To me this trick doesn't work.

In the common event I set that the TP go down to 0 and the status is removed.
Well, the status is not removed. TP drop to 0, but status is always there.
Tips?
 

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

Latest Threads

Latest Profile Posts

I think my goal for MZ ... is to actually release a game and not have twenty technical demos and debugging projects. Let's see if I can manage that. ;o
I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:
I'm having a fun time working with the MZ RTP. The waterfall hasn't changed, though, so I'm wondering if they didn't make a new one or if they forgot to put it in...

good progress on the typescript Definitions files almost done all the Manager and yet I still have to do the Battle Manager...who is seriously so much data lol
Are the export options for MZ known yet?

Forum statistics

Threads
100,646
Messages
978,068
Members
132,259
Latest member
RegularManGuy
Top