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

PI Hudson

Can be random for hugs> PIE!!!
33
Posts
14
Years
  • Hey quick level script question...

    I have a level script, compiled and all:

    Spoiler:

    But, when I enter the level with flag 800 set, the sprite is still there. :/

    Did I script something wrong, or is there a problem with something else?
    To hide a person like you are trying to do, you don't use a script. You use setflag/clearflag and change the person id(2nd to last number in A-map) to that flag.

    To make them invisible, have the flag set. To have them visible, clear the flag(default, by the way). If you want the person to be hidden from the beginning, have the flag set as early as possible, then clear the flag when its okay to see them.

    These flags can be used for multiple people too, so don't use more then one flag for people that appear/disappear at the same time.
     

    HackMew

    Mewtwo Strikes Back
    1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    To hide a person like you are trying to do, you don't use a script.

    Actually you can use a script, too. Just that if it's a level script than hidesprite is useless since the level script is executed before the map appears so setflag/clearflag is more than enough. When in a normal script, then you should use fadescreen and hide/showsprite too. Anyway, hidesprite and showsprite are just temporary. What really matters are flags.
     

    Xatoku

    Game Developer
    451
    Posts
    15
    Years
  • Is there a way to have gametime make a sprite reappear? Like say there's a legendary Pokemon you battle, after it's sprite dissapears are you able to make it reappear after lets say 15 minutes of gametime?
     
    10,078
    Posts
    15
    Years
    • Age 32
    • UK
    • Seen Oct 17, 2023
    Xatoku, as was discussed just a few posts above yours to make a sprite that is hidden reappear simply clear the flag associated with the sprite.

    I don't know if it would be possible to clear after a certain amount of time though, using the above it would have to be after talking to a sprite / entering a map / after a trigger.
     

    HackMew

    Mewtwo Strikes Back
    1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    Oye, okay, I seriously have to be doing something wrong and I am almost positive it's offsets.

    I use FSF and start with 0x80000 for free space in new things I create.

    And whenever I get just a bit deep into code everything goes to hell. I lose all text in the game some times, I lose the ability to see blocks of text, including seeing my menu and msg boxes entirely.

    Is there a method you guys use, because to me I am making a simple mistake that seems to have been covered in a lost guide XD.

    ALSO

    Many times, when I try to write new script after I compile it it changes completely replacing my proper code with improper.

    BEFORE
    Spoiler:


    AFTER
    Spoiler:

    I'll quote myself quoting you in the SQ thread:

    XSE sometimes also compiles stuff wierdly, adding and removing things. And usually adding things to make things crash in a flashy way.

    XSE always compile everything right. It's just your fault. You can't decompile a script, add some commands and then happily recompile. "But..." No, you can't. Direct recompile is only applicable when you just edit/remove stuff (e.g. you change some parameters). In any other case you need to repoint the script somewhere else using dynamic labels.


    Is there a way to have gametime make a sprite reappear? Like say there's a legendary Pokemon you battle, after it's sprite dissapears are you able to make it reappear after lets say 15 minutes of gametime?

    Since there's nothing like that in the game, you should make your own routine. Welcome to the amazing world of ASM.
     
    Last edited:

    HackChu

    I need a haircut...
    674
    Posts
    17
    Years
  • also dont forget,when using fadescreen commands to use hidesprite 0x800f,cuz if you do it just regular hidesprite the screen will jack up.
     

    ckret2

    usually pronounced "secret 2"
    518
    Posts
    15
    Years
  • Edit: Fixed! Thank you, Larsie13!

    I've been working on this script for a while, and no matter what I do it always messes up just a little. When I get the yes/no option, say I click on "no" when the yes/no box comes up, the rom will read off the dialogue at @nosteal like it's supposed to, then it'll go to @steal and on to @cansteal. Or if I click on "yes" and the rom reads off @steal and @cansteal, it'll then read off the data under @nosteal as well. I think I've fixed it up, but is there anything here that might cause a problem?

    Spoiler:


    Here's how it's supposed to work: after battle, if you talk to the sprite and say "yes," to the question of if you want to steal the Pokémon the game will check to see if you have six Pokémon in your party. If you do, it'll say you have too many and you won't steal the Pokémon. If you don't, you'll get a level 17 Meowth holding a Great Ball. (Because Pickup gets weird things.) If you say "no" to the initial question, the trainer thanks you. No matter which of the three options you go with (yes but the party's full, yes and the party's not full, or no), the sprite disappears and the flag is set. I think this script should finally get it to work, but that's what I thought before I tinkered with it. Are there any visible problems with it?

    By the way, is there any way to tell how many bytes a script will take up before you compile it, other than figuring out how many bytes each command is and adding it up manually?
     
    Last edited:

    Larsie13

    Guest
    0
    Posts
    I've been working on this script for a while, and no matter what I do it always messes up just a little. When I get the yes/no option, say I click on "no" when the yes/no box comes up, the rom will read off the dialogue at @nosteal like it's supposed to, then it'll go to @steal and on to @cansteal. Or if I click on "yes" and the rom reads off @steal and @cansteal, it'll then read off the data under @nosteal as well. I think I've fixed it up, but is there anything here that might cause a problem?

    Spoiler:


    Here's how it's supposed to work: after battle, if you talk to the sprite and say "yes," to the question of if you want to steal the Pokémon the game will check to see if you have six Pokémon in your party. If you do, it'll say you have too many and you won't steal the Pokémon. If you don't, you'll get a level 17 Meowth holding a Great Ball. (Because Pickup gets weird things.) If you say "no" to the initial question, the trainer thanks you. No matter which of the three options you go with (yes but the party's full, yes and the party's not full, or no), the sprite disappears and the flag is set. I think this script should finally get it to work, but that's what I thought before I tinkered with it. Are there any visible problems with it?

    By the way, is there any way to tell how many bytes a script will take up before you compile it, other than figuring out how many bytes each command is and adding it up manually?
    2 "if"s in a row don't work. Change it to this:

    Spoiler:

    Also, you could try debugging the script (button next to the compile-button), and add all "+X" numbers, then you'll know how many bytes it will use. You will also be able to spot some errors that way. It takes a little time, but I don;t think there's an other way.
     

    BlitŻ1

    guahh my dog is so cute
    472
    Posts
    15
    Years
  • I'm having a problem with a give item script. an since this is the part that is not working I'm only gonna show you the problem

    I'm using XSE and this is fire red

    giveitem 0x4 0x1 MSG_OBTAIN

    it says here that it's a type mismatch error and I'm missing a #define, I'm using version 1.1.1 of XSE.

    I looked at other guides and I'm using the exact same words as the tuts but it still won't work.

    Once I replaced the msg obtain with 0x6 adn it compiled but In game it sad the previous message twice and it still didn't give me the item
     

    Larsie13

    Guest
    0
    Posts
    I'm having a problem with a give item script. an since this is the part that is not working I'm only gonna show you the problem

    I'm using XSE and this is fire red

    giveitem 0x4 0x1 MSG_OBTAIN

    it says here that it's a type mismatch error and I'm missing a #define, I'm using version 1.1.1 of XSE.

    I looked at other guides and I'm using the exact same words as the tuts but it still won't work.

    Once I replaced the msg obtain with 0x6 adn it compiled but In game it sad the previous message twice and it still didn't give me the item
    Don't use 0x6; use 0x0 or 0x1 for giveitem. And for the MSG_OBTAIN not being recognized: You need XSE's "std.rbh" to be in the same folder as XSE.exe is. In other words, extract the entire archive into a folder.
     

    BlitŻ1

    guahh my dog is so cute
    472
    Posts
    15
    Years
  • Don't use 0x6; use 0x0 or 0x1 for giveitem. And for the MSG_OBTAIN not being recognized: You need XSE's "std.rbh" to be in the same folder as XSE.exe is. In other words, extract the entire archive into a folder.


    Oh okay that makes a bit more sense.

    I think this problem happened becasue before I was using XSE 1.1.0, but when I found out the new one was out I switched
     

    PlatniumPiano

    You are now breathing manually
    479
    Posts
    15
    Years
  • Code:
    '---------------
    #org 0x6B0B1C
    #raw 0x2
    #raw pointer 0x86B0B22
    #raw 0x0
    '---------------
    #org 0x6B0B22
    #raw word 0x8888
    #raw word 0x0
    #raw pointer 0x8804256
    #raw word 0x0
    '---------------
    #org 0x804256
    setvar 0x7890 0x1
    checkflag 0x800
    if 0x1 goto 0x8804266
    end
    '---------------
    #org 0x804266
    setflag 0x3AE
    end

    This level script is still not working. When flag 800 is set, the sprite is still there. Help?
     

    ExitWound

    Boggle
    79
    Posts
    16
    Years
    • Age 32
    • Seen Sep 22, 2016
    Script Help

    I am trying to make a script where a guy is just standing there and when you get 2 spaces in front of him, he'll approach you, talk for a little while, then battle. After the battle, he will leave but I haven't gotten that far yet because I am stuck on one problem:

    When the battle is over, I no longer have control over my character but control over him... I'm getting quite frustrated so could somebody please help me? Here is my script:

    Spoiler:
     

    Sierraffinity

    Desperately trying to retire from ROM hacking
    1,069
    Posts
    16
    Years
  • I am trying to make a script where a guy is just standing there and when you get 2 spaces in front of him, he'll approach you, talk for a little while, then battle. After the battle, he will leave but I haven't gotten that far yet because I am stuck on one problem:

    When the battle is over, I no longer have control over my character but control over him... I'm getting quite frustrated so could somebody please help me? Here is my script:

    Spoiler:
    It has nothing to do with your script. Just change the guy that you have control of from Face down to No movement in A-Map.
     

    Quickster

    Dream or Drop?
    351
    Posts
    16
    Years
    • Seen Apr 4, 2016
    Would it be possible to make a pokemon follow you in a small house? I heard that you need a lot a scripts or level scripts but i just want it to happen in houses.
     

    HackMew

    Mewtwo Strikes Back
    1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    Would it be possible to make a pokemon follow you in a small house? I heard that you need a lot a scripts or level scripts but i just want it to happen in houses.

    Or, to put it shorter... ASM.
     
    Status
    Not open for further replies.
    Back
    Top