I have added a knife to my game. And also I have added a "bleeding" statement. I know how to add effect to skill, but I don't know how to make this with weapons. Can you help me?
Bleeding effect when attack by a knife
RPG Maker MV SupportThe script call to check a weapon ID is
$gameActors.actor(actor_id).equips()[slot_id] == null;
*change null to id
I'm not 100% sure how to reference this in a damage formula. However, without using plugins, I think you would just need a condition in the damage formula to check if the user has a dagger equipped.
So if the weapon name is 'Dagger' then you could try
a.equips()[0] == dagger ? b.addState(x); formula here : formula here
I'm not sure about the syntax though. I did a google search and I couldn't find anything specific to damage formulas, only script calls.
Here is a link to the master script call list. Under the battle section you can see script calls that reference checks for weapons and weapon types.
$gameActors.actor(actor_id).equips()[slot_id] == null;
*change null to id
I'm not 100% sure how to reference this in a damage formula. However, without using plugins, I think you would just need a condition in the damage formula to check if the user has a dagger equipped.
So if the weapon name is 'Dagger' then you could try
a.equips()[0] == dagger ? b.addState(x); formula here : formula here
I'm not sure about the syntax though. I did a google search and I couldn't find anything specific to damage formulas, only script calls.
Here is a link to the master script call list. Under the battle section you can see script calls that reference checks for weapons and weapon types.
@HumanNinjaToo has provided some valuable information, but you can do this effect with no coding or plugins at all:
Just add an "attack state" trait to your Dagger weapon, set the % chance you want it to have of being inflicted, and the default engine will handle the rest.
Just add an "attack state" trait to your Dagger weapon, set the % chance you want it to have of being inflicted, and the default engine will handle the rest.
You can't put a semicolon inside a ternary operator, so this won't work. It's just a syntax error and then engine will substitute 0 every time.
Original thread: https://forums.rpgmakerweb.com/threads/bleeding-effect-when-attack-by-a-knife.123724/