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

Help Thread: Script Help Thread

Status
Not open for further replies.
1,278
Posts
9
Years
  • Hello!
    I had a problem with a script.
    The problem is this:
    When the battle ends, the applymovement and the hidesprite don't work.
    Maybe I was supposed to add this as a level script?
    Here is the script:
    Spoiler:

    EDIT: Tried another script and it works perfectly. No need to answer this.
     
    Last edited:
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    I've created a script where the player can buy an egg that will hatch into a random pokemon. I've written the script in a way to limit the selection of random pokemon to only first-form Hoenn pokemon that aren't the 3 starters, the 2 fossils, or the legendaries.

    The script seems to be working almost perfectly, except for one strange hiccup: the eggs are all hatching into the final stages of the pokemon.

    I ran a test with it, and the 4 eggs I tested hatched into Mightyena, Huntail, Sableye (a non-evolving pokemon), and Salamence. I am confused because to get Mightyena in an egg, for example, you'd use the command "giveegg 0x106" which is nowhere in my script. Anyone know why this would be happening?

    Here is my script for reference:

    Spoiler:


    Also as a small side note, when I check the info screen of the egg it says "An egg obtained from a traveling man." Is there a way to change that?

    Hi! Somewhere along the way I think you've mixed up your numbers. According to Diegoisawesome's list Mightyena's decimal number is 287 > 11F hex, which is in your code.

    No idea about the egg message thing sorry!
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Spoiler:

    Also as a small side note, when I check the info screen of the egg it says "An egg obtained from a traveling man." Is there a way to change that?
    going to guess that the traveling man thing is the game's way of dealing with eggs not from day care/day care man
    i was about to tell you to check out 3D7DD2 but that's lucky egg's description
    check out around E9A460, that's all summary screen stuff
     
    65
    Posts
    7
    Years
  • How's it going y'all?

    I'm trying to do a very basic alteration, but am having issues with it. I'm trying to alter the text in the script to change what NPC's say when interacting with them. For some reason, after I modify the script so that they'll have the new lines, part of their old lines gets tacked onto it after compiling. I'm using Advance Map and Red Alien. I'm trying to improve on the Fire Red Creepy Black rom. Any help on this would be greatly appreciated!

    The script before I compile

    Spoiler:


    The script after I compile

    Spoiler:
     
    65
    Posts
    7
    Years
  • Don't ever just add lines to an existing script. You always want to change the offsets of the script, otherwise you're going to overwrite data from the ROM.

    I've been reading some more and think I understand what you mean, but I'm still having trouble figuring out how I do that. Can you please give me an example how I'd do that in this situation in order to understand it better? I found something about a #dynamic command that's supposed to be added at the beginning of the script, but I get lost beyond that point.
     
    65
    Posts
    7
    Years
  • The dynamic command basically will automatically find free space for every individual section of your script, which gets denoted by an @ sign and a random name of your choosing.

    So to repoint your whole script, for example, you'd replace all of the offsets you see with @ and a name, with the dynamic command at the beginning.

    So an example of repointing the whole script would be:

    Spoiler:


    When you compile this in XSE, it'll give you offsets for each part, and you want to copy the offset for "scriptone" and paste it in for the character in Advance Map.

    Also, just as a side note, if the only thing you changed is the dialogue...the offset for the dialogue (0x18ebe6) would be the only one you need to change. You'd only need to repoint the bigger offsets if you added completely new commands or something. I've never played Creepy Black so I have no clue what you added and what was originally there.

    Got it working now, thank you! Right now I'm just modifying what NPC's say, the original game was never finished, so there's a LOT of room to improve where the dialog is concerned. I would like to make changes to the environment at some point, but that's still beyond my skill level. Ideally I would like to add some type of weather overlay with a thick, tinted fog for exterior areas.
     
    37
    Posts
    8
    Years
    • Seen Sep 10, 2018
    So... I don't actually have a script to critique, but I do have a question before I try one. What memory addresses are accessible and what addresses are protected? JPAN's thread gives some nice information. What I want to do is access 0x0300500C. This gives a pointer that (in my save at least, though a quick test indicates this might be true of all ROMs) leads to 0x020245B4. From there, a 28 byte offset leads to 0x020245DC, which contains the data for caught Pokemon. I want to be able to -ideally without any ASM needed - access a particular bit to see if a particular species has been caught. Is this possible? Alternatively, can I just check for the species in the party?

    I'm not sure where to start. A look at a few scripts for seeing Eevee plus its evolutions and Articuno outside of battle, and their scripts all contain:

    setvar 0x8004 0x[species index value]
    special 0x163

    I must assume that's something to do with setting a seen flag, but I doubt it can work in reverse.
     

    Zervais

    Island Kahuna
    258
    Posts
    7
    Years
  • I'm looking to give my player a Shinx but when I attempt to use the script in game, it crashes, the colours/screen glitching up and I can't move. This is the script I'm using:

    Spoiler:


    The same script will work with any Pokémon up to 386 but I'm using Artificial Red which includes the full 721 Pokémon, which I've tested in battle and they show up fine.
     

    colonelsalt

    Guaranteed to raise the smile
    111
    Posts
    11
    Years
  • According to this fellow, the current map and map bank are stored at 0x0203F3A8 and 0x0203F3A9 respectively. A quick check in VBA's memory viewer confirms that this is correct.

    Using comparefarbytetobyte against these locations to check if the player is in a specific map does not seem to work, however.

    That is, the script below, which is meant to check if the player is in the Rock Tunnel (bank 0x1, map 0x51 and 0x52), always jumps to the @notInCave part.

    Spoiler:


    Have I simply misunderstood how the comparefarbytetobyte command works? What seems to be the issue here?


    EDIT: Hahahaha goody goodness. Seems like the locations are simply switched around; 0x0203F3A8 contains the bank and 0x0203F3A9 the map. Good day!
     
    Last edited:
    37
    Posts
    8
    Years
    • Seen Sep 10, 2018
    I'm looking to give my player a Shinx but when I attempt to use the script in game, it crashes, the colours/screen glitching up and I can't move. This is the script I'm using:

    Spoiler:


    The same script will work with any Pokémon up to 386 but I'm using Artificial Red which includes the full 721 Pokémon, which I've tested in battle and they show up fine.

    You're giving the wrong Pokemon. The Pokemon's number needs to be its index value in hexadecimal, not base 10. 403 in hex in that script means the game is giving you the 1027th Pokemon. I'm not actually sure what Artificial Red is doing in terms of index values (there are 25 Missingnos between Celebi and Treecko, and they might have been turned into newer Pokemon or ignored entirely), but Shinx is probably 193 or 1A4 (403 and 403+25, respectively, in hexadecimal). Try 1A4 first and see what happens.
     
    Last edited:
    21
    Posts
    7
    Years
  • Hello there! this is my problem:
    In any script i write, every time i use the hidesprite command, the sprite disappears but reappears again after the player moves one step. How can i make a sprite disappear completely?
     
    3,830
    Posts
    14
    Years
    • Age 27
    • OH
    • Seen May 10, 2024
    Hello there! this is my problem:
    In any script i write, every time i use the hidesprite command, the sprite disappears but reappears again after the player moves one step. How can i make a sprite disappear completely?

    In order to make the sprite disappear permanently you need to set a flag that is linked with that event.

    First select a flag to use, and then set that event's Person ID to the flag as well. When the flag is set that person event will be disabled.
     

    Anthroyd

    Professor
    211
    Posts
    7
    Years
  • Hello there! this is my problem:
    In any script i write, every time i use the hidesprite command, the sprite disappears but reappears again after the player moves one step. How can i make a sprite disappear completely?

    Adrift's response is totally correct, but I wanted to jump in and direct you here:
    https://www.youtube.com/watch?v=II4_T3MCnLo&index=11&list=PLfI5DBI4tNyLBYGNhf1Ee8cgdmMtiilps

    I explain your problem in great detail in the above video, including hidesprite, showsprite, flags, and variables.
     
    52
    Posts
    9
    Years
  • Hei!
    im working on my rom hack on firered, and i have come to the place where the bicycle road are. And i was wondering if there was any possible way to check if the bicycle is acctivated, and then perform an action.

    i tried make one lokking like this:
    Spoiler:


    but ofcourse the 'checkspecial' isnt aceptning by the PSKV console. because there isnt any thinks that is checkspecial. could i got som help, to find a working script that checks if the bicycle is activated. and then perform an action. not a script that checks is the player has the bicycle in the bag.
    Thank you in beforehand :D

    Regards
    Loster31345
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Spoiler:
    "checkitem 0x168 0x1"
    checks if item index 0x168 (bicycle) is in the bag at quantity 1; returns 0x1 to var 0x800D if it has 1 or more in the bag, 0x0 if it has less in the bag
     
    52
    Posts
    9
    Years
  • "checkitem 0x168 0x1"
    checks if item index 0x168 (bicycle) is in the bag at quantity 1; returns 0x1 to var 0x800D if it has 1 or more in the bag, 0x0 if it has less in the bag

    im sorry, i mentioned it in my request. that i need help that checks if the bicycle is activated.
    NOT that its in the bag

    regards
    Loster31345
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • im sorry, i mentioned it in my request. that i need help that checks if the bicycle is activated.
    NOT that its in the bag

    regards
    Loster31345
    omg, so sorry!
    you can use a flag for this, just set it after using special 0x157~
    you can probably check a certain bit in the ram/maybe there already is a flag set for this, but i currently do not have access to my computer to check~
     
    52
    Posts
    9
    Years
  • omg, so sorry!
    you can use a flag for this, just set it after using special 0x157~
    you can probably check a certain bit in the ram/maybe there already is a flag set for this, but i currently do not have access to my computer to check~

    :D it dosent matter.
    i like your idea, but the bicycle can also be activated throught the bag. what sud i do about that?

    regards
    Loster31345
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • :D it dosent matter.
    i like your idea, but the bicycle can also be activated throught the bag. what sud i do about that?

    regards
    Loster31345
    just a hunch (still in school ToT), but check out the ram bytes at 02037078 - 0203707E in vba's memory viewer.
    02037079 has to do with the bike if i remember correctly, see if it gets set to a specific value when biking~
     
    Last edited:
    Status
    Not open for further replies.
    Back
    Top