In my game, I'm trying to make it so that some items will have a different effect if used on a certain enemy (like giving meat to a hungry wolf will make it non hostile), so is there a way to make items have a different effect if used on a specific enemy? I've looked through the conditional branch stuff and didn't find anything that seemed like it would allow that.
Enemy specific events?
RPG Maker VXAce Supportthere are a lot of ways to do that - either by damage formula or by regular event.
If you only looked at conditional branch, then you're probably a new user - usually the more advanced sequences use a control variable (for loading game data) followed by a conditional branch to check that variable, that is why the conditional branch itself has only limited options.
But the main question here is if you want to do it on the map (effecting an event that is only pretending to be the enemy) or on battlescreen (effecting a troop of real enemies)
Those two options require a totally different approach that won't work on the other.
If you only looked at conditional branch, then you're probably a new user - usually the more advanced sequences use a control variable (for loading game data) followed by a conditional branch to check that variable, that is why the conditional branch itself has only limited options.
But the main question here is if you want to do it on the map (effecting an event that is only pretending to be the enemy) or on battlescreen (effecting a troop of real enemies)
Those two options require a totally different approach that won't work on the other.
Thanks. I am very new to the program, so I don't know any of the advanced stuff. I'm trying to do this in combat, so what exactly do you need to do to store the selected enemies id as a variable?
For this I would just use the damage formula. I am assuming that when you say make a wolf non-hostile, this would involve inflicting a state on it which would affect it in some way.
If the item only affects one enemy (wolf) use this in the damage formula. For the sake of this example we will say that the id of the wolf on the enemy tab of the data base is 94. We will also say that the pacifying state has the id of 34 on the state tab of the data base.
b.enemy_id == 94 ? b.add_state(34) : put here whatever happens if it is not a wolf
Suppose, though, that you want this to affect more than one enemy. It might be wolves, rabid wolves and foxes. Ids would quickly become cumbersome. Instead, give all these enemies a state - either a passive state when you create them in the data base, or as a turn 0 action in the troop event. We will say, for this example, that this state is 56. Now you need to identify if the enemy has this state.
if b.state?(56); b.add_state(34); end; put here whatever happens if it is not the type of enemy who can be pacified
If the item only affects one enemy (wolf) use this in the damage formula. For the sake of this example we will say that the id of the wolf on the enemy tab of the data base is 94. We will also say that the pacifying state has the id of 34 on the state tab of the data base.
b.enemy_id == 94 ? b.add_state(34) : put here whatever happens if it is not a wolf
Suppose, though, that you want this to affect more than one enemy. It might be wolves, rabid wolves and foxes. Ids would quickly become cumbersome. Instead, give all these enemies a state - either a passive state when you create them in the data base, or as a turn 0 action in the troop event. We will say, for this example, that this state is 56. Now you need to identify if the enemy has this state.
if b.state?(56); b.add_state(34); end; put here whatever happens if it is not the type of enemy who can be pacified
Thanks so much for the help. One last quick question, when the item is used on an enemy, it displays an "enemy took no damage" message, is there a way to remove that?
Original thread: https://forums.rpgmakerweb.com/threads/enemy-specific-events.74311/