• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Pokemon Ruby custom NPC event possible?

  • 5
    Posts
    1
    Years
    • Seen Sep 20, 2024
    I would like to create a customized Pokemon Ruby game. So far I cloned the "pokeruby" repository, set up my local development environment and build the .gba file.
    I also changed some sprites just to test things out.

    Now I want to add my first custom event/interaction.
    I want to place a NPC on the map. For the beginning it wouldn't matter if it's a new sprite or an existing one.
    When the player interacts with the NPC he should get asked for a password. If you type in the correct one you receive a custom Pokemon as a gift.
    The Pokemon should have a custom name, a custom level and should hold an item.

    Would this be possible to do?
    What would be the easiest/best way to implement it?
    Can someone give me an advice?

    I have some basic knowledge about c/c++ programming, but I don't know where to start.
     
    I want to place a NPC on the map. For the beginning it wouldn't matter if it's a new sprite or an existing one.

    You'll want to use Porymap to handle any map editing, which includes placing NPCs and all other interactable objects on maps.

    When the player interacts with the NPC he should get asked for a password. If you type in the correct one you receive a custom Pokemon as a gift.

    The password process could be handled by using something very similar to the "Walda Phrase" stuff that is native to the codebase. That process allows the player to type in some phrase, and then the game stores it, so that the text can be used later. Something like that should work for what you're trying to do, with a few tweaks.

    The Pokemon should have a custom name, a custom level and should hold an item.

    The normal givemon macro can handle custom level and held item, but it can't handle names. I know of a more customized way to give a mon to the player through this post, but I don't think this particular macro accounts for custom names either. It would certainly be doable to create a macro that gives a mon with a custom name, I just don't know what that process would be off the top of my head.
     
    First of all get porymap if you don't have it and set it up, that'll let you add the NPC to whichever bit of the map you want.

    It isn't immediately obvious to me how your password system would work, although I'm sure it could be done. An alternative which does occur to me, and which would be far easier, would be to replace written passwords with phrases and just adapt the script the berry master's wife uses:
    Code:
    Route123_BerryMastersHouse_EventScript_BerryMastersWife::
    	lock
    	faceplayer
    	dotimebasedevents
    	goto_if_set FLAG_DAILY_BERRY_MASTERS_WIFE, Route123_BerryMastersHouse_EventScript_ReceivedWifeBerryToday
    	msgbox Route123_BerryMastersHouse_Text_HeardAGoodSayingLately, MSGBOX_DEFAULT
    	setvar VAR_0x8004, EASY_CHAT_TYPE_GOOD_SAYING
    	call Common_ShowEasyChatScreen
    	lock
    	faceplayer
    	goto_if_eq VAR_RESULT, TRUE, Route123_BerryMastersHouse_EventScript_GavePhrase
    	goto_if_eq VAR_RESULT, FALSE, Route123_BerryMastersHouse_EventScript_CancelPhrase
    	end
    
    Route123_BerryMastersHouse_EventScript_GavePhrase::
    	goto_if_eq VAR_0x8004, NOT_SPECIAL_PHRASE, Route123_BerryMastersHouse_EventScript_GiveNormalBerry
    	goto_if_eq VAR_0x8004, PHRASE_GREAT_BATTLE, Route123_BerryMastersHouse_EventScript_GiveSpelonBerry
    	goto_if_eq VAR_0x8004, PHRASE_CHALLENGE_CONTEST, Route123_BerryMastersHouse_EventScript_GivePamtreBerry
    	goto_if_eq VAR_0x8004, PHRASE_OVERWHELMING_LATIAS, Route123_BerryMastersHouse_EventScript_GiveWatmelBerry
    	goto_if_eq VAR_0x8004, PHRASE_COOL_LATIOS, Route123_BerryMastersHouse_EventScript_GiveDurinBerry
    	goto_if_eq VAR_0x8004, PHRASE_SUPER_HUSTLE, Route123_BerryMastersHouse_EventScript_GiveBelueBerry
    	end
    (You will need to copy and adapt the whole thing, but this is the most relevant bit. The whole thing is easily accessible in porymap by just going to the berry master's house and clicking "open map scripts")

    If you're dead set on written passwords, try and think if there is anything similar in the base games which you can adapt.
     
    Back
    Top