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

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
    • Seen Dec 23, 2023
    Okay, thanks. The trainer battle worked, but the applymovement not. Did you know why? I try using the waitmovement 0x0, but nothing changed

    The NPC is probably too far away from the player.
    Spoiler:

    As you can see, for applymovements to work on NPCs, they have to be 7 to 9 tiles away from the player's X axis, or 5 to 7 tiles away from the player's Y axis.
     
    23
    Posts
    10
    Years
    • Seen Jun 17, 2023
    The NPC is probably too far away from the player.
    Spoiler:

    As you can see, for applymovements to work on NPCs, they have to be 7 to 9 tiles away from the player's X axis, or 5 to 7 tiles away from the player's Y axis.

    Thanks! This was the problem.
     
    794
    Posts
    10
    Years
  • So I've now begun work on learning to create givepokemon scripts that includes a Yes/No box. For some reason, the following script isn't working properly. I tried fixing it by changing to an unused flag, but with no success. The script is optimized for FireRed. Here it is:

    Spoiler:


    It always keeps assuming that the flag is set and goes right to @screwoff. (I've found and tried using several safe flags that aren't used according to the documentation linked on SphIce's post)

    NOTE: I'm using a downloaded savefile for testing, so maybe the flag is indeed set. But I figured that it would be good to get the script checked here anyway.

    So I compiled your script and there are some things I'd like to tell you.
    First, the script works fine. Test it on a clean rom and you'll see the flag is not set.
    Second, what's with the [/spoiler] thing? It's the first time I see it and it doesn't do anything in-game.
    The last thing, change the give nickname part of the code. You don't check whether the player has place for a new Pokemon and that can cause trouble. Basically, test the script with and without a full team and try to name it. You'll see what I mean. How to fix that? See xse scripting tutorial, it's at the bottom.
     
    959
    Posts
    11
    Years
  • So I compiled your script and there are some things I'd like to tell you.
    First, the script works fine. Test it on a clean rom and you'll see the flag is not set.
    Second, what's with the [/spoiler] thing? It's the first time I see it and it doesn't do anything in-game.
    The last thing, change the give nickname part of the code. You don't check whether the player has place for a new Pokemon and that can cause trouble. Basically, test the script with and without a full team and try to name it. You'll see what I mean. How to fix that? See xse scripting tutorial, it's at the bottom.

    Thank you for testing the script! By [/spoiler] you mean [black_fr]? I was following a tutorial on scripting and it supposedly changes the color to black. As for checking for room, I couldn't find the tutorial you were referring to, so I'm trying to fix it by adding a countpokemon command at @getmon and will test on a new ROM. Here's the new script:

    Spoiler:


    EDIT: The script now checks for room, but nicknames the wrong Pokemon (the one in the left slot of the party) so it turns out I was following a sample script on getting and naming the first/starter Pokemon.

    YET ANOTHER EDIT: There! now the script works properly and nicknames the received Pokemon! Credits to Butterslave for the givepokemon tutorial :)
    Spoiler:
     
    Last edited:
    232
    Posts
    13
    Years
    • Seen Sep 10, 2019
    Hi guys, I'm trying to create a legendary battle with mew by altering the mewtwo script in fire red. I'm trying change the cry and in-battle appearance to mew and also its level to 30. I am using XSE to save the mewtwo script as a .rbc file and altering it through notepad. Here is the script for mewtwo:

    Spoiler:


    From what I know, I am supposed to change the 0x96 in cry to 0x97 (mew?) , the 0x96 and 0x46 in wildbattle to 0x97 and 0x1E (level 30?) respectively. What else do I have to do in order for this to work? I've already tried what I just said, but after compiling the altered script and giving the script to a new sprite ingame, I do not get the results I want. Instead the text glitches out when speaking to the sprite and the game doesn't allow any other input afterwards. I've also tried changing the setflag 0x2BC at the bottom of section #org 0x1624F5 of the script to setflag 0x1201. One last thing, is there a flag to make the mew obey?
     
    Last edited by a moderator:
    23
    Posts
    10
    Years
    • Seen Jun 17, 2023
    Spoiler:


    These scripts are bugging my head. Really.
    Okay, the script at the start worked very well, but after I put another trainer in the map the script stopped working.

    Here is an image of the error:
    Spoiler:
     
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    Spoiler:


    These scripts are bugging my head. Really.
    Okay, the script at the start worked very well, but after I put another trainer in the map the script stopped working.

    Here is an image of the error:
    Spoiler:

    You're using very low offsets, are you sure this is in free space? Not sure what the problem could be other than some scripts clashing or you editing and recompiling over something important? :(

    #dynamic 0x800000 at the start of your scripts, then just use @pointers and let XSE do the searching for you.
     
    23
    Posts
    10
    Years
    • Seen Jun 17, 2023
    You're using very low offsets, are you sure this is in free space? Not sure what the problem could be other than some scripts clashing or you editing and recompiling over something important? :(

    #dynamic 0x800000 at the start of your scripts, then just use @pointers and let XSE do the searching for you.
    :(
    This wasn't the problem.
    D:
     
    5,256
    Posts
    16
    Years
  • Spoiler:


    These scripts are bugging my head. Really.
    Okay, the script at the start worked very well, but after I put another trainer in the map the script stopped working.

    Here is an image of the error:
    Spoiler:
    The first command for trainerbattle scripts that are activated by the player walking into their view radius should be the trainerbattle command.

    It's also worth noting the string you're using has a space before \n, which is just a waste of space.
     
    23
    Posts
    10
    Years
    • Seen Jun 17, 2023
    The first command for trainerbattle scripts that are activated by the player walking into their view radius should be the trainerbattle command.

    It's also worth noting the string you're using has a space before \n, which is just a waste of space.

    Thanks!
    Wow.
    You are helping me a lot. Is there anything I can do for you?
     
    959
    Posts
    11
    Years
  • Alright, now we're onto wildbattle scripts! :)

    I've written up a regular encounter against a lv5 Rayquaza without changes to the default music or anything, just to see if I can get a battle to work. Everything goes relatively smoothly until after the encounter, where the screen goes completely black when the sprite is supposed to disappear:
    Spoiler:


    Swapping the fade bytes around (ie. 0x0 to 0x1 and 0x1 to 0x0) results in some pretty hilarious mishaps:
     

    C me

    Creator of Pokemon League Of Legends
    681
    Posts
    10
    Years
    • Seen Apr 9, 2021
    I was wondering how to do a counter battle script. For example in normal scripting it would be this:

    Spoiler:


    (I know I missed out end and stuff)

    Is this possible in a battle script? Have a var you can write to which resets after the battle.

    Thanks
     
    325
    Posts
    10
    Years
  • I was wondering how to do a counter battle script. For example in normal scripting it would be this:

    Spoiler:


    (I know I missed out end and stuff)

    Is this possible in a battle script? Have a var you can write to which resets after the battle.

    Thanks
    You mean a battle script, like Pokémon moves, or do you mean regular scripts?
    If you mean regular scripts, then yeah. I wouldn't use x800D though, as that gets overwritten constantly.
     

    C me

    Creator of Pokemon League Of Legends
    681
    Posts
    10
    Years
    • Seen Apr 9, 2021
    You mean a battle script, like Pokémon moves, or do you mean regular scripts?
    If you mean regular scripts, then yeah. I wouldn't use x800D though, as that gets overwritten constantly.

    I mean as in move effects, I just used 0x800D as an example to show what I mean by a counter script.
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • This is an odd one I just noticed. Whenever I try to create a new level script by pressing the "Add" Button under Headers it creates a new script but when I set that new script to be 0x2, it suddenly links itself to a level script on another map. And I've tried this with other maps that I haven't touched (adding a new level script and setting it to 0x2) and they all link to the same level script on another map.

    And by link, I mean if I try to change the script offset or the flag value or anything on one map, it'll do the same to the other. And since I need separate level scripts for both maps, this is kind of a toughie.

    Was there anything I did wrong? Is it an easy fix?
     

    Danny0317

    Fluorite's back, brah
    1,067
    Posts
    10
    Years
    • Age 24
    • Seen Nov 19, 2023
    This is an odd one I just noticed. Whenever I try to create a new level script by pressing the "Add" Button under Headers it creates a new script but when I set that new script to be 0x2, it suddenly links itself to a level script on another map. And I've tried this with other maps that I haven't touched (adding a new level script and setting it to 0x2) and they all link to the same level script on another map.

    And by link, I mean if I try to change the script offset or the flag value or anything on one map, it'll do the same to the other. And since I need separate level scripts for both maps, this is kind of a toughie.

    Was there anything I did wrong? Is it an easy fix?
    Try repointing the level scripts for one of the maps.
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • Try repointing the level scripts for one of the maps.

    At the risk of sounding like a total noob nugget, how do i repoint the level script for one of the maps? As soon as I make the new map's level script to type 0x2, it automatically fills in the information from the other map's level script. And then trying to change the offset that was filled in will change the offset that is in the original map as well.
     

    Danny0317

    Fluorite's back, brah
    1,067
    Posts
    10
    Years
    • Age 24
    • Seen Nov 19, 2023
    At the risk of sounding like a total noob nugget, how do i repoint the level script for one of the maps? As soon as I make the new map's level script to type 0x2, it automatically fills in the information from the other map's level script. And then trying to change the offset that was filled in will change the offset that is in the original map as well.

    I'd go on fsf, get a free offset, go to the professional header view on one of the maps, and change it.
     
    959
    Posts
    11
    Years
  • When editing a very long script in a game, would it be viable to add any stuff that you want to implement and leave the rest as is? For example, I would like to have Wallace's dialogue and team change in Emerald after the first Hall of Fame; (similar to the newer games) however, it turns out that the script for the champ battle is over 300 lines long and would take ages to replicate, unlike the E4 scripts. Here's the dump from the ROM
    Spoiler:

    My plan is to insert a check for 0x87F (the HoF flag), redirect to the new "before battle" msgbox and team, then go back to the regular script events. Everything else will be kept untouched. Of course, dynamic and freespace will be put on top to prevent overwriting or corrupting anything. And as usual, help is greatly appreciated!
     
    27
    Posts
    9
    Years
    • Seen today
    I am attempting to make a script that makes Oak give you the national dex after you fight your rival before you leave his lab. I have the movement working that brings you front and center to Oak but nothing continues after that. Thanks for any help.
    Spoiler:
     
    Status
    Not open for further replies.
    Back
    Top