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

FSBS

Defunct
147
Posts
8
Years
    • Seen Apr 19, 2019
    I'm trying to make a movement script with a trainer battle attached. I've put two basic scripts together in a way I think would work, but I'd like someone more learned to look at it.
    Spoiler:

    Script is in XSE for Fire Red. I haven't applied any real information to it yet, but the gist is the person says something, comes down four tiles, the player exclaims and jumps once, the battle begins and ends appropriately, the NPC speaks again and turns to leave out of view and disappears.
     
    1
    Posts
    8
    Years
    • Seen Mar 19, 2016
    Hello guys I need help with a script (or two). I am trying to use the movesprite2 and spritebehave commands in Fire Red but they don't seem to work.
    The script for the first sprite is this:
    Spoiler:


    and for the second:

    Spoiler:


    What I need to do is this:
    First the player talks to this sprite and it disappears. When I talk to another sprite (in another map) it should make the first reappear in X:8 Y:6.

    What really happens:
    The first sprite disappears as it should but after I talk to the second sprite, the first reappears as it was set in advance map.
     
    109
    Posts
    8
    Years
    • Seen Apr 2, 2018
    Okay I am now just having trouble understanding variables. Here are my questions
    This is the tutorial I am using (awesome tutorial so far) https://www.pokecommunity.com/showthread.php?t=302347
    1. Are the variables 4000=408A not permanent? Or are some permanent. Like I understand the rock ones (they reset everytime you leave) but like other important events like the starter a player uses 4031. How do you make it permanent where you never run into it again?
    2. If the a value can be "set to" 0x1 does that mean it checks if something is there? What about 0x2 or 0x3 I have NO idea what those do.
    3. (This might no be a variable maybe a flag) How do I make sure the sprite AI I am using doesn't reload the same sprite after I have them leave to another room. For ex. I have a group of 4 sprites in my map when you come in. After they all talk and walk into the next room how do I make sure they don't just reload and do it again after I leave the room and come back?

    Btw I love how helpful you guys ALL are! It is really cool how you guys want to help us beginners and intermediates understand.
     
    Last edited by a moderator:
    109
    Posts
    8
    Years
    • Seen Apr 2, 2018
    Sorry for asking here twice but i dont know what´s wrong with this script:

    Spoiler:


    The teacher asks me if i have a pokemon, then if i want to do something for him, if i say no he repeats the question, then he gives me the pokedex and he deserves luck in my journey. I dont know if its a little failor a big one.
    Nice scripts. Only problem I see is your dynamic 0x80000 yours is missing a 0
    ALSO you can't have two of your dynamics be the same or else it uses the last one set.
     
    794
    Posts
    10
    Years
  • Okay I am now just having trouble understanding variables. Here are my questions
    This is the tutorial I am using (awesome tutorial so far) https://www.pokecommunity.com/showthread.php?t=302347
    1. Are the variables 4000=408A not permanent? Or are some permanent. Like I understand the rock ones (they reset everytime you leave) but like other important events like the starter a player uses 4031. How do you make it permanent where you never run into it again?
    2. If the a value can be "set to" 0x1 does that mean it checks if something is there? What about 0x2 or 0x3 I have NO idea what those do.
    3. (This might no be a variable maybe a flag) How do I make sure the sprite AI I am using doesn't reload the same sprite after I have them leave to another room. For ex. I have a group of 4 sprites in my map when you come in. After they all talk and walk into the next room how do I make sure they don't just reload and do it again after I leave the room and come back?

    Btw I love how helpful you guys ALL are! It is really cool how you guys want to help us beginners and intermediates understand.

    1. vars 0x4000 - 0x400F are temporary in that they're used by some in-game functions.
    vars 0x4010 - 0x401? control the clown sprites, the one that have 240+ sprite no in A-map, though I don't remember exact numbers.
    So starting from 0x4020(actually a bit earlier but whatever) you've got vars that have usually one role in game, as depicted in the tutorial.
    2. You can set a var to hold any value from 0 to 0xFFFF. And yes, they're checked in many places in-game. Think of this like this, if var X = 1 do this event, if X = 2, do another event, etc.
    3. If you want the person sprite to disappear, you've got to assign a flag to that NPC in A-map and if that flag is set, you won't see them.
    Also, vars end at 0x40FF.
     
    109
    Posts
    8
    Years
    • Seen Apr 2, 2018
    Hello guys I need help with a script (or two). I am trying to use the movesprite2 and spritebehave commands in Fire Red but they don't seem to work.
    The script for the first sprite is this:
    Spoiler:


    and for the second:

    Spoiler:


    What I need to do is this:
    First the player talks to this sprite and it disappears. When I talk to another sprite (in another map) it should make the first reappear in X:8 Y:6.

    What really happens:
    The first sprite disappears as it should but after I talk to the second sprite, the first reappears as it was set in advance map.
    I think you are using the same dynamics 0x800000 use freespacefinder to find room.
     

    Kartik_GBA

    POKEHACKER
    6
    Posts
    8
    Years
  • Hello!I am trying to edit the battle with WALLACE.I am basically trying to change WALLACE's name to my friends's name and stop MAY and PROF BIRCH from interfering after the battle has finished.I have edited the script to meet my demands,But the game freezes.. My SCRIPT:-
    Spoiler:

    Please help me to figure out why the game is freezing
     
    9
    Posts
    8
    Years
    • Seen Jul 25, 2020
    here the problem i am facing with the script
    https://postimg.org/image/3l18pks55/


    here is my script
    #dynamic 0x800000

    #org @start
    checkflag 0x828
    if 0x01 goto @done
    showpokepic 0x93 0xA 0x3
    message @1 0x5
    COMPARE 0X800D 0X1
    hidepokepic
    if 0x01 goto @givepokemon
    message @2 0x6
    release
    end

    #org @givepokemon
    hidesprite 0x5
    setflag 0x800
    setvar 0x5001 0x0
    fanfare 0x13E
    waitfanfare
    setflag 0x828
    message @3 0x6
    givepokemon 0x93 0x5 0x0 0x0 0x0 0x0
    message @4 0x5
    COMPARE 0X800D 0x1
    if 0x01 goto @nickname
    closeonkeypress
    COMPARE 0X5001 0X0
    if 0x01 goto @movement
    release
    end

    #org @nickname
    fadescreen 0x1
    special 0x9E
    waitstate
    COMPARE 0X5001 0x0
    if 0x01 goto @movement
    return

    #org @movement
    message @6 0x6
    hidesprite 0x6
    applymovement 0x8 @walk1
    message @7 0x4
    closeonkeypress
    release
    end

    #org @done
    message @5 0x6
    release
    end

    #org @1
    = Do you want dratini?

    #org @2
    = Take your time!

    #org @3
    = You received a dratini

    #org @4
    = Do you want to give it a nickname?

    #org @5
    = i can't take again

    #org @6
    = i will take this then

    #org @7
    = \v\h06 received a Snorunt

    #org @walk1
    #raw 0x13
    #raw 0x13
    #raw 0x0
    #raw 0xFE
     
    92
    Posts
    8
    Years
    • Seen Dec 8, 2022
    How would you compare a variable to a multiple of a certain value?
    For example comparing 0x4045 0x3, 0x6, 0x9, etc.
     

    Ayonn-

    The Unbelivable
    209
    Posts
    9
    Years
  • Hi I'm new at scripting and I've got a problem, when I try to script, after I compiled it, wwhen opening the script again, my scipt disappear, and there's nothing left.... What am I doing wrong ??
     
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    How would you compare a variable to a multiple of a certain value?
    For example comparing 0x4045 0x3, 0x6, 0x9, etc.

    compare 0x4045 0x3
    if 0x1 goto @whatever


    0x1 refers to 0x4045 having an exact value of 0x3, but you can also use these:

    diegoisawesome's XSE tutorial said:
    Lower Than (0x0)
    Equals (0x1)
    Greater Than (0x2)
    Lower than or Equal to (0x3)
    Greater than or Equal to (0x4)
    Not exactly equal to (0x5)

    Hi I'm new at scripting and I've got a problem, when I try to script, after I compiled it, wwhen opening the script again, my scipt disappear, and there's nothing left.... What am I doing wrong ??

    Just to check, you are compiling with the gear button and then copy/pasting the given offset into A-Map. Then when you say opening your script, you mean from 'open script' on your A-Map event?
     

    Ayonn-

    The Unbelivable
    209
    Posts
    9
    Years
  • compare 0x4045 0x3
    if 0x1 goto @whatever


    0x1 refers to 0x4045 having an exact value of 0x3, but you can also use these:





    Just to check, you are compiling with the gear button and then copy/pasting the given offset into A-Map. Then when you say opening your script, you mean from 'open script' on your A-Map event?

    exactly yeah
     
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    @Ayonn

    Are you making sure to save in A-Map? Sounds silly but its a common mistake :c. And definitely compiling to the same ROM as is open in A-Map? ><

    It's a hard problem to diagnose, since its probably the programs rather than your actual script.

    here the problem i am facing with the script
    https://postimg.org/image/3l18pks55/


    here is my script
    Spoiler:

    Hard to say exactly what's going wrong here. Have you tried recompiling, always get the same error? I can't spot anything obviously wrong. You do have some pointless var commands though - setting a variable to zero when it is zero by default and checking that twice in one script :s.

    Hello!I am trying to edit the battle with WALLACE.I am basically trying to change WALLACE's name to my friends's name and stop MAY and PROF BIRCH from interfering after the battle has finished.I have edited the script to meet my demands,But the game freezes.. My SCRIPT:-
    Spoiler:

    Please help me to figure out why the game is freezing

    Judging by what you set out to do, and the fact your offsets are unchanged, you'd expanded the script without repointing it and therefore it is erroring. Try reopening the script and see if it looks as intended, or if its jargon.

    If you're extending a script you neeeed to repoint. Changing a four letter word to a five letter word is enough to break it in some cases.
     
    1
    Posts
    8
    Years
    • Seen Mar 9, 2020
    I am having some troubles with the sprite disappearing mid-script. I dont think that it is any of the commands, but I am not so sure. It is built upon the Pokémon Glazed 7b ROM.

    The sprite disappears pretty much directly after the first msgbox.

    Code:
    Spoiler:


    Opening the complied script from Advanced Map and everything appears to be correct.

    The script event looks like this:
    Spoiler:
     
    Last edited:
    92
    Posts
    8
    Years
    • Seen Dec 8, 2022
    compare 0x4045 0x3
    if 0x1 goto @whatever


    0x1 refers to 0x4045 having an exact value of 0x3, but you can also use these:





    Just to check, you are compiling with the gear button and then copy/pasting the given offset into A-Map. Then when you say opening your script, you mean from 'open script' on your A-Map event?
    Thanks.
     
    3
    Posts
    8
    Years
    • Seen Jul 4, 2019
    I dont have any experience when it comes to scripting, does anyone have an idea how i should start researching this? Every idea will be appreciated!! :)
     
    7
    Posts
    8
    Years
    • Seen Mar 5, 2020
    I know that there is already (sort of) a thread discussing this, but I'm just a new baby!hacker and I was wondering about the "Follow Me" script.

    pokecommunity.com/showthread.php?t=204651

    General consensus seems to be that it's difficult to make a Person event follow you everywhere, but that scripts to make them follow you around a specific map are fairly simple.
    However, I can't seem to find any examples or explanations of how to do that.
    Now I don't mean a script, like the "Oak" script at the beginning of Fire Red, where the Person event and the Player character move without the player's input, but a genuine "Follow Me" script, where the Person event steps into the square where the Player character previously was when the player moves.

    Any information that you can give me would be helpful, because there doesn't seem to be much out there. Thanks.
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • I know that there is already (sort of) a thread discussing this, but I'm just a new baby!hacker and I was wondering about the "Follow Me" script.

    pokecommunity.com/showthread.php?t=204651

    General consensus seems to be that it's difficult to make a Person event follow you everywhere, but that scripts to make them follow you around a specific map are fairly simple.
    However, I can't seem to find any examples or explanations of how to do that.
    Now I don't mean a script, like the "Oak" script at the beginning of Fire Red, where the Person event and the Player character move without the player's input, but a genuine "Follow Me" script, where the Person event steps into the square where the Player character previously was when the player moves.

    Any information that you can give me would be helpful, because there doesn't seem to be much out there. Thanks.

    The consensus is that while it is possible, it is too space consuming to make level scripts do that and the asm follow me that touched made isn't ready for big maps because it doesn't have a way to deal with ledges and warps. But if it's a decently small map without those, then it would be god for that. The stuffs is all on his github in his signature.

    -------------------------------------------------------

    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,
     
    Status
    Not open for further replies.
    Back
    Top