Farr

Veteran
Veteran
Joined
Feb 16, 2014
Messages
247
Reaction score
93
First Language
Portuguese
Im trying to create an item that heals for X value,  but if it is used during a battle, on top of the healing it also adds Y state (or more states). 


I had this done in Ace and I`m trying to create this effect on MV but I cant seem to make it work, can anyone help with the formula?


Thanks.
 
 

Silverskin

Villager
Member
Joined
Jun 21, 2016
Messages
27
Reaction score
12
First Language
English
Primarily Uses
cant you just make the item add the state and make the state expire after battle end or 1 step?
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
601
First Language
French
Primarily Uses
I can't see any clean way (not involving a parallel process common event and/or a battle event at turn 0 that turns a switch on) besides javascript, so try this.


SceneManager._scene instanceof Scene_Battle ? b.addstate(stateid); healAmount


SceneManager._scene instanceof Scene_Battle ? a.addState(1); Math.randomInt(8) + 1




This damage formula should do the trick. (Heal amount is to be replaced by your heal formula)


It works as advertised in my blank project :)


Happy making!
 
Last edited by a moderator:

Farr

Veteran
Veteran
Joined
Feb 16, 2014
Messages
247
Reaction score
93
First Language
Portuguese
I can't see any clean way (not involving a parallel process common event and/or a battle event at turn 0 that turns a switch on) besides javascript, so try this.


SceneManager._scene instanceof Scene_Battle ? b.addstate(stateid); healAmount


This damage formula should do the trick. (Heal amount is to be replaced by your heal formula)


It works as advertised in my blank project :)


Happy making!



For some reason my formula always returns 0.


SceneManager._scene instanceof Scene_Battle ? b.addstate(32); Math.randomInt(8) + 1


32 = State
 

Traveling Bard

The Bard
Veteran
Joined
Jul 4, 2012
Messages
567
Reaction score
493
First Language
English
Primarily Uses
I'm at work so this is untested... but try this:


c=Math.randomInt(8) + 1; if ($gameParty.inBattle()) {b.addState(32);c} else {c}
 

Farr

Veteran
Veteran
Joined
Feb 16, 2014
Messages
247
Reaction score
93
First Language
Portuguese
I'm at work so this is untested... but try this:


c=Math.randomInt(8) + 1; if ($gameParty.inBattle()) {b.addState(32);c} else {c}



Yay it's working!


Thanks alot for all the helps.
 

Latest Threads

Latest Posts

Latest Profile Posts

Hi everyone! Enjoying this nice long weekend. How are you all doing? :)
I just successfully tested having events check if specific actors are in a particular party slot and then changing image to match. This will let me make scenes take into account who is in the party at the time and arrange them accordingly - this is important since I'll have extra actors beyond current party. The script used is the same from MV and is compatible with my current core plugin setup in MZ. Thank goodness.
That awkward moment when you're talking about thinking about writing a limited shop stock plugin for MZ and then find out you already wrote one...last May. My memory is so bad.
When I open my project and I'm like, hell yeah.
Some drawings I made in Lapis, one day I intend to involve them in some RPG Maker project.
* maybe two wall frames
*or some sprite flower tiara, or maybe it inspires someone to do something.
bdd19b62e539d17b3b00cc3d63034f7d.jpg

fcca5c8471b34483da8e032cfe579275.jpg

Forum statistics

Threads
118,424
Messages
1,115,849
Members
155,376
Latest member
L4TNG
Top