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

Random Pokemon, Eggs & Items through Events

KingCharizard

C++ Developer Extraordinaire
1,229
Posts
14
Years
  • Welcome to king charizard's Video Tutorial.​

    Below is a video on how to make an NPC give the player random eggs, pokemon, items and even make your NPC's say more...​


    For some reason I cant embed the video can anyone tell me why I cant.

    -Scripts for Random Eggs-

    Conditional Branch: Variable [050: Random Egg] == 0
    Conditional Branch: Script: $Trainer.party.length>=6 <- Checks to see if you have 6 pokemon
    Text: You have no room to store the Egg...
    Else
    Script: Kernel.pbGenerateEgg(001,5)
    Text: Received a Pokémon Egg.
    Branch End

    Else

    Branch End


    -Scripts to add random pokemon-

    Conditional Branch: Variable [050: Random Pokemon] == 0
    Conditional Branch: Script: $Trainer.party.length>=6 <- Checks to see if you have 6 pokemon
    Text: You have no room to store the pokemon...
    Else
    Script: pbAddPokemon(001,5)
    Text: Received a Pokémon.
    Branch End


    Else

    Branch End

    -Scripts to add random items-

    Conditional Branch: Variable [050: Random Item] == 0
    Conditional Branch: Script: $PokemonBag.pbStoreItem(::PBItems::POTION)
    Text: The item was added
    Else
    Text: The item couldn't be added
    Branch End

    Else

    Branch End
    _____________________________________________
    Green = Scripts
    Blue = Built in events
    Black = Text of your choosing

    Search the PBS txt file called pokemon for the pokemon ID# you want.
    Search the PBS txt file called item for the item name you want.
    Also read the notes on how to add more items & pokemon.

    If you follow the video perfect you shouldn't have any problems!
    If you are having problems feel free to PM me!

    Dont PM me saying i did everything you said in your video and it still doesn't work cause you didn't do everything i've said if you did it would work. Try to show me where u think the problem is or send me the error's you were prompted with.



     
    Last edited:

    FinalEclipse

    Learning to be a Tile Artist
    300
    Posts
    16
    Years
  • Good tutorial! Now I can make an Event in my new game with a random egg.

    Is there a way so that the egg will be random from a set? Such as a random egg that could only be Dialga, Palkia or Giratina?

    If that is you speaking the the video, your voice is awesome!
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Good tutorial! Now I can make an Event in my new game with a random egg.

    Is there a way so that the egg will be random from a set? Such as a random egg that could only be Dialga, Palkia or Giratina?

    If that is you speaking the the video, your voice is awesome!
    You can do that without anything mentioned in this tutorial. Rather than have that first conditional branch involving variable 50, replace it with "rnd(2)". This will randomly generate one of the numbers 0, 1 or 2. Make a conditional branch which looks at what this number is, and generate a different specific egg depending on the number.
     

    KingCharizard

    C++ Developer Extraordinaire
    1,229
    Posts
    14
    Years
  • You can do that without anything mentioned in this tutorial. Rather than have that first conditional branch involving variable 50, replace it with "rnd(2)". This will randomly generate one of the numbers 0, 1 or 2. Make a conditional branch which looks at what this number is, and generate a different specific egg depending on the number.

    Yeah, I just made this a very basic tutorial... Its not ment to be anything other than working & simple.
     

    Wilcomon

    Best mapper you've ever seen
    31
    Posts
    13
    Years
    • Seen Dec 20, 2012
    Help me please,
    i've it but wont work
    how to let him give your first pokemon?
    (numbr:147)
    can u help?
     

    KingCharizard

    C++ Developer Extraordinaire
    1,229
    Posts
    14
    Years
  • I No longer offer support for this tutorial. But if you followed my directions correctly it would work, I cant be any more clear sorry...
     

    Cilerba

    the hearts of lonely people
    1,162
    Posts
    14
    Years
  • You didn't even explain anything. For a good tutorial you should explain everything in it.
     
    Back
    Top