• 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,682
Posts
8
Years
    • Seen yesterday
    For my question, I'm having trouble with JPAN's Fire Red Hacked Engine. I'm using his modified special 0x64 (changes your own pokemon's status condition) and it requires me to set the variables 8004 (pokemon slot to change) and 8005 (type of status ailment). No matter what I set 8005 to, it always ends up making the Pokemon fall asleep. I'm trying to get it to be paralyzed but when I set 8005 to 0x6 (the paralysis one), it still puts them to sleep. The script doesn't tell much, but here it is:

    Spoiler:


    P.S if you answer, please quote my post so I get a notification and don't have to come back and check the thread every day or so. Thanks,

    So, special 0x64 is odd with how it uses variable 0x8005.
    These are actually bit flags. So the last two bits are for sleep, third last is poison, etc.
    so, 0x6 in binary is 00000110 or sleep bit 2 and poison.
    You will want 01000000 or 0x40.
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    So I have an ASM that would take a variable's value. Problem is I need to use the [writebytetooffset] command to do it properly instead of [setvar]. It was okay at first until I needed the variable to hold values above 0xFF.

    So how would I do this? [writebytetooffset] on XSE gives me an error when I write values above 0xFF.

    Code:
    ...
    writebytetooffset 0x13C 0x202692A
    ...

    0x202692A in my ASM code is...
    Code:
    ...
    LDR R0, = 0x0201E8C4 + (0x4033 * 2)
    ...
     
    148
    Posts
    17
    Years
    • Age 29
    • Seen yesterday
    So I decided to relocate Moltres in FireRed back to Victory Road, and when I interact with it, it doesn't disappear after defeating it, and when I do defeat it, it just disappears without the "Moltres flew away" text. I compared the scripts with another game and they were exactly the same, and I added the person ID that it had on Mt. Ember. Anybody know what's going on?
     

    Logan

    [img]http://pldh.net/media/pokecons_action/403.gif
    10,417
    Posts
    15
    Years
  • So I decided to relocate Moltres in FireRed back to Victory Road, and when I interact with it, it doesn't disappear after defeating it, and when I do defeat it, it just disappears without the "Moltres flew away" text. I compared the scripts with another game and they were exactly the same, and I added the person ID that it had on Mt. Ember. Anybody know what's going on?
    Can you post the script and a screenshot of the person event in A-Map please.
     
    794
    Posts
    10
    Years
  • So I have an ASM that would take a variable's value. Problem is I need to use the [writebytetooffset] command to do it properly instead of [setvar]. It was okay at first until I needed the variable to hold values above 0xFF.

    So how would I do this? [writebytetooffset] on XSE gives me an error when I write values above 0xFF.

    Code:
    ...
    writebytetooffset 0x13C 0x202692A
    ...
    0x202692A in my ASM code is...
    Code:
    ...
    LDR R0, = 0x0201E8C4 + (0x4033 * 2)
    ...

    Values past 0xFF are two bytes, that's why XSE doesn't compile the code. I also don't understand what you're trying to do. You want to put a number to a chosen location in the ram? If so, you could do
    setvar 0x8004 value
    and then call asm like this
    ldr r0, var_0x8004
    ldrh r0, [r0]
    ldr1, place_to_store
    strh r0, [r1]
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    Values past 0xFF are two bytes, that's why XSE doesn't compile the code. I also don't understand what you're trying to do. You want to put a number to a chosen location in the ram? If so, you could do
    setvar 0x8004 value
    and then call asm like this
    ldr r0, var_0x8004
    ldrh r0, [r0]
    ldr1, place_to_store
    strh r0, [r1]

    Actually, we can easily use [setvar 0x4033 0x13C], where it's all past 0xFF. It's just that [writebytetooffset] doesn't work with it.

    Anyway, I'm trying to avoid using those variables from 0x8000 to 0x80?? hence why I decided to use 0x4033. Problem I've dealt is that simply using [setvar 0x4033 0x13C] doesn't work.
     
    794
    Posts
    10
    Years
  • Actually, we can easily use [setvar 0x4033 0x13C], where it's all past 0xFF. It's just that [writebytetooffset] doesn't work with it.

    Anyway, I'm trying to avoid using those variables from 0x8000 to 0x80?? hence why I decided to use 0x4033. Problem I've dealt is that simply using [setvar 0x4033 0x13C] doesn't work.

    Yeah we can because setvar is designed to work with hwords, but
    How doesn't setvar work?
     
    148
    Posts
    17
    Years
    • Age 29
    • Seen yesterday
    Can you post the script and a screenshot of the person event in A-Map please.
    Yeah, sure. Again, all I did was copy the offset for the script from Mt Moon and put it in Victory Road, along with the person ID.
    Spoiler:


    Script Help Thread
    [/URL][/IMG]
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • Trying to wrap my head around another one of JPAN's new specials, the change pokeball one (special 0x14). I'm pretty positive it reads the position of the pokemon you wanna change through var 8004 but when I put it in my script it doesn't seem to register. I also use the decrypt/encrypt commands so it should work but for some reason it only affects certain pokemon in the party and not the others. My example script is below:

    Spoiler:


    So it should change the pokemon that i select into a masterball, but I feel like I'm missing something?
     
    12
    Posts
    8
    Years
    • Seen Mar 19, 2017
    [Fire Red] Hello everyone, I was wondering if there was a script to completely wipe a player's inventory. Pokeballs, items, moves, etc.
     
    17
    Posts
    8
    Years
    • Seen Jul 23, 2022
    I'm hacking emerald, and I'm trying to create a script that executes when the player exits a house. I tried putting a script event right outside the door, but it doesn't execute upon leaving the house. Then I tried making a map script that executes upon entering the map, but now I'm just getting a black screen upon exiting the house.

    I looked at other map scripts in the game, and none of them seem to include movements or msgboxes, which might explain why mine isn't working right. I could probably fix this problem by editing my map and forcing the player to step on a script event, but I'd rather not do that if I don't have to. Anybody know what's going on?

    EDIT: While I'm at it, I wonder if anybody can help me with this problem: I want a scene in my game where the player is fishing in one place, free to cast their line whenever they want but restricted from moving away, and I want to continue with another script after catching a single pokemon. I'm not sure how to go about this. How can I create a script that executes upon exiting a wild battle?
     
    Last edited:

    Tapan681

    RiverDream
    66
    Posts
    8
    Years
  • HELP
    I a new to scripting.I will try hard to explain my problem in an easy way. So, with the help of xse, i created a simple "hello" script,compiled and added to a sprite. Now, I created a 2nd script which is give pokemon, It was complied and was added to rom. But on adding the script to sprite, the sprite will say the hello script not the give pokemon one. I tried again on a different sprite,still no sucess. I also change the offsets, but still no help. Also, on clicking the "view script" button in a-map, it will show the working of hello script, no matter how many offsets I changed. Pls help
     
    Last edited by a moderator:
    3
    Posts
    11
    Years
  • Hello, I just got into hacking again. (Been a while since last time, I'm smarter and stuffs...) Anyway, I am trying to make a script that checks if a flag is set, and if it's not, makes the player step back with a message box. All it does, however, is softlock the game.

    Spoiler:


    I don't know exactly what's wrong, and I've even used a clean version of the rom and recompiled.
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    Hello, I just got into hacking again. (Been a while since last time, I'm smarter and stuffs...) Anyway, I am trying to make a script that checks if a flag is set, and if it's not, makes the player step back with a message box. All it does, however, is softlock the game.

    Spoiler:


    I don't know exactly what's wrong, and I've even used a clean version of the rom and recompiled.

    Is this on a script tile? Did you remember to set it up?
    diegoisawesome said:
    Didn't work, did it? Froze on the spot. You're going to need to change this...

    Script Help Thread


    to this....

    Script Help Thread


    Try it now. Worked perfectly, didn't it?
     
    3
    Posts
    11
    Years
  • Is this on a script tile? Did you remember to set it up?

    It is. I know that the flag i'm checking is cleared when prof. Oak takes you to his lab. That may be the problem, now that i'm thinking about it. I'll change it to another and see if it works then.
    PLEASE DISREGARD WHAT I SAID.
    It worked perfectly. Thank you for your help, I just couldn't see the pictures on my phone.
     
    Last edited:
    19
    Posts
    8
    Years
  • Hi, I needed help with making a new starting script. (You know, the one where you get your Pokemon and all that!)

    I tried everything, I'm new to scripting and I don't really understand applymovement and all that stuff.
     

    Tapan681

    RiverDream
    66
    Posts
    8
    Years
  • I am facing problems with my level script. All works fine but the 2nd string does not work.can u help figure out the problem?
    Spoiler:
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    I am facing problems with my level script. All works fine but the 2nd string does not work.can u help figure out the problem?
    Spoiler:

    Fix in red.
     
    Status
    Not open for further replies.
    Back
    Top