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

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
  • How do I find the var number and unknown for the scripts to work?

    Are we talking script tiles? Or just person events? Unknowns are not necessary (usually 03, but don't tend to have an impact) and the var is whatever variable is going to control your script, if it is a tile. Person events don't need them.

    The var number allows script tiles to run if and only if the var equals the value. The only safe vars are 4000-40FF and the original functions of the ones in the game are listed on the link I gave you last post.
     
    29
    Posts
    11
    Years
    • Seen Mar 13, 2022
    yes, I need them for a script tile, and do not know how to find them based on the script:
    Spoiler:
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • yes, I need them for a script tile, and do not know how to find them based on the script:
    Spoiler:

    Vars are not dependent upon the script. In the settings in A-map, the var will only allow the script to run if var = value. Vars are like variables in math, they can be any number. In this post: http://www.pokecommunity.com/showpost.php?p=6829256&postcount=158 you will find a list of vars already used by the game. Feel free to use any var not listed (between 4000-40FF) or a var for which the event it was used for has been deleted.

    To prevent an event from happening again, just add this as the last line of your script:

    Setvar 0x[var you picked] 0x[not the value you put in A-map]
     
    1
    Posts
    11
    Years
    • Seen Sep 13, 2020
    Game: Ruby
    Type: Level Script

    OK, so how exactly would I make a person event disappear when I enter a level?
    I tried this script but it doesn't work.

    #org @start
    setvar 0x4033 0x1
    checkflag 0x801
    if 0x1 goto @hide
    end

    #org @hide
    hidesprite 0x02
    hidesprite 0x03
    end


    Am I just being stupid and clearly doing something wrong because this code just won't work.
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Game: Ruby
    Type: Level Script

    OK, so how exactly would I make a person event disappear when I enter a level?
    I tried this script but it doesn't work.

    #org @start
    setvar 0x4033 0x1
    checkflag 0x801
    if 0x1 goto @hide
    end

    #org @hide
    hidesprite 0x02
    hidesprite 0x03
    end


    Am I just being stupid and clearly doing something wrong because this code just won't work.

    Sprites will only stay hidden if you set the flag which you put in their person ID in A-map. Otherwise, they will just reappear when you take a step.
     
    29
    Posts
    11
    Years
    • Seen Mar 13, 2022
    I am looking for a forum with details on scripting trades... I have found NO references in diegoisawesome's tutorial, or others... Any help is greatly appreciated...
     
    1
    Posts
    14
    Years
    • Seen Nov 26, 2013
    Game: Firered
    Type: Trainer Battle

    I use special commands 0EC to forbid Bag in trainer battle.
    But I can't select trainer data.
    Please tell me how to read into trainer data.

    #org
    Setvar 0x8004 0x2
    special 0xEC
    end
     
    598
    Posts
    11
    Years
  • Hello, I've been trying to script a small event as a test for something bigger.

    The scenario is, once you walk out of professor Oak's lab after getting your pokemon (FireRed) there are 2 grunts (X and Y). They talk a bit and then battle you individually. After being defeated, the screen fades and they are gone. They should not reappear there at all. However, after inserting the script into the ROM, after walking out of Oak's lab, the script doesn't activate. Then, once walking off of the tile then back onto it, the game crashes but the music is still playing normally.

    Spoiler:


    Here is the script:
    Spoiler:



    If there is anything else that is required to find the error, please tell me! :)
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Hello, I've been trying to script a small event as a test for something bigger.

    The scenario is, once you walk out of professor Oak's lab after getting your pokemon (FireRed) there are 2 grunts (X and Y). They talk a bit and then battle you individually. After being defeated, the screen fades and they are gone. They should not reappear there at all. However, after inserting the script into the ROM, after walking out of Oak's lab, the script doesn't activate. Then, once walking off of the tile then back onto it, the game crashes but the music is still playing normally.

    Spoiler:


    Here is the script:
    Spoiler:



    If there is anything else that is required to find the error, please tell me! :)

    There are quite a few problems with how you've set this out. If you want a script to activate the instant you enter a map then you will have to make it a level script, rather than a green-S tile script which you walk over - Here's a good tutorial to show you how to make one. For future note, when using green-S tile scripts you need to fill in 'Unknown', 'Var number' and occassionally 'Var Value' boxes otherwise you will experience freezes like you have now - diegoisawesome's XSE tutorial can help explain what to do here (Found under the applymovement section).

    Here's your script with some changes in red and an explanation as to why they were changed:

    Spoiler:


    You may also have to put some 'waitmovement 0x0' commands here and there but then again you might not, idk :P

    Hopefully this helped.
     
    598
    Posts
    11
    Years
  • There are quite a few problems with how you've set this out. If you want a script to activate the instant you enter a map then you will have to make it a level script, rather than a green-S tile script which you walk over - Here's a good tutorial to show you how to make one. For future note, when using green-S tile scripts you need to fill in 'Unknown', 'Var number' and occassionally 'Var Value' boxes otherwise you will experience freezes like you have now - diegoisawesome's XSE tutorial can help explain what to do here (Found under the applymovement section).

    Here's your script with some changes in red and an explanation as to why they were changed:

    Spoiler:


    You may also have to put some 'waitmovement 0x0' commands here and there but then again you might not, idk :P

    Hopefully this helped.

    Okay, thank you very much! I will try this out and see if it works! :D Thanks again!
     
    27
    Posts
    11
    Years
  • Hey all, I wrote a script for my starter Pokemon, an Eevee, and when I tested it in my ROM, all that happened was the noise you hear when you click a text box. If someone could help me out, I'd appreciate it. Here's the script:

    Code:
    #dynamic 0x6B09F8
    
    #org @start
    setflag 0x828
    msgbox @1 0x5
    @take
    msgbox @2 0x6
    release
    end
    
    #org @take
    givepokemon 0x133 0x5 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox @3 0x4
    waitfanfare
    closeonkeypress
    setflag 0x828
    msgbox @4 0x5
    compare LASTRESULT 0x1
    if 0x1 gosub @name
    msgbox @5 0x6
    release
    end
    
    #org @name
    call 0x1A74EB
    return
    
    #org @1
    = It's an EEVEE.\nBut it's covered in burns!\pWill you help it?
    
    #org @2
    = That's okay.\pSomeone else will\nprobably take it.
    
    #org @3
    = [black_rs]You received an EEVEE!
    
    #org @4
    = [black_rs]Would you like to give a\nnickname to this little EEVEE?
    
    #org @5
    = That EEVEE is looking\nbetter already[.]
     

    tajaros

    Hi I'm dawg
    855
    Posts
    12
    Years
  • Hey all, I wrote a script for my starter Pokemon, an Eevee, and when I tested it in my ROM, all that happened was the noise you hear when you click a text box. If someone could help me out, I'd appreciate it. Here's the script:

    Code:
    #dynamic 0x6B09F8
    
    #org @start
    setflag 0x828
    msgbox @1 0x5
    @take
    msgbox @2 0x6
    release
    end
    
    #org @take
    givepokemon 0x133 0x5 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox @3 0x4
    waitfanfare
    closeonkeypress
    setflag 0x828
    msgbox @4 0x5
    compare LASTRESULT 0x1
    if 0x1 gosub @name
    msgbox @5 0x6
    release
    end
    
    #org @name
    call 0x1A74EB
    return
    
    #org @1
    = It's an EEVEE.\nBut it's covered in burns!\pWill you help it?
    
    #org @2
    = That's okay.\pSomeone else will\nprobably take it.
    
    #org @3
    = [black_rs]You received an EEVEE!
    
    #org @4
    = [black_rs]Would you like to give a\nnickname to this little EEVEE?
    
    #org @5
    = That EEVEE is looking\nbetter already[.]

    Here I fixed your script I found numerous of errors in your script especially in the first part you didn't even have a decision command to check if the user picked yes or no.

    Also you've placed a release command in your script but it doesn't have any lock command in it. Also the givepokemon command 133 is Eevee's Pokemon No. so you have to convert to 133 to hex, so it will be 85.

    I think that's all there is to it. Here's the fixed script btw.

    Code:
    #dynamic 0x800000
    
    #org @start
    lock
    msgbox @1 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @take
    msgbox @5 0x6
    release
    end
    
    #org @take
    givepokemon 0x85 0x5 0x0 0x0 0x0 0x0
    setflag 0x828
    fanfare 0x13E
    msgbox @2 0x4
    waitfanfare
    closeonkeypress
    msgbox @3 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @nick
    goto @good
    end
    
    #org @nick
    setvar 0x8004 0x0
    call @nickname
    goto @good
    
    #org @nickname
    fadescreen 0x1
    special 0x9E
    waitstate
    return
    
    #org @good
    msgbox @4 0x6
    release
    end
    
    #org @1
    = It's an EEVEE.\nBut it's covered in burns!\pWill you help it?
    
    #org @2
    = [black_rs]You received an EEVEE!
    
    #org @3
    = [black_rs]Would you like to give a\nnickname to this little EEVEE?
    
    #org @4
    = That EEVEE is looking\nbetter already.
    
    #org @5
    = That's okay.\pSomeone else will\nprobably take it.
     
    1
    Posts
    11
    Years
    • Seen May 6, 2013
    Hi, I need help with something, how could I get my character to follow someone (such as the part when you walk into Route one for the first time and he makes you follow him back to his lab in FR/LG)

    Game: Fire Red
    System: XSE/Pokescript, I use both
    Type: Follow script maybe? Idk what to call it.
     
    416
    Posts
    11
    Years
    • Seen Feb 10, 2024
    well its quite simple...
    the character you want to follow has a movment sequence... you just have to copy that movement sequence with your character... only one step behind.

    if character 1 and character 2 are beside eachother face to face... (character one is on the left)
    if character 1s sequence looks like Walk_down walk_down walk_down walk_left
    character 2 can be walk_left walk_down walk_down walk_down walk_left

    notice how character 2 has a step before the setps that character 1 has... that means he should be following... movement commands are simple really.

    you will want to check the players facing most likely... this will tell you weather you are standing above, below, left or right of the character you want to follow, so you know which movements to make to do the following...

    I hope that made since...
    if not here is an example:
    Spoiler:


    This is my example from when (in my hack) the player chooses to catch their own starting pokemon... you talk to Oak, (after he offers you his 3 choices) and he offers you the chance to catch your own starter... you say yes and upon selecting yes this script is run (he walks and the player follows, depending on the players location or which way he is facing oak)
     
    Last edited:
    15
    Posts
    12
    Years
    • Seen Mar 13, 2014
    Game: Pokemon Fire Red
    Editor: XSE 1.1
    Type: Movement Script

    So I've been hacking Fire Red for a few days now with XSE 1.0, and I recently came across a download link for 1.1 (FINALLY) so I started using it because it's less buggy, etc. and whether this is related to my problem or not, I'm not sure, but the script shown below will not do what I want it to do.

    What's supposed to happen:

    Rival's song plays
    Rival says "Wait up"
    Player faces rival
    Rival approaches player
    Rival tells you your pokemon are bad
    Player jumps to the side (looking like rival pushed him)
    Rival walks out the door
    A variable is set so that the script doesn't occur again

    What actually happens:

    Rival's song plays
    Rival says "Wait up"
    Rival DOES NOT approach the player and stays in the same spot
    Text box saying your pokemon are bad still appears
    Player still jumps to the side
    Rival stays in the same old spot
    A variable is set so that the script doesn't occur again

    So my obvious problem is that my applymovement portion of the script is not working.
    The sprite I am trying to move does have the person event #5 as specified in the script, so I'm not sure what the problem is... I have to have 3 of these scripts, and one of them works (they are EXACTLY the same), the other two do not, but I think I may have compiled the first one using XSE 1.0 if that means anything.

    Here is the script itself:
    Spoiler:


    And while I'm at it, how would I make it sound like the rival leaves through the door? Right now he just kinda disappears without a sound (in theory) :P
     
    Last edited:

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Game: Pokemon Fire Red
    Editor: XSE 1.1
    Type: Movement Script

    So I've been hacking Fire Red for a few days now with XSE 1.0, and I recently came across a download link for 1.1 (FINALLY) so I started using it because it's less buggy, etc. and whether this is related to my problem or not, I'm not sure, but the script shown below will not do what I want it to do.

    What's supposed to happen:

    Rival's song plays
    Rival says "Wait up"
    Player faces rival
    Rival approaches player
    Rival tells you your pokemon are bad
    Player jumps to the side (looking like rival pushed him)
    Rival walks out the door
    A variable is set so that the script doesn't occur again

    What actually happens:

    Rival's song plays
    Rival says "Wait up"
    Rival DOES NOT approach the player and stays in the same spot
    Text box saying your pokemon are bad still appears
    Player still jumps to the side
    Rival stays in the same old spot
    A variable is set so that the script doesn't occur again

    So my obvious problem is that my applymovement portion of the script is not working.
    The sprite I am trying to move does have the person event #5 as specified in the script, so I'm not sure what the problem is... I have to have 3 of these scripts, and one of them works (they are EXACTLY the same), the other two do not, but I think I may have compiled the first one using XSE 1.0 if that means anything.

    Here is the script itself:
    Spoiler:


    And while I'm at it, how would I make it sound like the rival leaves through the door? Right now he just kinda disappears without a sound (in theory) :P

    You would need to use the setdoor animation commands and the playsong commands in conjunction with the hide/showsprite commands. Doors are quite fun:p.

    I'm wondering if the problem you are having deals with the raws. Try giving them all their own lines. If you notice, the player's movements are only one raw and those work. So, give it a try. It couldn't hurt.

    Also, check to make sure it deffinaetely is the the person number, not the event number. Here is an img:
    Spoiler:


    I know it is in Spanish, (i don't speak Spanish, so if I can read it, so can you:p) but the number you should be looking at for Gary is "No. de Gente:", which is just under the "Delete Event" button.
     
    15
    Posts
    12
    Years
    • Seen Mar 13, 2014
    You would need to use the setdoor animation commands and the playsong commands in conjunction with the hide/showsprite commands. Doors are quite fun:p.

    I'm wondering if the problem you are having deals with the raws. Try giving them all their own lines. If you notice, the player's movements are only one raw and those work. So, give it a try. It couldn't hurt.

    Also, check to make sure it deffinaetely is the the person number, not the event number. Here is an img:

    I know it is in Spanish, (i don't speak Spanish, so if I can read it, so can you:p) but the number you should be looking at for Gary is "No. de Gente:", which is just under the "Delete Event" button.

    Alright, I tried giving each movement their own #raw, but still no luck unfortunately. I also double checked to make sure I had the right person event no., and I did so I'm not sure what the problem could be! I get the feeling maybe there was a change in the way XSE works with the applymovement command from 1.0-1.1 possibly?
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Alright, I tried giving each movement their own #raw, but still no luck unfortunately. I also double checked to make sure I had the right person event no., and I did so I'm not sure what the problem could be! I get the feeling maybe there was a change in the way XSE works with the applymovement command from 1.0-1.1 possibly?

    Nope, it hasn't changed. Try shifting things around and seeing if it will run the script on a different OW.
     
    Status
    Not open for further replies.
    Back
    Top