• 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.
5
Posts
8
Years
    • Seen Mar 13, 2016
    Spoiler:

    Well Hi I´m pretty new to Romhacking and wanted to try play around my Firered Romand and now got stuck with my Script :/ It´s at the old Spawnpoint since i moved the Spawn over to the Rival´s house. The script should move the player towards the "rival" and shouldnt let him go out of the room before he picked his starter. Now if I walk on the script the game stops and only the music is playing. Someone see the mistake?:/

    Edit: thx Rubix now its working ^^
     
    Last edited:
    81
    Posts
    8
    Years
    • She/her/hers
    • Seen Oct 26, 2023
    Spoiler:

    Well Hi I´m pretty new to Romhacking and wanted to try play around my Firered Romand and now got stuck with my Script :/ It´s at the old Spawnpoint since i moved the Spawn over to the Rival´s house. The script should move the player towards the "rival" and shouldnt let him go out of the room before he picked his starter. Now if I walk on the script the game stops and only the music is playing. Someone see the mistake?:/

    Do you have a var number for the script tile? If you don't, the game freezes.
    Highlight the script tile in Advance map and check if there is something in the var number box.
    If you don't know what vars are, I talked about them in post 569 in this thread.

    EDIT: I have a question of my own for this thread. I wanted to check the double-posting rules before I acted on it.

    Can I use a script to change the picture of a person event? I want to have a man who is in disguise remove his disguse on screen. I'm using PKSV-UI for scripting.
     
    Last edited:

    Sayuri

    人生忘れられた
    276
    Posts
    8
    Years
  • This script is supposed to move an NPC and have my character follow it, but only my character moves while the NPC stays in place.
    Spoiler:


    This is for a Fire Red ROM and I'm using XSE. It worked correctly until I updated it and added a separate character movement.
     

    GoGoJJTech

    (☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
    2,475
    Posts
    11
    Years
  • This script is supposed to move an NPC and have my character follow it, but only my character moves while the NPC stays in place.
    Spoiler:


    This is for a Fire Red ROM and I'm using XSE. It worked correctly until I updated it and added a separate character movement.

    You have this going on:
    Code:
    #org @lookright
    #raw 0x03

    Since you missed the #raw 0xFE, the ROM never stops searching for movements and therefore loads junk, meaning the rest of the movements for that player will either fail or go incorrectly.
     

    Sayuri

    人生忘れられた
    276
    Posts
    8
    Years
  • You have this going on:
    Code:
    #org @lookright
    #raw 0x03

    Since you missed the #raw 0xFE, the ROM never stops searching for movements and therefore loads junk, meaning the rest of the movements for that player will either fail or go incorrectly.

    Ah, thank you! I always overlook little things like that.
     
    81
    Posts
    8
    Years
    • She/her/hers
    • Seen Oct 26, 2023
    I have another question. In a script, is there a way to make the main character do the animation for using the Vs. Seeker?
     
    215
    Posts
    11
    Years
    • Seen Jul 14, 2020
    Is there a script limit for different maps?

    I have this one Route (For the sake of this explanation let's call it Route 1). So on Route 1 in advanced map, we have Route 1 (1.1), Route 1 (1.2) and Route 1 (1.3). Overall I probably have roughly 16 Scripts scattered around these three parts of Route 1. However I just added a new Script to Route 1 (1.3) and now it won't let me enter any parts of Route 1. That doesn't make any sense to me. I triple checked and everything is fine with the script. However once I entered it in, when I tested the game there is no way to enter Route 1 without the game freezing. Also it was odd because I added the script to Route 1 (1.3) and when I enter Route 1 (1.1) It still freezes. The game is still working but once you enter you character can't move.

    Also it's worth noting that I tried just copying one of the scripts that were already in Route 1, and adding that exact same offset didn't affect the game. (So that game still worked if I used the offset 0x800000 twice in Route 1 along with 15 other offsets. However It didn't like me using 17 offsets.)

    Does anyone know what's happening? Is there some type of 16 script limit for each Route? Is there a way past this?
     

    miksy91

    Dark Energy is back in action! ;)
    1,480
    Posts
    15
    Years
  • I have another question. In a script, is there a way to make the main character do the animation for using the Vs. Seeker?
    For both this and your previous question, you need to call an asm routine that writes graphics data to Video Ram. It's not all that difficult to do, but requires a little bit of asm and coding knowledge. The following might work fine, but I can't say for sure;

    1. Check where the graphics data, of the sprite you want to change, is loaded in Video RAM (VBA can show you this).
    2. Make sure that the address in that situation is always the same. If some people events in that map can be hidden and their graphics are thus possibly not loaded, the address may vary. If the address isn't always the same, you have to "adjust" the address based on the situation (= done in asm routine).
    3. Draw a new sprite and put it somewhere in the rom.
    4. Call an asm routine which you tell to copy the graphics data of that new sprite and paste it to the ram address in Video Ram where the graphics you wanted to replace is located.

    This may or may not work. The reason why it might not work properly is related to how graphics data is loaded to Video Ram - you might not be able to write to Video Ram by copy pasting anytime you like to. Wouldn't work in a GB/C game, but could possibly work in GBA.


    For doing the same animation Vs. Seeker does (if I understood your question correctly), just check how it changes the player's sprite. There may be a script related to using Vs. Seeker, or a just a pure asm routine. If it is handled by a script, the script may call asm routines for sprite changing for instance though.
     
    Last edited:
    81
    Posts
    8
    Years
    • She/her/hers
    • Seen Oct 26, 2023
    For both this and your previous question, you need to call an asm routine that writes graphics data to Video Ram. It's not all that difficult to do, but requires a little bit of asm and coding knowledge. The following might work fine, but I can't say for sure;

    1. Check where the graphics data, of the sprite you want to change, is loaded in Video RAM (VBA can show you this).
    2. Make sure that the address in that situation is always the same. If some people events in that map can be hidden and their graphics are thus possibly not loaded, the address may vary. If the address isn't always the same, you have to "adjust" the address based on the situation (= done in asm routine).
    3. Draw a new sprite and put it somewhere in the rom.
    4. Call an asm routine which you tell to copy the graphics data of that new sprite and paste it to the ram address in Video Ram where the graphics you wanted to replace is located.

    This may or may not work. The reason why it might not work properly is related to how graphics data is loaded to Video Ram - you might not be able to write to Video Ram by copy pasting anytime you like to. Wouldn't work in a GB/C game, but could possibly work in GBA.


    For doing the same animation Vs. Seeker does (if I understood your question correctly), just check how it changes the player's sprite. There may be a script related to using Vs. Seeker, or a just a pure asm routine. If it is handled by a script, the script may call asm routines for sprite changing for instance though.

    Thanks a lot! I'll look in to this.
     

    pokefreak890

    The One that will make everything great
    853
    Posts
    9
    Years
    • Seen May 18, 2023
    i was planning on doing the legendary battles in my hack the same way LCCOOLIJ95 did in this hack http://www.pokecommunity.com/showthread.php?t=349258 but everytime i do it i can hear the pokemons cry but then theres this little earthquake that happens and then my game freezes plz help and also the hack i want to make this in is emerald

    this is the script that i was using to do this its meant for a chimecho to spawn just for example
    #dyn 0x740000
    #org @start
    special 0x187
    compare LASTRESULT 2
    if == jump 0x81A7AE0
    special 0x188
    lock
    faceplayer
    checksound
    cry CHIMECHO 2
    waitcry
    pause 0x14
    playsound 0x156 0x0
    battle CHIMECHO 0x70 PETAYABERRY
    setflag 0x807
    special 0x138
    waitspecial
    clearflag 0x807
    special2 0x800D 0xB4
    compare LASTRESULT 1
    if == jump 0x8162558
    compare LASTRESULT 4
    if == jump 0x8162561
    compare LASTRESULT 5
    if == jump 0x8162561
    setflag 0x1211
    release
    end
     
    Last edited by a moderator:
    11
    Posts
    15
    Years
    • Seen Jan 10, 2017
    Hello, I have a question about Emerald. How do I change Steven's battle music back to the Champion theme, and how do I make him re-fightable?

    This is the script that XSE has given me when I click on Steven in Meteor Falls:

    Spoiler:


    Any help would be greatly appreciated.
     
    3,830
    Posts
    14
    Years
    • Age 27
    • OH
    • Seen Feb 26, 2024
    Hello, I have a question about Emerald. How do I change Steven's battle music back to the Champion theme, and how do I make him re-fightable?

    This is the script that XSE has given me when I click on Steven in Meteor Falls:

    Spoiler:


    Any help would be greatly appreciated.

    Trainer battle music is determined by their trainer class, no by the script. In order to give Steven the champion battle theme the easiest thing would be to edit him in a trainer editor and give him the "Champion" trainer class. Making him re-fightable would require you to write a script that makes use of the "settrainerflag" command which allows a trainer's "defeated" flag to be set to false. In addition, it looks like you'll need to clear the flag 0x4F8 in order to make the script play again.
     
    11
    Posts
    15
    Years
    • Seen Jan 10, 2017
    Thanks for the first part, I've been using your Hopeless Trainer Editor to edit trainer parties, and make every battle a double battle. You made that part so incredibly easy to deal with. I just never knew that you could change Steven's music that way. It's literally not posted anywhere on Google.

    As for the second part, all I have to do is delete the flag 0x4F8, and "settrainerflag"? I'm really not sure how to do the "settrainerflag" yet.

    I'm just doing a really minor edit of Emerald for my own amusement. I always had a couple of pet peeves about the game, and your HTE helped me deal with one of them.
     
    11
    Posts
    15
    Years
    • Seen Jan 10, 2017
    Now, about the Steven thing, if I did it like this, would it make Steven re-fightable everytime you talk to him? The bolded line in the spoiler tags is the only thing coming to mind.

    Spoiler:
     
    Last edited:
    5,256
    Posts
    16
    Years
  • Now, about the Steven thing, if I did it like this, would it make Steven re-fightable everytime you talk to him? The bolded line in the spoiler tags is the only thing coming to mind.

    Spoiler:
    Simply removing the flag check altogether would save more space, and in any case you'd need to set his trainer flag again, too, so the actual replacement would look like this:

    Spoiler:
     
    11
    Posts
    15
    Years
    • Seen Jan 10, 2017
    Thank you, you've helped me to deal with the second pet peeve that I had about the game, you and Lost Heart both.

    The first pet peeve was: why did so many trainers have only one Pokemon, that caused me to be really underlevelled when I got to the League everytime I played Emerald? Hopeless Trainer Editor really helped me to deal with that.

    The second was: why did Steven have the wrong battle music and why do I only get to fight him once?
     
    154
    Posts
    9
    Years
    • Seen Jun 23, 2018
    hi guys i am having problem with this script
    Spoiler:

    and after i compile it it canged into
    Spoiler:

    can anyone tell why this is happening is my script has any problem . ??????
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • hi guys i am having problem with this script
    Spoiler:

    and after i compile it it canged into
    Spoiler:

    can anyone tell why this is happening is my script has any problem . ??????

    Have you tried just recompiling it with the actual text overwriting the "glitchy" text? I know I've had this problem before and just decompiling the script and then recompiling with the actual text seemed to work nicely.
     
    Status
    Not open for further replies.
    Back
    Top