The PokéCommunity Forums Fan Games Game Development Scripts & Tutorials
Essentials Script Randomized Pokemon Script

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Reply
 
Thread Tools
  #26    
Old 6 Days Ago (11:13 AM). Edited 6 Days Ago by mgriffin.
mgriffin's Avatar
mgriffin mgriffin is offline
     
    Join Date: Apr 2014
    Posts: 113
    Quote:
    Originally Posted by WolfPP View Post
    Now i want to know how to put a switch to make a encounter by type
    like, if i stay in volcano area, switch x will appears only fire type, or in a sky pillar will appears only fly type, you know?
    Maybe you can do something like:

    Code:
      BlackListedPokemonDefault = [...].map { ... }
      BlackListedPokemonGrass = [...].map { ... }
      BlackListedPokemonVolcano = [...].map { ... }
      ...
    
      def BlackListedPokemon
        case mySwitch
        when 0: return BlackListedPokemonGrass
        when 1: return BlackListedPokemonVolcano
        ...
        else: return BlackListedPokemonDefault
        end
      end
    I don't know about switches, but I guess you know how to set mySwitch when a player enters an area? Or maybe there is some way to find out what route the player is on, and switch on that instead?

    EDIT: Maybe it is easier to use whitelist for these kinds of things? Probably it will be less typing.
    Reply With Quote
      #27    
    Old 6 Days Ago (12:33 PM).
    WolfPP's Avatar
    WolfPP WolfPP is online now
       
      Join Date: Aug 2018
      Location: Brazil
      Gender: Male
      Nature: Jolly
      Posts: 115
      Quote:
      Originally Posted by mgriffin View Post

      EDIT: Maybe it is easier to use whitelist for these kinds of things? Probably it will be less typing.
      I agree, but how can i put Types? Like egg generator by FL:

      Code:
      def randomEggBasedOnTypeEntered(helptext)
        typeName = pbEnterText(helptext,0,8)
        typeValidNumber = nil 
        typeAvailable = [:NORMAL,:FIGHTING,:FLYING,:POISON,:GROUND,
            :ROCK,:BUG,:GHOST,:STEEL,:FIRE,:WATER,:GRASS,:ELECTRIC,:PSYCHIC,
            :ICE,:DRAGON,:DARK,:FAIRY]
        for typeSymbol in typeAvailable
          type = getID(PBTypes,typeSymbol)
          if PBTypes.getName(type).downcase == typeName.strip.downcase
            typeValidNumber = type 
            break
          end
        end
        if typeValidNumber
          randomEggGenerator([],false,typeValidNumber)
          return true
        end
        return false
      end
      about the switch, yes, i know how to put it. Player touch etc :D

      ty ty!
      Reply With Quote
        #28    
      Old 6 Days Ago (12:55 PM). Edited 6 Days Ago by mgriffin.
      mgriffin's Avatar
      mgriffin mgriffin is offline
         
        Join Date: Apr 2014
        Posts: 113
        Quote:
        Originally Posted by WolfPP View Post
        I agree, but how can i put Types?
        Oh right, I misunderstood.

        Maybe you can use select?

        e.g.

        Code:
        [1, 2, 3].select { |i| i < 3 }
        Returns [1, 2].

        So you could use a select that checks the type of the species?
        Reply With Quote
          #29    
        Old 4 Days Ago (5:48 AM).
        WolfPP's Avatar
        WolfPP WolfPP is online now
           
          Join Date: Aug 2018
          Location: Brazil
          Gender: Male
          Nature: Jolly
          Posts: 115
          Quote:
          Originally Posted by mgriffin View Post
          Oh right, I misunderstood.

          Maybe you can use select?

          e.g.

          Code:
          [1, 2, 3].select { |i| i < 3 }
          Returns [1, 2].

          So you could use a select that checks the type of the species?
          I didnt :/

          And, unfortunately, i found a treecko in a wild encounter :///////// To sad...
          Reply With Quote
          Reply

          Quick Reply

          Join the conversation!

          Create an account to post a reply in this thread, participate in other discussions, and more!

          Create a PokéCommunity Account
          Thread Tools

          Posting Rules
          You may not post new threads
          You may not post replies
          You may not post attachments
          You may not edit your posts

          BB code is On
          Smilies are On
          [IMG] code is On
          HTML code is Off

          Forum Jump


          All times are GMT -8. The time now is 7:31 PM.