• 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.
949
Posts
11
Years
  • FSF is not giving you a 800000+ because there is random free space of different size in many parts of the ROM but the safest and largest free space start at 0x720000 iirc, in FireRed that is. You can specify to FSF the offset where it should start searching from. But you don't need FSF when using XSE.
    For a market script I advice you to use an original mart script as a base. There are specials u need to call in the script, especially if TMs are in that mart.
     
    39
    Posts
    10
    Years
  • Rom : Fire Red

    I want to dont let the player leave the house without talking to mom or pc(flag 0x1001 and flag 0x1000) or if you didnt pick up 1,2 or 3 items (flag 0x1002,0x1003,0x1004) but when i use it the game freezes...
    (sorry for bad english).

    Spoiler:
     
    Last edited:

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • Rom : Fire Red

    I want to dont let the player leave the house without talking to mom or pc(flag 0x1001 and flag 0x1000) or if you didnt pick up 1,2 or 3 items (flag 0x1002,0x1003,0x1004) but when i use it the game freezes...
    (sorry for bad english).

    Spoiler:

    For one, you forgot the "lock" command at the beginning of your script.

    Number two, I'd like to point you to this thread (https://www.pokecommunity.com/showthread.php?t=302347) and go to the "script tile" part and if you haven't, read it. it usually solves a lot of problems with script tiles not working right.
     
    39
    Posts
    10
    Years
  • i changed to
    Spoiler:


    but still not working...

    nevermind, im new. if anyone could help me with this script i would really appreciate
     
    3
    Posts
    10
    Years
  • i changed to
    Spoiler:


    but still not working...

    nevermind, im new. if anyone could help me with this script i would really appreciate

    To make the script look more natural, you should put
    Code:
    faceplayer
    after
    Code:
    lock
    Replace all your
    Code:
    waitmovement 0xFF
    by
    Code:
    waitmovement 0x0
    , that's how it always goes. The rest of it seems ok.

    I'd suggest having a look here: pokecommunity.com/showthread.php?t=279345, he covers all the basic stuff you need to know :)
     
    949
    Posts
    11
    Years
  • @pointeroo, the only flags save to use in FireRed are flags between 0x200 and 0x2FF, inclusive. There are a few others safe to use but you should read the thread Tah Blazer linked you!
    The flags you are using in your script are not safe to use at all. So, do something like this:
    Code:
    #dynamic 0x2DE228
    
    #org @start
    lock
    setvar 0x4050 0x2
    checkflag [B]0x200[/B]
    if 0x0 goto @back
    checkflag [B]0x201[/B]
    if 0x0 goto @back
    checkflag [B]0x202[/B]
    if 0x0 goto @back1
    checkflag [B]0x203[/B]
    if 0x0 goto @back1
    checkflag 0x204[B][/B]
    if 0x0 goto @back1
    release
    end
    
    #org @back
    applymovement 0xFF @move
    [B]waitmovement 0x0[/B] [SIZE="2"](Why are you using waitmovement 0xFF? o.o)[/SIZE]
    msgbox @1 0x6
    release
    end
    
    #org @back1
    applymovement 0xFF @move
    [B]waitmovement 0x0[/B]
    msgbox @2 0x6
    release
    end
    
    #org @1
    = You cant go out!\nTalk to your Mom.
    
    #org @2
    = You forgot your items.\n Go back to take them.
    
    #org @move
    #raw 0x11
    #raw 0xFE
    Note: The flags I used to correct your script are used in some of the original game's events, so if you're keeping some original event untouched, use flags of events you removed.
     
    55
    Posts
    10
    Years
    • Seen Oct 18, 2014
    I've edited this script. Now when I put "0xFFFF" I'm referring to the flag, I think. Here's the script:

    #dynamic 0x800000

    #org @start
    lock
    faceplayer
    checkflag 0xFFFF
    if 0x1 goto @finished
    msgbox @1 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba
    msgbox @no 0x6
    release
    end

    #org @finished
    msgbox @already_recieved 0x6
    release
    end

    #org @bulba
    msgbox@bulba_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba_yes
    goto @char

    #org @char
    msgbox@char_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @char_yes
    goto @squir

    #org @squir
    msgbox @squir_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba

    #org @bulba_yes
    compare 0xFFFF 0x1
    if 0x0 goto @not_bulba
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_bulba

    #org @not_bulba
    msgbox @bulbanotstarter 0x6
    release
    end

    #org @bulbanotstarter
    = Wait! I don't think you chose Bulbasaur. I have no time for liars!

    #org @enjoy_bulba
    = Enjoy that Venusaurite!

    #org @char_yes
    compare 0xFFFF 0x1
    if 0x0 goto @not_char
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_char

    #org @not_char
    msgbox @charnotstarter 0x6
    release
    end

    #org @charnotstarter
    = Wait! I don't think you chose Charmander. I have no time for liars!

    #org @enjoy_char
    = Enjoy that Charizardite!

    #org @squir_yes
    compare 0xFFFF 0x1
    if 0x0 goto @not_squir
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_squir

    #org @not_squir
    msgbox @squirnotstarter 0x6
    release
    end

    #org @squirnotstarter
    = Wait! I don't think you chose Squirtle. I have no time for liars!

    #org @enjoy_squir
    = Enjoy that Blastoisite!

    #org @already_recieved
    = I already gave you your item! Go away!

    Can anybody tell me if this all adds up? I wanna know if this will work this time.
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • I've edited this script. Now when I put "0xFFFF" I'm referring to the flag, I think. Here's the script:



    Can anybody tell me if this all adds up? I wanna know if this will work this time.

    The best way to see if your script adds up is to compile it into XSE and if XSE says you have an error, then you must have done something wrong. A preliminary method before you even do that would be going through the script in your eyes and making sure everything is in check. For instance, can you access the other parts of the script like the charmander part or the squirtle part? Did you make sure to include the "release" and "end" command so once you finish the character isn't still locked in the same position when the script ends?

    A few things are missing, such as the message string for "msgbox @1 0x5" and "msgbox @no 0x6" so the game won't even have a message to point to.
    I also noticed you checked for the same variable when checking if the player was lying or not. You have to make the variables different to correlate to the different pokemon because then the game wouldn't know if you were lying or not. If all three starters were assigned the value 0x1, then there would be no way to tell the difference between them.
    The messageboxes for the enjoy_[starter] all are missing the 0x(something) at the end of them.
    And you forgot to set the flag that you checked for in the beginning so the player could loop the script as much times as they wanted for infinite Mega stones.
    Lastly, at the end of all of your "#org @[starter]_yes", you forgot to put the "release" and "end" commands to tell the game the script was finished.

    All in all, these are just small things you could pick up if you tried to compile it in XSE since it'll tell you what you're missing. Don't be afraid to compile and test it out in-game, that's the only way to make sure your script works.
     
    55
    Posts
    10
    Years
    • Seen Oct 18, 2014
    I also noticed you checked for the same variable when checking if the player was lying or not. You have to make the variables different to correlate to the different pokemon because then the game wouldn't know if you were lying or not. If all three starters were assigned the value 0x1, then there would be no way to tell the difference between them.
    The messageboxes for the enjoy_[starter] all are missing the 0x(something) at the end of them.
    And you forgot to set the flag that you checked for in the beginning so the player could loop the script as much times as they wanted for infinite Mega stones.

    Unfortunately, I won't be able to test it out for a few hours, cause I have high school golf practice to go to. So I have some questions so that I can fix it right now.
    1) What exactly is the variable check? Is it "compare 0xFFFF 0x1" (basically any 4-digit number)? If so, then do I change the 0xFFFF or the 0x1? I've also noticed that there is a "compare 0x800D 0x1" command. I'm still confused on variables, but could you tell me which is the variable?

    2) Here's the opening:
    #org @start
    lock
    faceplayer
    checkflag 0xFFFF
    if 0x1 goto @finished
    msgbox @yes 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba
    msgbox @no 0x6
    setflag 0xFFFF
    release
    end
    Did I place the "setflag" correctly?

    3)When you mentioned the "0x(something)" after the "enjoy_[starter]," do I just place a random UNUSED number or a certain variable?
     
    55
    Posts
    10
    Years
    • Seen Oct 18, 2014
    My script doesn't work. It won't even read the first question. Can somebody help me out?
    #dynamic 0x800000

    #org @start
    lock
    faceplayer
    checkflag 0xFFFF
    if 0x1 goto @finished
    msgbox @yes 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba
    msgbox @no 0x6
    set flag 0xFFFF
    release
    end

    #org @finished
    msgbox @already_recieved 0x6
    release
    end

    #org @bulba
    msgbox@bulba_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba_yes
    goto @char

    #org @char
    msgbox@char_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @char_yes
    goto @squir

    #org @squir
    msgbox @squir_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba

    #org @bulba_yes
    compare 0xFFFF 0x1
    if 0x0 goto @not_bulba
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_bulba
    release
    end

    #org @not_bulba
    msgbox @bulbanotstarter 0x6
    release
    end

    #org @bulbanotstarter
    = Wait! I don't think you chose Bulbasaur. I have no time for liars!

    #org @enjoy_bulba
    = Enjoy that Venusaurite!

    #org @char_yes
    compare 0xFFFF 0x1
    if 0x0 goto @not_char
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_char
    release
    end

    #org @not_char
    msgbox @charnotstarter 0x6
    release
    end

    #org @charnotstarter
    = Wait! I don't think you chose Charmander. I have no time for liars!

    #org @enjoy_char
    = Enjoy that Charizardite!

    #org @squir_yes
    compare 0xFFFF 0x1
    if 0x0 goto @not_squir
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_squir
    release
    end

    #org @not_squir
    msgbox @squirnotstarter 0x6
    release
    end

    #org @squirnotstarter
    = Wait! I don't think you chose Squirtle. I have no time for liars!

    #org @enjoy_squir
    = Enjoy that Blastoisite!

    #org @already_recieved
    = I already gave you your item! Go away!

    #org @yes
    = Can I check your starter?

    #org @no
    = Why won't you let me check your starter?

    I decompiled it, saved it, and opened up the ROM. But nothing happened. The sprite is Max (Ruby), so I don't know if that would have some odd effect, which it shouldn't. All I hear is the little ping, and Max turns to face me. No words are spoken. Not even a text box pops up. Help?
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • Unfortunately, I won't be able to test it out for a few hours, cause I have high school golf practice to go to. So I have some questions so that I can fix it right now.
    1) What exactly is the variable check? Is it "compare 0xFFFF 0x1" (basically any 4-digit number)? If so, then do I change the 0xFFFF or the 0x1? I've also noticed that there is a "compare 0x800D 0x1" command. I'm still confused on variables, but could you tell me which is the variable?

    2) Here's the opening:

    Did I place the "setflag" correctly?

    3)When you mentioned the "0x(something)" after the "enjoy_[starter]," do I just place a random UNUSED number or a certain variable?

    1) Well the variable check I meant was the variable you set when you obtain your starter Pokemon. I meant when you got your Pokemon, you set a variable unique to that pokemon (so you're assigning a variable that number). Think of it like this, the variable is a pot and the number you're assigning it is the pebbles inside. When you give a variable a number, you're putting pebbles into your pot. As for the "compare 0x800D 0x1" thing, when you press yes or no the game assigns either 0 or 1 pebbles to the pot and what you're doing there is comparing whether or not the game has given "0x1" pebbles to the "0x800D" pot.

    2) You're gonna want to place the setflag at the end of the script. If you did it right where you placed the setflag currently, you could still loop for infinite mega stones as the setflag command is only triggered once you say no to the initial question. You're gonna want to place a setflag at the end of the scripts where you give the mega stone to the player, one each for the bulbasaur, charmander, and squirtle.

    3) Nono, I meant that the line: "msgbox @enjoy_bulba" was missing an 0x6 after it, like a normal textbox thing. You're also missing one for the same ones in the charmander and squirtle lines.

    4) This is regarding your new post. Just to make sure, the "checkflag 0xFFFF" isn't actually 0xFFFF but a real flag, right? Could you post your current script pre-inserted?
     
    55
    Posts
    10
    Years
    • Seen Oct 18, 2014
    1) Well the variable check I meant was the variable you set when you obtain your starter Pokemon. I meant when you got your Pokemon, you set a variable unique to that pokemon (so you're assigning a variable that number). Think of it like this, the variable is a pot and the number you're assigning it is the pebbles inside. When you give a variable a number, you're putting pebbles into your pot. As for the "compare 0x800D 0x1" thing, when you press yes or no the game assigns either 0 or 1 pebbles to the pot and what you're doing there is comparing whether or not the game has given "0x1" pebbles to the "0x800D" pot.

    2) You're gonna want to place the setflag at the end of the script. If you did it right where you placed the setflag currently, you could still loop for infinite mega stones as the setflag command is only triggered once you say no to the initial question. You're gonna want to place a setflag at the end of the scripts where you give the mega stone to the player, one each for the bulbasaur, charmander, and squirtle.

    3) Nono, I meant that the line: "msgbox @enjoy_bulba" was missing an 0x6 after it, like a normal textbox thing. You're also missing one for the same ones in the charmander and squirtle lines.

    4) This is regarding your new post. Just to make sure, the "checkflag 0xFFFF" isn't actually 0xFFFF but a real flag, right? Could you post your current script pre-inserted?

    Well here's what I have so far:
    #dynamic 0x800000

    #org @start
    lock
    faceplayer
    checkflag 0xFFFF
    if 0x1 goto @finished
    msgbox @yes 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba
    msgbox @no 0x6
    set flag 0xFFFF
    release
    end

    #org @finished
    msgbox @already_recieved 0x6
    release
    end

    #org @bulba
    msgbox@bulba_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba_yes
    goto @char

    #org @char
    msgbox@char_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @char_yes
    goto @squir

    #org @squir
    msgbox @squir_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba

    #org @bulba_yes
    compare 0x4011 0x1
    if 0x0 goto @not_bulba
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_bulba 0x6
    release
    end

    #org @not_bulba
    msgbox @bulbanotstarter 0x6
    release
    end

    #org @bulbanotstarter
    = Wait! I don't think you chose Bulbasaur. I have no time for liars!

    #org @enjoy_bulba
    = Enjoy that Venusaurite!

    #org @char_yes
    compare 0x4012 0x1
    if 0x0 goto @not_char
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_char 0x6
    release
    end

    #org @not_char
    msgbox @charnotstarter 0x6
    release
    end

    #org @charnotstarter
    = Wait! I don't think you chose Charmander. I have no time for liars!

    #org @enjoy_char
    = Enjoy that Charizardite!

    #org @squir_yes
    compare 0x4013 0x1
    if 0x0 goto @not_squir
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_squir 0x6
    release
    end

    #org @not_squir
    msgbox @squirnotstarter 0x6
    release
    end

    #org @squirnotstarter
    = Wait! I don't think you chose Squirtle. I have no time for liars!

    #org @enjoy_squir
    = Enjoy that Blastoisite!

    #org @already_recieved
    = I already gave you your item! Go away!

    #org @yes
    = Can I check your starter?

    #org @no
    = Why won't you let me check your starter?

    If I did this correctly, then when I give the setvar command to the starters, this should work properly. I hope. I still haven't figured out which items I'm replacing however. Once I do, those [FFFF item]'s will be gone. Now for the variables, I used "compare 0x4011 0x1" for Bulbasaur, 0x4012 for Charmander, and 0x4013 for Squirtle.
     
    949
    Posts
    11
    Years
  • The amount of safe variables one can use is extremely limited. Either use one variable that contains either 1, 2 or 3 depending on the chosen starter, or use 3 different flags instead of 3 different values. You are wasting 3 variables in 1 tiny script.
     
    55
    Posts
    10
    Years
    • Seen Oct 18, 2014
    The amount of safe variables one can use is extremely limited. Either use one variable that contains either 1, 2 or 3 depending on the chosen starter, or use 3 different flags instead of 3 different values. You are wasting 3 variables in 1 tiny script.

    So then what do I do for flags? I don't really know what the set up for that is. Can you take a chunk from my script and make it correct with flags?
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • So then what do I do for flags? I don't really know what the set up for that is. Can you take a chunk from my script and make it correct with flags?

    You can use either flags or variables, but I just have come to love variables because of how easily usable they are and because I like saving flags for OWs. If you wanted to use flags, you'd have to set a flag when you received the pokemon, however the flags must be different from each other.

    In other words:
    Flags- Set a flag during the script when you got the pokemon and then check for that flag later on in this script instead of comparing variables. These all have to be different flags from eachother as flags only have an "on" and "off" value to them.
    Variables- Set a number to a variable during the script when you got the pokemon and then check for that number later on in the script. This is slightly harder as the concept is more abstract, but you're basically assigning value to a certain area (the area is the first part of the "setvar" command and the number you're giving it is the second part of the "setvar" command)

    And you still haven't moved the setflag (not "set flag" like you have in your script, it has to be one word) to after the player is given the item, as you want the game to set the flag after they received the item so they can't get more.
    And on the note of setflag, you're gonna need to use a real flag and not FFFF. The thread I linked you to in the last page had a section about the flags and variables that are safe to use so you can pick one form there.
     
    55
    Posts
    10
    Years
    • Seen Oct 18, 2014
    And you still haven't moved the setflag (not "set flag" like you have in your script, it has to be one word) to after the player is given the item, as you want the game to set the flag after they received the item so they can't get more.
    And on the note of setflag, you're gonna need to use a real flag and not FFFF. The thread I linked you to in the last page had a section about the flags and variables that are safe to use so you can pick one form there.

    Here's an updated version of the script:
    #dynamic 0x800000

    #org @start
    lock
    faceplayer
    checkflag 0x200
    if 0x1 goto @finished
    msgbox @yes 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba
    msgbox @no 0x6
    release
    end

    #org @finished
    msgbox @already_recieved 0x6
    release
    end

    #org @bulba
    msgbox@bulba_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba_yes
    goto @char

    #org @char
    msgbox@char_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @char_yes
    goto @squir

    #org @squir
    msgbox @squir_ask 0x5
    compare 0x800D 0x1
    if 0x1 goto @bulba

    #org @bulba_yes
    compare 0x4011 0x1
    if 0x0 goto @not_bulba
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_bulba 0x6
    setflag 0x200
    release
    end

    #org @not_bulba
    msgbox @bulbanotstarter 0x6
    release
    end

    #org @bulbanotstarter
    = Wait! I don't think you chose Bulbasaur. I have no time for liars!

    #org @enjoy_bulba
    = Enjoy that Venusaurite!

    #org @char_yes
    compare 0x4012 0x1
    if 0x0 goto @not_char
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_char 0x6
    setflag 0x200
    release
    end

    #org @not_char
    msgbox @charnotstarter 0x6
    release
    end

    #org @charnotstarter
    = Wait! I don't think you chose Charmander. I have no time for liars!

    #org @enjoy_char
    = Enjoy that Charizardite!

    #org @squir_yes
    compare 0x4013 0x1
    if 0x0 goto @not_squir
    giveitem 0x[FFFF item] 0x1 MSG_OBTAIN
    msgbox @enjoy_squir 0x6
    setflag 0x200
    release
    end

    #org @not_squir
    msgbox @squirnotstarter 0x6
    release
    end

    #org @squirnotstarter
    = Wait! I don't think you chose Squirtle. I have no time for liars!

    #org @enjoy_squir
    = Enjoy that Blastoisite!

    #org @already_recieved
    = I already gave you your item! Go away!

    #org @yes
    = Can I check your starter?

    #org @no
    = Why won't you let me check your starter?

    I'm still confused on the variables however. Am I doing it right? Or do I need to have the starters be under 0x4011 0x0-0x3?
     
    252
    Posts
    11
    Years
    • Seen Jul 6, 2019
    Here's an updated version of the script:


    I'm still confused on the variables however. Am I doing it right? Or do I need to have the starters be under 0x4011 0x0-0x3?
    Both ways can work, but using 3 variables for this honestly seems like a waste. I would do 0x4011 0x0, 0x1, 0x2 instead, and adjust the starter script accordingly.
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • Here's an updated version of the script:


    I'm still confused on the variables however. Am I doing it right? Or do I need to have the starters be under 0x4011 0x0-0x3?

    Yeah, what HidoranBlaze said.

    setvar 0x4011 0x1

    You're changing the first number on there, but not the second. What we're talking about is changing the 0x1 to, say, 0x2 or 0x3 or even 0x0 as they're all different values but for the same variable. Changing the value of the variable allows us to use a variable like a flag, except there's more than just whether it is set or not. Flags are limited to only being on or off, but you can make a variable any number you want it to be so it's far more flexible.
     
    55
    Posts
    10
    Years
    • Seen Oct 18, 2014
    Yeah, what HidoranBlaze said.

    setvar 0x4011 0x1

    You're changing the first number on there, but not the second. What we're talking about is changing the 0x1 to, say, 0x2 or 0x3 or even 0x0 as they're all different values but for the same variable. Changing the value of the variable allows us to use a variable like a flag, except there's more than just whether it is set or not. Flags are limited to only being on or off, but you can make a variable any number you want it to be so it's far more flexible.

    Now I understand! Thank you!
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • Now I understand! Thank you!

    No problem. One last thing I'd do is even if you didn't make the item yet, fill in your [FFFF item] with something like 0x1 or something so at least it's able to be inserted and you can always change it at a later time.
     
    Status
    Not open for further replies.
    Back
    Top