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

Any guides for scripting events in Firered with Hexmaniacadvance?

  • 3
    Posts
    2
    Years
    • Seen Apr 13, 2025
    I'm working on my very first romhack after YEARS of thinking "I would love to do that, but it seems way too hard, so I doubt I'd ever be capable." I keep running into walls, figuring things out, and then BAM, I run into another wall and am stuck for days perusing this forum, some subreddits, and other websites. Anyway, I finally feel comfortable importing sprites without messing up other overworld sprites, so now I'm on to my first scripted event triggered by the player stepping on a specific tile on the map. I essentially want the player to be called over by an NPC, the player then walks over the the NPC and then there's much more to the scene than that, but I cannot even get past that first hurdle. Seems like something that should be fairly straight-forward, but I can't get it to work. I've found countless tutorials for scripting with XSE so I tried that first by compiling the code in XSE and then assigning it to the tile in Hexmaniacadvance. My player would step on the tile and just freeze. The text box never came up with the NPC calling the player over. I changed some code around to try to fix it, and then whatever I did messed it up even more and the player would just walk past the tile and it wouldn't trigger an event at all.

    To the point, I really enjoy using Hexmaniacadvance as it seems like it just does everything and saves time from hopping between programs. I'm sure with enough time, I'll eventually figure it out and get it working, but my main question is, is there any type of guide on what the commands in hexmaniacadvance for scripting do. I would love to just write the script there, but the commands seem to be different than in XSE. Maybe not, but they seemed fairly different. When I've tried just copying and pasting code from XSE into the code box in HMA for the trigger tile, it gives me all kinds of notifications about not recognizing certain commands. Are there any guides out there on HMA scripting code?
     
    Good job getting this far! You're right, the commands in HMA are slightly different from XSE. Well, the underlying code the game reads is the same, but the macros you use for typing them out is different. This is a good thing because HMA's macros are on their way to being a lot simpler than XSE ones. The only reason they haven't made a guide yet is because HMA's script editor (and map editor) are still being developed, so any guide made today might be outdated next month. It is still fairly doable to translate the macros though, so in your position I would first learn the code in XSE form and then figure out the equivalents in HMA. You can compile a script in XSE first and then go to that offset in HMA to read it in HMA form if that helps.

    Sorry for that ramble, but more relevantly there's probably nothing wrong with your code. A freezing script tile is a common beginner mistake that doesn't come from the code but how the tile itself is set up. Clicking on a script tile in AdvanceMap brings up this info:
    [PokeCommunity.com] Any guides for scripting events in Firered with Hexmaniacadvance?

    The important ones are Var Number and Var Value. In HMA I believe these are labelled Trigger and Index respectively. Most script tiles need these to be set up or they will freeze. They are conditional triggers. It is basically telling the game "If [Var Number] is currently [Var Value], run this script tile. Otherwise, do nothing". These use the same variables you've probably seen used in scripts with stuff like setvar, so you can guess how variables can be used to track game progression and activate or deactivate script tiles when the story requires. If you haven't set this info on the script tile, the game gets confused and freezes
    Essentially, add these 2 bits of data to your script tile and it shouldn't freeze. If you're not at the point of using variables yet, you could always use a dummy variable at zero for testing purposes. A list of variables can be found here: https://github.com/pret/pokefirered/blob/master/include/constants/vars.h The ones with no name are all safe to use.

    If that wasn't your problem and your script is freezing due to your code, just post your script here and we'll see what went wrong
     
    Oh my goodness, you are an absolute blessing. I was wondering what those two boxes were for but that makes perfect sense and actually clears up a lot. I appreciate it tremendously! So far I've loved HMA as it encouraged me to want to do more with my Romhack. Originally, I was just planning on having a little fun and just replacing the gym leaders with my family/friends and giving them their own teams just for kicks, but keeping the core game the same. But as I got into playing around with HMA, I've started thinking "ohh maybe I could tweak that too, or add this to the game" and it's been a blast. The only trouble I'm running into is that with HMA is that, as you mentioned, is still fairly new and in active development so while there are guides and tutorials, there's a lot that has to be figured out on your own and I tend to get easily discouraged when I don't pick up on something quickly and I lose patience with myself. I was stuck for a week on how to add overworld sprites in HMA because every time I would, it would mess up other in-game sprites because I didn't realize I was messing up other sprite palettes and that I had to use the dynamic overworld patch and add a pallet. All the guides I could find for how to do that were for other applications that weren't HMA but I eventually found one and I THINK I have it figured out for the most part now. At least, everything looks okay from what I could tell so far!

    If anything, what this whole process has taught me is how rewarding that moment is when something finally clicks and you get through the hurdle. There will probably be another hurdle right around the corner, but through perseverance and/or kind and helpful people on the internet, I'll eventually get on through.

    Thanks again for your help. I will give everything a try later today and see how it goes!
     
    Back
    Top