[VX Ace] [Yanfly Lunatic states] Death if MP = 0

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
The stack level too deep error occurs if you *ever* use remove by restriction on the state that is to be applied, as I wrote it to force the state onto the character, and if that state has remove by restriction, for some reason the game will remove it, and reapply it in an infinite loop, and it will never end.

I'll see if I can merge these scripts tomorrow unless you both figure this out while I'm asleep, its late in my time zone so I better look at this more when I'm fresh.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
So, bgillisp, could you solve this trouble?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
I can try. I'm a noob scripter still, and slow at it too. Why don't I try writing a custom one to perform what you want, as I think with all the extras in that code it will get crazy. Its just supposed to KO someone with a certain state if their MP hits zero, right?

Edit: Got it, I think. Delete the script I gave you, and add this script by Yanfly instead that I've modified to make it work. It is the lunatic state punishment add on. In it, I added a check for a special notetag (under case 9), that will KO whoever has that notetag if their MP is zero.

Link: http://pastebin.com/6mu0szwm

Use the notetag <shock effect: KO MP ZERO> on the state that is supposed to kill when the MP runs out, if you want the KO to occur as soon as they take MP damage. If you use react effect, it will wait until the end of the turn to do the KO.

This way if you ever decide to add more states that do this, you just need to add the notetag.

Incidentally, you will also gain the add-on I wrote to allow you to regen fixed HP per round of combat (its under stat slip or stat heal), though it was an ad-hoc add on, so might be hard to use.
 
Last edited by a moderator:

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
People... I just made it happen using events.  :p

One for field and one for battle. :p :p

Not shiny and 100% accurate (it does not do a -1 per step) but it does the trick!

In case you want move damage, talk to the npc to get the MP poison state.

Walk to decrease your MP (not so accurate here).

If you walk enough you will die.

[SIZE=14.4444446563721px]OH! You are the rock, sorry for that! [/SIZE] :p

Check the transparent event to see how it works.

If you want a combat turn based poison,

do the above to understand how i did it,

THEN RESTART THE GAME.

Talk to the NPC and then interact with the bat to enjoy it in battle.

That was a little.... tricky!

I built it upon the transparent event code I already had made, yeah I was THAT lazy, so some variables stay with same name.

I provide you a tip so you wont get confused.

Open the database and go to Troops.

See what I did there? Two pages event.

Now go to Common Events and study what I also did there.

Notice the trigger switches on the top right of the parallel process events?

These are important.

https://www.dropbox.com/s/9l04qbnjg3zd7ya/MP%20Poison%20with%20KO.zip?dl=0

Download, unzip, OPEN the project then test play.

The most important thing is to understand how YOU can do this.

Tip: Eric's current X variable works also as Current Turn. Same goes for Eric's Initial X variable. It is initial turn. ;)

And also... if you won't get it how I did this happen in battle, it's ok.

It is too complex. I was debugging it since now.

Get it, try it and tell me if that's what you want to happen.

If yes, well.. I will explain you what I did step by step.

But only if it is EXACTLY what you wanna happen in game.

Tell me if I nailed it of failed it! :p
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Ok, thanks a lot to both of you, I'll stick with the scripted alternative made by bgillisp because it works as I want, with not too much effort (I have the Lunatic states Punishment pack installed lol)

Dreadshadow, thanks for the eventing alternative, it works, but I prefer the one bgilips gave me, but this solution... You nailed it!

Ok, this post can be closed, it's solved
 
Last edited by a moderator:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Just make sure to replace the lunatic states punishment add on with this script, else you may get a stack overflow error (having both the original and my corrected version included will cause issues at some point down the road). But, glad it is working for you!
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Just make sure to replace the lunatic states punishment add on with this script, else you may get a stack overflow error (having both the original and my corrected version included will cause issues at some point down the road). But, glad it is working for you!
I just pasted your add-on in the end, like this

    #----------------------------------------------------------------------

    # Punish Effect No. 10: MP KO

    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    # Death if MP = 0

    #

    # Recommended notetag:

    #   <shock effect: KO MP ZERO>

    #----------------------------------------------------------------------

    when /KO MP ZERO/i#[ ](.*)[ ](\d+)([%%])/i

      return if user.mp > 0

      user.hp = 0

 

So, hopefully, it shouldn't create any trouble
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Yep, that should work just fine!
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top