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

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Hello everybody, I have a question, I'd like to make a stat makes the affected dies if its MP is equal to 0, of course, I want they die if their HP is equal to 0 still.

I'm using Yanfly's Lunatic states' script (https://github.com/Archeia/YEARepo/blob/master/Battle/Lunatic_States.rb) so if there is an easy way to make it via this script, please feel free to post using it.

Thanks for your attention 
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
Actually you can make a Troops in the database and event it. 

Eventing it you can add something to be executed in each turn.

You can then call a common event.

You go and create a common event that checks current MP.

If 0 the hero dies LOL.

Else nothing happens.

There! Using just eventing.

EDIT: Or use the script that :ninja:   bgillisp :ninja:   gave you I guess 

Second edit:

[SIZE=14.4444446563721px]Problem is that using eventin this check occurs some certain time instead of instantly....[/SIZE]

so go with the script without hesitation.
 
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
bgillisp, thanks a lot, but... How do I make that only happens when the player/enemy has certain state?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
I never got the script that far I'm afraid, as I wrote it for a quick fix to do like Star Ocean 3 did (KO on no MP). Do you intend it to only happen on one specific state? If so I can probably add a quick fix for that. If you need more than one though that might be beyond what I can do as a scripter at the moment.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Only when they have certain state, they'll die if their MP is equal to 0, can you make a fix for that? Thanks
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
I'll see if it can be done. Give me a couple days though.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
An edit to bg's script

Code:
	module BG_mp_zero_state  #state that is needed for the 0 state to work  Zero_state_required = 10end	class Game_Battler < Game_BattlerBase  alias bgmp_zero_state_refresh refresh    def refresh      #Call aliased method      bgmp_zero_state_refresh      if(BG_mp_zero_state::MP_zero_state_switch)        if(self.mp <= BG_mp_zero_state::Mp_zero_value and self.state?(BG_mp_zero_state::Zero_state_required)))          #Add the desired state.	  if(enemy? and BG_mp_zero_state::MP_zero_enemy_affected)	    add_state(BG_mp_zero_state::Mp_zero_state)            return	  end	  if(actor? and BG_mp_zero_state:: MP_zero_actor_affected)	    add_state(BG_mp_zero_state::Mp_zero_state)	    return	  end	end        remove_state(BG_mp_zero_state::Mp_zero_state)      end #End if for switch    endend #End of Game_Battler class
 
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
An edit to bg's script

module BG_mp_zero_state #state that is needed for the 0 state to work Zero_state_required = 10end class Game_Battler < Game_BattlerBase alias bgmp_zero_state_refresh refresh def refresh #Call aliased method bgmp_zero_state_refresh if(BG_mp_zero_state::MP_zero_state_switch) if(self.mp <= BG_mp_zero_state::Mp_zero_value and self.state?(BG_mp_zero_state::Zero_state_required))) #Add the desired state. if(enemy? and BG_mp_zero_state::MP_zero_enemy_affected) add_state(BG_mp_zero_state::Mp_zero_state) return end if(actor? and BG_mp_zero_state:: MP_zero_actor_affected) add_state(BG_mp_zero_state::Mp_zero_state) return end end remove_state(BG_mp_zero_state::Mp_zero_state) end #End if for switch endend #End of Game_Battler class
Do I add that in the same script or just in another place under the script bgillisp made?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Just put it under his script... that's easier to do...
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Using them already and it shows a mistake in this line

if(self.mp <= BG_mp_zero_state::Mp_zero_value and self.state?(BG_mp_zero_state::Zero_state_required)))
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Ah. it needs to be in a single line... can't do that on the post because it does a word wrap
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
It's in the same line already, it's so... Bizarre
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
what error does it show?
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Ah, seems like there was an excess ) 

There should only be two ), not three
 
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
Now showing the "Stack level too deep" mistake
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
probably coz it uses the same alias as the original... XD

just change

alias bgmp_zero_state_refresh refreshdef refresh#Call aliased methodbgmp_zero_state_refresh
into 

Code:
alias bgmp_zero_state_refresh_two refreshdef refresh#Call aliased methodbgmp_zero_state_refresh_two
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Nope, still the same
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
then just replace the old method from the original script with the edited one...
 
Last edited by a moderator:

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

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,855
Messages
1,017,007
Members
137,563
Latest member
MinyakaAeon
Top