• 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 Trading Card Game 2 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.

[Script] Creating an ability like Intimidate

  • 3
    Posts
    3
    Years
    • Seen Sep 8, 2021
    Hello,
    I am currently making an Emerald hack, and I want to add an ability that is like Intimidate but for Special Attack, called Mystify. So far I have defined the ability in include/constants/abilities.h, added the name and description in src/data/text/abilities.h, created the special status mystifiedMon and the battle structure mystifyBattler in include/battle.h, and added a resource flag in include/battle.h:
    Spoiler:

    (I am not sure if this way to implement a resource flag is correct, since I changed other hex values to fit the new flag in). Additionally, I added this code to src/battle_util.c:
    Spoiler:

    However, at this point I am not sure how to continue with the ability. I am especially confused by the use of ABILITYEFFECT_INTIMIDATE1 and ABILITYEFFECT_INTIMIDATE2 within src/battle_util.c (as well as some other files, specifically with 2), as well as the command extern const u8 BattleScript_IntimidateActivatesEnd3[]; in include/battle_scripts.h

    Why is Intimidate differentiated with numbers, what do these numbers mean, and how should I continue from here with the Mystify ability?
    Thank you in advance
     
    A small add-on to provide some specificity: I am almost done with the creation of the ability, however I am having some trouble with making the engine identify the target of the stat change. I tried using the trygetintimidatetarget macro, but that resulted in the effect being applied to the wrong Pokemon:
    Spoiler:

    In this example, Zigzagoon has the Mystify ability, and the game gives the ability pop-up correctly, but the game thinks the active battler is Torchic, resulting in the message and effect application seen above. So I tried to create my own macro, trygetmystifytarget, but all 1 and 2 digit hexadecimal byte values have been used in the asm/macros/battle_script.inc file. If I try to use a value that is already in use (I tried 0xe1, the same value trygetintimidatetarget uses), the same error occurs (the game thinks Torchic is the active battler). And if I try to use 0x100, when I compile it is truncated to 0x00, which results in the effect initially applying correctly, but then creates a loop of applying it to Torchic and then to itself until the game freezes. Is there a way to create additional macros in asm/macros/battle_script.inc?
     
    Last edited:
    For those who find this thread in the future, facing similar problems: you CAN use trygetintimidate target, just make sure in src/battle_script_commands.c you add the following code to Cmd_trygetintimidatetarget:
    Spoiler:

    This replaces the line that used to read gBattleScripting.battler = gBattleStruct->intimidateBattler;
     
    Back
    Top