• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Staff applications for our PokéCommunity Daily and Social Media team are now open! Interested in joining staff? Then click here for more info!
  • 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.

Timer, checking for males in the party, and storing the whole party in the PC

  • 226
    Posts
    9
    Years
    • Seen Jul 19, 2023
    So I started using Pokemon Essentials some weeks ago and I managed to make promising progress so far.
    However there are three questions so far that I could not figure out by myself or by browsing the wiki or the forum and some help will be appreciated.
    I will try to explain as best as possible - I apologize for potential language mistakes.

    1. Simply put, I would like to set a period of time for the player to accomplish an event. Let's say he must find an item in 60 seconds; if he succeeds, he gets it; if he fails, he can choose to start over again.

    I understand from the "Time-sensitive events" wiki how to trigger the countdown ("pbSetEventTime")
    I do not know how to edit the length of this countdown: my guess is that I should copy/paste and edit the "s:cooledDown?(86400)" script, would it work?
    I have no idea how to start something (I would guess an autorun event) defining what happens if he succeeds doing so, and what happens if he doesn't (ideally, starting over again).

    I believe I am stuck on this because I can't manage to define the proper switch/variable triggering what happens at the end of the countdown.

    2. Second, I would like to create a trainer who won't fight you if you have any Male Pokemon in your team.
    I did not find any script allowing an event to check the gender of a Pokemon. Does it exist?

    3. Finally, I am trying to make an event where the whole party of the player is transferred to his computer. Again, I did not find a script allowing me to do so.

    Any advice would be appreciated! Thank you for your time. I am not familiar with the script editor, so I hope those ideas do not request programming knowledge.
     
    1.) I haven't messed with time-sensitive events so I don't know how to make this work.

    2.) Insert the following somewhere in the PSystem_Utilities section of your scripts. There's a function called pbHasSpecies? near line 2355, I'd recommend putting it around there.
    Code:
    def pbHasMaleInParty?(species=nil)
      if species!=nil
        if species.is_a?(String) || species.is_a?(Symbol)
          species=getID(PBSpecies,species)
        end
        for pokemon in $Trainer.party
          next if pokemon.isEgg?
          return true if pokemon.species==species && pokemon.isMale?
        end
      else
        for pokemon in $Trainer.party
          next if pokemon.isEgg?
          return true if pokemon.isMale?
        end
      end
      return false
    end
    You can then have the event call the code pbHasMaleInParty?() to determine if they should fight you. You can also do something like pbHasMaleInParty?(:EEVEE) to check specifically for a male Eevee.
     
    Many thanks for the fast answer! That's exactly what I was looking for.

    Do you have any idea regarding my 3rd point? It should be like, the whole party of the trainer is seized and he temporary loses his party Pokemon.
     
    Back
    Top