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.
Troop Script Call Help
● ARCHIVED · READ-ONLY
-
-
$game_troop.troop_id will give you the troop id from the database.
$game_troop.troop.name will give you the name. -
So this would work for a conditional branch I assume?
-
yep
-
So I would type "$game_troop.1" for example?yep
-
No. If you wanted to see if you were battling troop 1, you'd do this:
Code:as a Script in the Conditional Branch$game_troop.troop_id == 1 -
I set the script to happen when I used the move and it crashed the game.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
Am I doing something wrong? -
$game_troop.troop.id == 1
-
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.PNGSorry - 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.
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. -
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... -
is it still giving you the error? Did you make the fix indicated by Hime?
-
I just used Hime's fix and it worked.is it still giving you the error? Did you make the fix indicated by Hime?