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

[Script✓] PokeMart Script Issues in Fire Red

  • 20
    Posts
    4
    Years
    • Seen Sep 3, 2023
    Still quite new at ROM hacking and scripting in particular, so I may be missing something obvious that needs pointing out to me.

    I've been trying to add a simple pokemart script into Pallet Town as a learning exercise, but I've ran into some issues. When I placed the person outside in Pallet Town, they couldn't be interacted with at all. When I placed them indoors (inside the player's home) they would be interactable and load up the initial message, but would lock the game without opening the pokemart menu. As a test, I assigned the person the script for Cerulean City's pokemart instead, and it worked perfectly. I've all but copied my script from the big XSE scripting tutorial on here, so I'm not sure what I could possibly have done wrong, and I was hoping someone could help.

    My script:
    Spoiler:

    Cerulean City's pokemart script for comparison:
    Spoiler:

    The only key difference I can see between the two is the use of special 0x187, though JPAN's big post about Fire Red specials suggests it's an error checking special and nothing specific to pokemarts in particular. Either way, seeing as it features before the pokemart part of the script even happens, surely that can't be what's affecting it?
     
    Last edited:
  • 1,591
    Posts
    10
    Years
    • Seen Mar 20, 2024
    I suspect the issue is that you don't have #raw word 0x0 at the end of your item list, which is needed to tell the game where the list ends. Without that it'll keep looking past the end of the list for more items, find things that aren't items, and then crash.

    Also a little tip: if you add #include stditems.rbh at the top of your script, you can use item names instead of looking up the item index (e.g. you'd have ITEM_REVIVALHERB instead of raw word 0x21). XSE should have come with some .rbh files for items, Pokemon, attacks and movements, so you can make use of those to make your scripts easier to read.
     
  • 20
    Posts
    4
    Years
    • Seen Sep 3, 2023
    Oh it needs to have #raw word 0x0 at the end? The tutorial did not mention this... If that's what that does then that would certainly explain some of the issues I had ahaha

    With regards to the stditems.rbh file, funnily enough I had that open to use as a reference guide for the hex IDs. You're right though, it would make it easier for reading the script if I used it, I'll include it next time.

    I'll try adding that change when I get home from work and report back, thanks for the advice!
     
  • 20
    Posts
    4
    Years
    • Seen Sep 3, 2023
    Thanks for your advice, adding in the 0x0 at the end of the list allowed it to work.

    Still got a different... well, not issue per se but more a query. When I put the person event with the script attached outdoors in Pallet Town, they're still not interactable even with the revised script. Do you know if there's some quirk with the pokemart command which forces it to be used indoors? The curious thing is that, even when I set all the map data to "indoor" values, it still wouldn't function on that map. Bit of a headscratcher, though not a devastating issue by any means, so if you're not sure on this then I can just work around it.
     
  • 853
    Posts
    3
    Years
    • Seen Nov 9, 2023
    Thanks for your advice, adding in the 0x0 at the end of the list allowed it to work.

    Still got a different... well, not issue per se but more a query. When I put the person event with the script attached outdoors in Pallet Town, they're still not interactable even with the revised script. Do you know if there's some quirk with the pokemart command which forces it to be used indoors? The curious thing is that, even when I set all the map data to "indoor" values, it still wouldn't function on that map. Bit of a headscratcher, though not a devastating issue by any means, so if you're not sure on this then I can just work around it.

    what map tool are you using. and you don't need to change headers to make person events work.

    Also why didn't you copy the entire script? If you want to make it work like the other script copy the whole thing.
     
  • 20
    Posts
    4
    Years
    • Seen Sep 3, 2023
    what map tool are you using. and you don't need to change headers to make person events work.

    Also why didn't you copy the entire script? If you want to make it work like the other script copy the whole thing.

    I was using AdvanceMap 1.95, which I understand is somewhat buggy but it should not have affected this particular thing.

    This had nothing to do with making person events in general work, it was about making this specific person event work. For whatever reason, the script won't activate on the outdoor Pallet Town map, and I was asking if anyone knew why.

    If you'll pay attention to the first post, you'll notice that I said I did this as a learning exercise. If I'm just copy-pasting scripts that other people make, I'm not learning anything, am I? By writing the script myself, even if it was meant to be functionally the same as the example script in the tutorial, I've made a mistake and consequently learned why it needs the #raw word 0x0 at the end of the list, which is far more valuable than anything I'd have gotten from copy-pasting their script into the ROM.
     
  • 1,591
    Posts
    10
    Years
    • Seen Mar 20, 2024
    Thanks for your advice, adding in the 0x0 at the end of the list allowed it to work.

    Still got a different... well, not issue per se but more a query. When I put the person event with the script attached outdoors in Pallet Town, they're still not interactable even with the revised script. Do you know if there's some quirk with the pokemart command which forces it to be used indoors? The curious thing is that, even when I set all the map data to "indoor" values, it still wouldn't function on that map. Bit of a headscratcher, though not a devastating issue by any means, so if you're not sure on this then I can just work around it.
    You could try including that 0x187 special at the start of the script and see what happens; no idea why it's there, all it does is end the script if LASTRESULT is 2. Only other thing I could suggest is double checking that A-map hasn't messed up saving the script offset somehow; maybe it's missing and that's why the script doesn't run in Pallet Town, but will run inside.
     
    Back
    Top