Troop Script Call Help

● ARCHIVED · READ-ONLY
Started by Tatsude K. Hitori 13 posts View original ↗
  1. I was wondering if there's a command or script line that would allow the game to check what troop you're fighting for different results.

    For example, if I used a move called "Bargain" on a troop of rats. The game would reply with the character saying "These rats don't understand me."

    And if I'm fighting a thief and I use the move "Bargain". The game would reply with something else because of a different troop.
  2. $game_troop.troop_id will give you the troop id from the database.


    $game_troop.troop.name will give you the name.
  3. So this would work for a conditional branch I assume?
  4. yep
  5. Shaz said:
    yep
    So I would type "$game_troop.1" for example?
  6. No. If you wanted to see if you were battling troop 1, you'd do this:

    Code:
    $game_troop.troop_id == 1
    as a Script in the Conditional Branch
  7. Shaz said:
    No. If you wanted to see if you were battling troop 1, you'd do this:

    $game_troop.troop_id == 1as a Script in the Conditional Branch
    I set the script to happen when I used the move and it crashed the game.

    Am I doing something wrong?
  8. $game_troop.troop.id == 1
  9. Sorry - I assumed troop_id was an attr_reader.


    If it still gives you an error, can you tell us what the error message is? If it doesn't give you an error but still doesn't work, post a screenshot of how you've got the skill and the common event set up so we can take a look.
  10. Shaz said:
    Sorry - I assumed troop_id was an attr_reader.

    If it still gives you an error, can you tell us what the error message is? If it doesn't give you an error but still doesn't work, post a screenshot of how you've got the skill and the common event set up so we can take a look.
    http://www.mediafire.com/view/esm0wocbj71rmb4/commonevent.PNG

    The skill when used, starts the common event which uses this line of script. What I'm wanting is for it to check the troop/enemy and give different dialog depending on what it is.
  11. Did you change the default battle system?


    And is that CE called inside a battle?


    That call will only work if the skill is used during battles, because if the skill is used outside of battle the troop is not defined...
  12. is it still giving you the error? Did you make the fix indicated by Hime?
  13. Shaz said:
    is it still giving you the error? Did you make the fix indicated by Hime?
    I just used Hime's fix and it worked.