When using a skill with a comment event attached, I want to set a variable to one of the selected enemies stats, however I'm not quite sure if this is even possible. How would I do this, if I even can?
For example I wish to set the 40th variable to the attack stat of the selected enemy I'm fighting, would I be able to do that?
Picking targeted enemy in common event
● ARCHIVED · READ-ONLY
-
-
You can use skill formula to get that effect. $game_variables[40] = b.atk
I'm not having my pc now but I think it should work. -
You're right, it does work, however it also deals damage to the enemy, which I don't want.You can use skill formula to get that effect. $game_variables[40] = b.atk
I'm not having my pc now but I think it should work.
Edit: And I also want to set other variables to other stats of the enemy with one attack, yet to figure this most likely easy to solve issue. -
in that case there is another way that uses no scripts, but requires a lot of event coding in the common event.
Make an invisible target state just for that skill - it should have no icon, no messages, no effect and be nothing but a marker. Then have the skill add that state to the target as a regular skill effect.
In the common event you'll now need a conditional branch for every enemy index (1-8) checking if that enemy has the state applied. If yes, you've found the correct enemy index and can use the commands to read the data of that enemy. Then after that you remove the state to prevent it from repeating.
Problem and disadvantage might be that if several targets could get the state in the same turn, the common event can't assign which actor did what skill and has to handle all targets independently. -
in that case there is another way that uses no scripts, but requires a lot of event coding in the common event.
Make an invisible target state just for that skill - it should have no icon, no messages, no effect and be nothing but a marker. Then have the skill add that state to the target as a regular skill effect.
In the common event you'll now need a conditional branch for every enemy index (1-8) checking if that enemy has the state applied. If yes, you've found the correct enemy index and can use the commands to read the data of that enemy. Then after that you remove the state to prevent it from repeating.
Problem and disadvantage might be that if several targets could get the state in the same turn, the common event can't assign which actor did what skill and has to handle all targets independently.
What about setting a variable to the enemies ID? It only occurred to me now that It'd be easier if that was possible. -
HimeWorks has a script that lets you set effect formulas: http://himeworks.com/2014/02/formula-effects/
That way you can use dsiver's formula in the notetag and the enemy won't take any damage.