• 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?".
  • 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.

Starter choices

32
Posts
4
Years
    • Seen Sep 19, 2023
    Hi everyone, i try to make another form to get a started.

    Spoiler:

    Code:
    Iniciales=[1,4,7,152,155,158,252,255,258,387,390,393,495,498,501,650,653,656,722,725,728,
    810,813,816];
    def pbEleccionInicial
      poke=rand(728)+1;
      level=5;
        if $game_variables[7]<1
    	if Iniciales.include?(poke)
        if Kernel.pbConfirmMessage(_INTL("Quieres a este {1}",PBSpecies.getName(poke)))
        pokes=pbAddPokemon(poke,level);
        $game_switches[3]=true
        $game_variables[7]=1
        else
        Kernel.pbMessage(_INTL("Piensalo muy bien"))
      end
      else
      pbEleccionInicial;
    end
    else
      Kernel.pbMessage(_INTL("Ya obtuviste tu pokemon inicial."))
    end
    
    end
     
    71
    Posts
    6
    Years
    • Seen yesterday
    that looks like an inefficient way to do it, the function keeps calling itself till you hit one of the starter numbers, if you have bad rng you could have to keep calling the function hundreds maybe thousands of times, also since u ask player to confirm it's kinda pointless to make it random, it will just be frustrating for the player to keep rolling till he/she gets the pokemon he/she wants
    but if u wanna make it faster / more efficient i think smth like this
    Code:
    poke=Iniciales[rand(24)] ##or Iniciales.length instead of 24
    also seems like its unnecessary to use both a switch and a variable when the variable is just storing 0/1 and not the pokemon id, id just let the switch go and store the pokemon in the variable in case u want to use it later
     
    Back
    Top