• 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.
5,256
Posts
16
Years
  • The unknown number actually does nothing, you can just leave it as 0000 if you wish, but the script tile needs a var to function. Usually you'd put the var you're using there to stop the script from repeating but it isn't necessary when you're using a flag, so instead you can just use an unused var.

    The unknown number actually controls the altitude of the script tile. If you set it to 4, for example, it would only activate if you're on a layer which uses the 10 movement permission in A-Map.
     

    BadEgg~

    Pokémon: Volant Version Developer
    112
    Posts
    8
    Years
  • The script for when the protag. first meets the prof. The professor goes through all the movements, without pausing or talking, then gets to his final position and freezes the game. Var number: 4051 Unknown: 0003

    Spoiler:
     

    Sniper

    ふゆかい
    1,412
    Posts
    10
    Years
  • The script for when the protag. first meets the prof. The professor goes through all the movements, without pausing or talking, then gets to his final position and freezes the game. Var number: 4051 Unknown: 0003

    Spoiler:

    I went through your script and actually saw a really small error on playsong code.
    Code:
    playsong 0x12E 0x0[COLOR=Red]n[/COLOR]
    I believe that n shouldn't be so fixing your script! Should end like this:

    Code:
    #dynamic 0x161ED9
    
    #org @start
    checkflag 0x828
    if 0x1 goto @done
    applymovement 0x01 @move
    pause 0x30
    playsong 0x12E 0x0
    msgbox @1 0x2
    applymovement 0x01 @move1
    waitmovement 0x0
    msgbox @2 0x2
    applymovement 0x01 @move2
    applymovement 0xFF @move2
    waitmovement 0x02
    msgbox @3 0x2
    release
    end
    
    #org @done
    release
    end
    
    #org @move
    #raw 0x0
    pause 0x30
    #raw 0x63
    pause 0x30
    #raw 0x62
    #raw 0xFE
    
    #org @move1
    #raw 0x11
    #raw 0x11
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x10
    #raw 0x10
    #raw 0xFE
    
    #org @move2
    #raw 0x11
    #raw 0x13
    #raw 0x13
    #raw 0xFE
    
    #org @1
    = [blue_fr]Cobalt: Ah, you must be\n[player]! Just give me a moment\lwould you?
    
    #org @2
    = [blue_fr]So you've finally arrived...\nI hope that the long journey went\lsmoothly. Now now, this is no time\lfor dawdling. I have something for\lyou. Follow me!
    
    #org @3
    = [blue_fr]In these each of these\n[red_fr]Pokéballs [blue_fr]is a Pokémon.\lWhile I'm sure you would be more\lthan happy to take all 3, the law\lstates that each trainer can only\lchoose one starter Pokémon.\lRemember, once you decide, there\lare no do-overs, so choose wisely!

    If it still have problems after, I think you should put fadesong at the end c:
    Code:
    fadesong 0xFFF
    sappy number.

    That's all. Remember to go through your script before testing.
     

    BadEgg~

    Pokémon: Volant Version Developer
    112
    Posts
    8
    Years
  • I went through your script and actually saw a really small error on playsong code.
    Code:
    playsong 0x12E 0x0[COLOR=Red]n[/COLOR]
    I believe that n shouldn't be so fixing your script! Should end like this:

    Code:
    #dynamic 0x161ED9
    
    #org @start
    checkflag 0x828
    if 0x1 goto @done
    applymovement 0x01 @move
    pause 0x30
    playsong 0x12E 0x0
    msgbox @1 0x2
    applymovement 0x01 @move1
    waitmovement 0x0
    msgbox @2 0x2
    applymovement 0x01 @move2
    applymovement 0xFF @move2
    waitmovement 0x02
    msgbox @3 0x2
    release
    end
    
    #org @done
    release
    end
    
    #org @move
    #raw 0x0
    pause 0x30
    #raw 0x63
    pause 0x30
    #raw 0x62
    #raw 0xFE
    
    #org @move1
    #raw 0x11
    #raw 0x11
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x10
    #raw 0x10
    #raw 0xFE
    
    #org @move2
    #raw 0x11
    #raw 0x13
    #raw 0x13
    #raw 0xFE
    
    #org @1
    = [blue_fr]Cobalt: Ah, you must be\n[player]! Just give me a moment\lwould you?
    
    #org @2
    = [blue_fr]So you've finally arrived...\nI hope that the long journey went\lsmoothly. Now now, this is no time\lfor dawdling. I have something for\lyou. Follow me!
    
    #org @3
    = [blue_fr]In these each of these\n[red_fr]Pokéballs [blue_fr]is a Pokémon.\lWhile I'm sure you would be more\lthan happy to take all 3, the law\lstates that each trainer can only\lchoose one starter Pokémon.\lRemember, once you decide, there\lare no do-overs, so choose wisely!

    If it still have problems after, I think you should put fadesong at the end c:
    Code:
    fadesong 0xFFF
    sappy number.

    That's all. Remember to go through your script before testing.

    I rewrote the code from scratch and fixed a lot of things, but thanks for posting help anyways ^v^)
     

    Telemetius

    Tele*
    267
    Posts
    9
    Years
  • Hi, this question is for Spherical Ice but whoever can answer is welcome.
    I was looking for a way to compare the custom nickname of my pokemon with the buffer created by bufferpartyPokémon in the buffer slot 0x00.
    For example I just nicknamed my pikachu "DUDE", changed Pika's name with DUDE thanks to YAPE and i was looking for a way to make the game recognize that the nickname of this particular pokemon stored in the slot 2 is equivalent to "DUDE".

    That's what I came up with so far, but I don't fully understand the command bufferpartyPokémon:

    #dynamic 0x800000
    #org @inizio
    givepokemon 0x19 0x1 0x0 0x0 0x0 0x0
    countpokemon
    subvar 0x800D 0x1 //choose the last pokemon in my squad
    copyvar 0x8004 0x800D
    fadescreen 0x1
    special 0x9E //nickname this pokemon
    waitstate
    setvar 0x8004 0x19
    bufferpartypokemon 0x0 0x8004
    compare 0x8004 0x[buffer1] //not working
    if 0x1 goto @ok
    msgbox @no 0x6
    release
    end

    #org @ok
    giveitem 0xa 0x1 MSG_OBTAIN
    release
    end

    #org @no
    = Errore.
     
    26
    Posts
    8
    Years
    • Seen Nov 25, 2017
    My script and pictures:
    Spoiler:

    The intent is for the swimmer to walk up, start the battle, and swim through the ground to the left (by making the standing sprite disappear and the swimming sprite reappear), but this random Red sprite shows up that is clearly not on my A-Map instead of the standing swimmer (event #10) walking up. Help?
     
    87
    Posts
    8
    Years
    • Seen Feb 5, 2021
    Are you using XSE or some other program?
    Anyway remember to use flags between 200 and 2FF and variables between 4011 and 40FF.
    Also (at least in XSE, I've only used it for scripts this far) you have to convert people event number to hexadecimal (so 10 is 0A, 11 is 0B etc).
    I don't know if those changes will solve your problem but try fixing them first, then let me know if something did actually change.
     

    Sayuri

    人生忘れられた
    276
    Posts
    8
    Years
  • I'm using jpan's hacked FireRed engine, and after executing this script:
    Spoiler:


    my person freezes up and I cannot move. Am I doing something wrong?
     
    26
    Posts
    8
    Years
    • Seen Nov 25, 2017
    Are you using XSE or some other program?
    Anyway remember to use flags between 200 and 2FF and variables between 4011 and 40FF.
    Also (at least in XSE, I've only used it for scripts this far) you have to convert people event number to hexadecimal (so 10 is 0A, 11 is 0B etc).
    I don't know if those changes will solve your problem but try fixing them first, then let me know if something did actually change.

    I was told the flags and vars I'm using are safe, and I've use them before without problems. Changing them didn't help. I'm using PKSV, and changing to hex (person events 10 and 12 to 0A and 0C) did make the movement work, but now Red pops up under the swimmer sprite after he moves.
    I just don't know where it's getting that sprite from, since it's a swimmer on A-Map and my only reappear command is after the battle, not before. I have tried moving the in-ground swimmer somewhere else, but the Red keeps popping up at that same tile in front of the player, meaning the swimmer definitely isn't becoming the Red.
     
    Last edited:

    Squeetz

    ROM Hacker
    191
    Posts
    10
    Years
  • I'm using jpan's hacked FireRed engine, and after executing this script:
    Spoiler:


    my person freezes up and I cannot move. Am I doing something wrong?
    You forgot a '0xFE' after the second applymovement string.
     
    87
    Posts
    8
    Years
    • Seen Feb 5, 2021
    I was told the flags and vars I'm using are safe, and I've use them before without problems. Changing them didn't help. I'm using PKSV, and changing to hex (person events 10 and 12 to 0A and 0C) did make the movement work, but now Red pops up under the swimmer sprite after he moves.
    I just don't know where it's getting that sprite from, since it's a swimmer on A-Map and my only reappear command is after the battle, not before. I have tried moving the in-ground swimmer somewhere else, but the Red keeps popping up at that same tile in front of the player, meaning the swimmer definitely isn't becoming the Red.

    Hmm, are you sure you've deleted all the level scripts on the map? Check it for sure.
    And if it's not your problem I'm afraid I can't help you, I have had a similar problem time ago and it went unsolved... Maybe try to insert the map again.


    Ah, I did... Thanks, haha.
    Another question, if you know the answer: how do I move the camera without moving the player?

    Use this commands:
    special 0x116
    applymovement 0x7F @movX
    waitmovement 0x0
    [...]
    applymovement 0x7F @movY
    waitmovement 0x0
    special 0x117

    Specials are necessary to begin and end the movement of the camera (116 and 117 are for Emerald, 113 and 114 should be those for Fire Red).
    Use the first applymovement to move the camera where you prefer and remember to use the second one to bring it back.
    In the middle of the script you can put everything you want.
     
    Last edited:
    26
    Posts
    8
    Years
    • Seen Nov 25, 2017
    The only map script is a setworldmapflag command. Idk what that does, but since it occurs upon loading the map, I'd imagine it's the forest image when entering Viridian Forest. Anyway, I couldn't imagine that being the problem.
    I tried removing all the disappear and reappear commands in my script, but the Red still just pops up. It appears as if he pops up out of the ground, but I can't fathom why that happens. Anyone else have any ideas?
     

    Sayuri

    人生忘れられた
    276
    Posts
    8
    Years
  • Specials are necessary to begin and end the movement of the camera (116 and 117 are for Emerald, 113 and 114 should be those for Fire Red).
    Use the first applymovement to move the camera where you prefer and remember to use the second one to bring it back.
    In the middle of the script you can put everything you want.

    Alright, thank you. Also, do you know how to get special 0x8E to work? I've tried many different things and the map still won't reload.
     

    Syrex

    [b][i][COLOR=black][font=Rock Salt][glow=green]Hen
    653
    Posts
    15
    Years
  • Slightly new to scripting. I understand it for the most part but i do have a question.

    How do I go about starting the opening dialogue after the oak intro when you first get into game?
    I can script what i want i need, i just need a tip and starting the script as soon as you get into game
     
    87
    Posts
    8
    Years
    • Seen Feb 5, 2021
    Alright, thank you. Also, do you know how to get special 0x8E to work? I've tried many different things and the map still won't reload.
    You mean the one with setmaptile, don't you? If I remember well you just need to put the special just after setmaptile. If the problem is that it doesn't load instantly try to use fadescreen 0x1 / fadescreen 0x0... Or otherwise there is the "setmaptile" level script, honestly I haven't used it this far but if you have problems you could just see how the ingame setmaptile level script are written.

    Slightly new to scripting. I understand it for the most part but i do have a question.

    How do I go about starting the opening dialogue after the oak intro when you first get into game?
    I can script what i want i need, i just need a tip and starting the script as soon as you get into game

    Mmm maybe with a simple level script it'll work.
    Hereyou are a tutorial to realize it. It's just as creating a normal script except for some passages, read and follow it and everything should be fine.
     
    Last edited:
    26
    Posts
    8
    Years
    • Seen Nov 25, 2017
    I tried removing all the disappear and reappear commands in my script, but the Red still just pops up. It appears as if he pops up out of the ground, but I can't fathom why that happens. Anyone else have any ideas?
    It seems as though the trainer battle command has something to do with my problem, since it didn't occur when I removed it. Does it seem like anything is wrong with using 'trainerbattle 0x1 0x004 0x0 @begin @win @later' in a script through a script box?
     
    Last edited:

    Sayuri

    人生忘れられた
    276
    Posts
    8
    Years
  • It seems as though the trainer battle command has something to do with my problem, since it didn't occur when I removed it. Does it seem like anything is wrong with using 'trainerbattle 0x1 0x004 0x0 @begin @win @later' in a script through a script box?

    Try something like
    Spoiler:


    If I remember correctly, trainerbattle 0x1 is for Gym-Leader-style battles. Of course if that's what you want, then what you're doing should be fine.
     
    26
    Posts
    8
    Years
    • Seen Nov 25, 2017
    Try something like
    Spoiler:


    If I remember correctly, trainerbattle 0x1 is for Gym-Leader-style battles. Of course if that's what you want, then what you're doing should be fine.

    I tried this
    Spoiler:

    The random Red sprite still appears, so whether it's a gym-style battle or not doesn't seem to matter. Any other ideas?
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • I tried this
    Spoiler:

    The random Red sprite still appears, so whether it's a gym-style battle or not doesn't seem to matter. Any other ideas?

    For movements and reappearing you have both 0xC and 0x12, is that correct or did you just mean 0xC cause if so that may be one cause of your issues. (And 0x5004 is too high of a var dont go past 0x40FF)
     
    Status
    Not open for further replies.
    Back
    Top