Need help on create manual/auto item

tyranzero

Villager
Member
Joined
Jun 17, 2020
Messages
15
Reaction score
2
First Language
english
Primarily Uses
RMMV
I need help on this revive item. struggling with using both formula and notepad.
this item, on death > revive. the note using yep action sequence.

so I tried to create this revive item shown below:
target = knockout > remove knockout state + restore Hp
and if not knockout: target add state 10 (which is autolife or auto revive on death)

formula use:
if (b.isStateAffected(1)) b.removeState(1); b.gainHp(mhp*0.5) else b.addState(10)

Untitled.png
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,895
Reaction score
1,029
First Language
Dutch
Primarily Uses
RMMV
I dont know if you require formula if you use notebox though.

but you miss stuff inside the target action, but it should look more like this:

<target action>
if (b.isStateAffected(1) {
b.removeState(1) && b.gainHp.(mhp*0.05);
} else {
b.addSate(10);
end
</target action>

now keep in mind that the above isn't 100% correct as well, but I do not know
what you plugin you use or how the lunatic code works for those specific plugin.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
Try this in the skill's formula box:
JavaScript:
if (b.isStateAffected(1)) { b.removeState(1); b.gainHp(Math.round(b.mhp/2)); } else b.addState(10); 0
I replaced mhp (undefined) with b.mhp (max HP of target), added a Math.round in there to ensure the heal is a whole number, and put a 0 at the end just in case (formula result should always be a number).

Also I'd suggest removing the <target action> tag from the note box. Action sequences have their own custom syntax; I imagine the notetag as you've written it is failing silently, causing the skill to do nothing in that action phase.

Note that by default there is no "living or dead ally" action scope. There's a free plugin called DeadOrAliveItem you might find helpful for that; check your RMMV install folder under dlc/KadokawaPlugins. That said, I think I remember it conflicting with some of Yanfly's stuff...if so, maybe there's an alternative? :kaoslp:
 

tyranzero

Villager
Member
Joined
Jun 17, 2020
Messages
15
Reaction score
2
First Language
english
Primarily Uses
RMMV
Try this in the skill's formula box:
JavaScript:
if (b.isStateAffected(1)) { b.removeState(1); b.gainHp(Math.round(b.mhp/2)); } else b.addState(10); 0
I replaced mhp (undefined) with b.mhp (max HP of target), added a Math.round in there to ensure the heal is a whole number, and put a 0 at the end just in case (formula result should always be a number).

Also I'd suggest removing the <target action> tag from the note box. Action sequences have their own custom syntax; I imagine the notetag as you've written it is failing silently, causing the skill to do nothing in that action phase.

Note that by default there is no "living or dead ally" action scope. There's a free plugin called DeadOrAliveItem you might find helpful for that; check your RMMV install folder under dlc/KadokawaPlugins. That said, I think I remember it conflicting with some of Yanfly's stuff...if so, maybe there's an alternative? :kaoslp:
test out and the formula work (even thou that hasn't test the revive one). but oh well, thank you for your help.

how could didn't mention your plugin that fix DeadOrAliveItem so it can compatible with yep plugin? at the same time, I'm also wrong that didn't mention using DeadOrAliveItem. but anyway, also Thank you for the fixed plugin.
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
@tyranzero :kaohi: I forgot I wrote that compatibility patch, thanks for the reminder! Hopefully it works for you. Here's a link in case anyone else is interested:
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top