Enemy Target I.D.

● ARCHIVED · READ-ONLY
Started by Brashnard 4 posts View original ↗
  1. Hi guys, new forum member here. I have a question regarding skill and enemy names.

    The Gist of It: I'm trying to store the name of the target of a skill in a variable.

    Detailed: I have a skill which does nothing. It activates a common event. This common event, forces the user to use one of two different skills: one that targets a random enemy, one that targets a random ally. [basically, it can't be controlled]

    I want to store the name of the final target as a variable, be it enemy or ally, so that I can call it for use.
  2. There are several ways to do this, depending on what exactly you want to achieve.

    Try to set it in the damage formula of the skill first:

    Code:
    $game_variables[20]=b.id; regular damage formula after the semicolon
    Replace the 20 with the number of the variable where you want to store the ID, and make the regular damage formula the last part of the formula.
  3. Edit: I figured it out, thanks. I took what you said to do, but instead of b.id I did b.name (Just a random guess after 30 minutes of fiddling with it) Thanks a bunch.
  4. I used the ID instead of the name, because most internal references are for the ID and you can use an ID in a variable for several follow-up-commands.


    Using the name only allows you to display it, or use it in script sequences (strings in variables are possible only from the scripted side, they are not supported by event commands).


    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.