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

How do you make an NPC check the Players amount of badges?

SneakyEpicface11

PkMnMaster Ben
14
Posts
11
Years
  • Hey guys, I'm starting to make a Pokemon game in RMXP with the Pokemon Starter Kit, and I want there to be a guy in the first town standing outside a cave that checks to see if the player has a certain number of badges. I can't find any scripts that do so. Is it possible? I don't know how and it's really holding me back. Thank you for reading, please answer.
    :)

    EDIT: Thanks to Nickalooose for the answer!
     
    Last edited:

    SneakyEpicface11

    PkMnMaster Ben
    14
    Posts
    11
    Years
  • lol.
    No problem... Glad I could help.

    I'm still having issues. I'm new to the whole "actually making good games with RMXP" thing. I put that script in a script box thing on the event page and named the man "Trainer(2)". Though he wouldn't notice me and I'd have to manually talk to him. Even if I set the number of badges I have to 8 he still makes me turn around.

    I deleted the event and am going to start over with it. Is there something I'm missing? If the answer involves the "switches" then I might still have some problems, because I don't understand the switches. I'm not new to RMXP, it's just that I don't know how to use the switches.

    Do I need to make another event page?
    If I do what do I put on it?

    Thanks
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    It's a good idea to use:
    pbTrainerIntro(:LASS)
    and
    Kernel.pbNoticePlayer(get_character(0))
    Before any trainer battle... The latter gives the event "eyes" and the distance he can see, means he will notice you (exclamation mark and move towards you).

    Making a good game doesn't require knowledge, really, but creativity, a person with a lot of knowledge can still make a poor game.

    The event should look somewhat like this:

    Code:
    [COLOR="Blue"]conditionalbranch: Script: $Trainer.numbadges<[I][COLOR="Black"]x-number-of-badges[/COLOR][/I]
          playanimation[COLOR="black"]:[/COLOR] exclamtion.
          speech[COLOR="black"]:[/COLOR] "Oi player...  You can't go past here without [I]x-number-of-badges[/I]!"
          playermovement[COLOR="black"]:[/COLOR] move up,down,left or right, depending on which direction is away.
    end[/COLOR]

    You don't need to make him move, because you said, and I quote;
    I want there to be a guy in the first town standing outside a cave
    You really don't want this guy to move.
    Kernel.pbNoticePlayer(get_character(0))
    So I wouldn't use this line at all.

    EDIT:
    As for page 2... Yes you will need a switch.
     
    Last edited:

    SneakyEpicface11

    PkMnMaster Ben
    14
    Posts
    11
    Years
  • As for page 2... Yes you will need a switch.[/QUOTE]

    Thanks for the info, and I was wanting the player to move, not the man person. :)

    So for the switch do I just set an on Self Switch? I'm new to some of this :)

    EDIT: I'm really confused.

    EDIT: Thanks anyways, I'll find more help if I can. I just need someone to explain the switches and how I'm supposed to get the person to "see" the player.

    I tried what you said and nothing was working (It might just be my really low experience with RMXP) You said "Making a good game doesn't require knowledge, really, but creativity, a person with a lot of knowledge can still make a poor game." But I have to actually know how to use RMXP to actually make a game :L. As I said "I'm new to the whole 'actually making good games with RMXP' thing". Basically I dont understand about 40% of RMXP.

    Could you explain it a bit more deep? Please, and Thanks.

    I'm also needing a scientist in the professors lab that notices the player and gives him the Pokedex. Would that be set up differently?

    Thanks
     
    Last edited:

    thor348

    That's Oak to You
    137
    Posts
    11
    Years
  • In order to check if they have the required gym badge, all you need to do is after they have beaten the gym leader and have been given the badge, turn on the switch "Defeated Gym X". Then for the person in front of the cave, just use a conditional branch to check ifthe switch is on. if it is then set up the event in the conditional branch. if not, put what you want to happen otherwise under the :Else.

    switches are like light switches, they turn things on and off. you can turn them on to activate things, and off to stop them. you can use conditional branches to check to see if they are on or off. also, you can have different parts of the even only happen by setting the event condition to a certain switch. so only if the switch has been turned on, then the event will activate.

    and for the scientist to 'notice' the player, just put events where they have to walk with the trigger event touch, and have that/those events move the player to the scientist, have the dialogue, etc etc and when it's over, just have one of the self switches turn on. self switches are nice because they don't use up standard switches. and for other reasons. but self switches are almost just like switches except they don't work globally. just for that event.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Your biggest problem is that you don't know how to use RPG Maker XP. Knowing how to use it is fundamental to being able to use Essentials, which itself adds a lot of new information. I suggest you search the Internets for some tutorials and guides on RMXP and get comfortable with it before trying to make a Pokémon game. Trust me, it's well worth the time.

    There is an example of a roadblock event in the Essentials example maps (Route 7 west), which you can quite easily adapt to suit your purposes (once you know the basics, of course).
     
    Back
    Top