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

Adding custom script commands

  • 6
    Posts
    8
    Years
    • Seen Dec 23, 2020
    First of all, greetings.
    I wish to add a new script command to be used in map scripts, specifically a variation of givemon, which lets the scripter pick the moveset, IVs, gender, ability and pretty much every other attribute the gifted pokemon has. I've been investigating by myself, and given I'm new to this, I haven't figured out all the files I would need to modify. So far, I know these have to be modified:
    • asm\macros\event.inc
    • data\scrip_cmd_table.inc
    • src\scrcmd.c
    So I have 2 questions:
    1. Are there any other files I should be aware of when adding a new script command?
    2. I thought offsets weren't an issue with a decompilation project. Why are there specific addresses written in the event.inc file?
    I apologize if anything I'm asking seems obvious, I'm not familiar with ASM nor C, so I'm learning as I go.
     
    Are there any other files I should be aware of when adding a new script command?
    In the action of making a new givemon variant? Yes.
    Ghoulslash already made a quite complete givemon command. If it doesn't suit your needs, you can at least take a look at it and use his work as a reference. You can find it right here.
    Here's the direct link to the commit.
    I thought offsets weren't an issue with a decompilation project. Why are there specific addresses written in the event.inc file?
    Are you talking about the offsets written in the form of comments after certain labels, like for example this?
    gSpecialVars:: @ 81DBA0C

    They're just that, comments. They're ignored by the compiler when building a ROM, and they're there as a point of reference on where that particular piece of code can be found in the ROM. It's useful for the people who may want to use the decomps as a source of information instead of using them directly in order to create ROM Hacks.
     
    Thank you very much, this is exactly what I was looking for.
    If it doesn't suit your needs, you can at least take a look at it and use his work as a reference.
    I'm trying to add every little change myself, as I really need the experience. Thank you again.
     
    Hello again

    I have two more questions if you don't mind.
    1. Should I make a new thread whenever I have questions I'm not able to answer by myself? Posting another question on this thread that has a few days already and an answer for the original question seems like a bad idea, as in no one would see the new question. And of course I don't want to spam the forum.
    2. How do you initialize a trigger-related variable in order to run a script?
     
    Should I make a new thread whenever I have questions I'm not able to answer by myself?
    Yes.
    [*]How do you initialize a trigger-related variable in order to run a script?
    Are you talking about tile scripts
    If so, you'll have to give the required value to the variable that you configured for your tile script by using setvar VAR, VALUE in a script that the Player must trigger. Preferably, a script that they're forced to trigger, maybe when entering or spawning in a map.
     
    Back
    Top