• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Akari, Red, Kris, May - which Pokémon protagonist is your favorite? Let us know by voting in our semifinal favorite protagonist poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Question] Triggering an event after a group of specific trainers are defeated?

  • 5
    Posts
    5
    Years
    • Seen May 24, 2021
    [Essentials V18]
    I want an NPC to give the player an item after the player defeats all the trainers in a certain area (inside and outside a certain building). I tried to set it up so that when you talk to the NPC the first time, they trigger this subquest, but how do I make the game specifically see which and how many trainers were defeated in order to make the NPC notice that the requirement is now met?
    What I want to do is basically what happens in Sun/Moon at the Trainer's School: once you beat all trainers in the school, the principal battles you and gives you a reward.
    I managed to make it work for just one trainer (talk to NPC [trigger subquest] -> defeat one trainer [which clears the subquest] -> talk to NPC again to receive reward), but I just don't understand how to make it so that all 5 trainers in the area have to be defeated in a free order before the requirement for the reward is met.
     
    [Essentials V18]
    I want an NPC to give the player an item after the player defeats all the trainers in a certain area (inside and outside a certain building). I tried to set it up so that when you talk to the NPC the first time, they trigger this subquest, but how do I make the game specifically see which and how many trainers were defeated in order to make the NPC notice that the requirement is now met?
    What I want to do is basically what happens in Sun/Moon at the Trainer's School: once you beat all trainers in the school, the principal battles you and gives you a reward.
    I managed to make it work for just one trainer (talk to NPC [trigger subquest] -> defeat one trainer [which clears the subquest] -> talk to NPC again to receive reward), but I just don't understand how to make it so that all 5 trainers in the area have to be defeated in a free order before the requirement for the reward is met.

    Use variables! Each time a trainer is defeated, add 1 to a variable. You can then check the value of this variable to determine whether the reward should be given.
    I'm happy to take a few screenshots to show you how to set this up if you need help.
     
    Sorry for the ignorance, but I need to ask, are the variables infinite? I mean, can I use them without worrying or better save them?
     
    Sorry for the ignorance, but I need to ask, are the variables infinite? I mean, can I use them without worrying or better save them?

    I don't know if there's a cap on the number of variables you can have, but it's at least 999. As long as you're smart with their use, you shouldn't have to worry about running out of variables to use.
     
    Back
    Top