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

LaDestitute

Razor Sharp
84
Posts
11
Years
  • I'm using a separate fresh firered rom to test my scripts, so I don't have to worry about fubaring my own project.

    Are you sure you didn't make a mistake or something in the edited version? When I step on the script events now, either I get a game freeze or nothing happens. Yes, I'm compiling to the fresh rom, and using the offset 800000 for the script events.
     

    LaDestitute

    Razor Sharp
    84
    Posts
    11
    Years
  • You need to set the Unknown on the Script tile to 0300 (or just 03 in 1.9.5) in Advance Map and the Var number to an unused variable - I tend to use 4050.
    Okay, thanks, it worked fine. :D

    Although, some questions.
    What does the Unknown value do?
    How do I get the NPC to actually move to the player's front position, say if they step on the left or right script event instead of the middle one? It looks a bit odd with the NPC moving to the middle, otherwise. I could just have one script event, though, I guess. That works too, I'm just curious.
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Okay, thanks, it worked fine. :D

    Although, some questions.
    What does the Unknown value do?
    How do I get the NPC to actually move to the player's front position, say if they step on the left or right script event instead of the middle one? It looks a bit odd with the NPC moving to the middle, otherwise. I could just have one script event, though, I guess. That works too, I'm just curious.

    The unknown is just a staple. I never use it and things usually work fine, but it is something that Game Freak used on theirs as far as I know.

    There is a command called playerfacing(?). That will get the players direction and you can run different scripts based on it or you could force the player to look in the direction of the person that is moving.
     

    hinkage

    Everyone currently in an argument with this member
    384
    Posts
    13
    Years
    • Seen Apr 27, 2024
    Okay, thanks, it worked fine. :D

    Although, some questions.
    What does the Unknown value do?
    How do I get the NPC to actually move to the player's front position, say if they step on the left or right script event instead of the middle one? It looks a bit odd with the NPC moving to the middle, otherwise. I could just have one script event, though, I guess. That works too, I'm just curious.

    If you have multiple scriptboxes and want the NPC to walk up to you... uh, it's just easier to show through example:

    Spoiler:


    Check out your rival's scripts. They do it too, and it might be easier for you to understand if you actually see it in action.
     

    Overheat

    burning dragon
    5
    Posts
    10
    Years
  • Since I don't have the patience to read through 327 pages of questions I don't know if this has been asked yet but How do you give the player character the National dex early in the game?
     

    LaDestitute

    Razor Sharp
    84
    Posts
    11
    Years
  • Another question, how do I make it so with the givepokemon command, have the Pokemon given have a specific OT and IDno (or is the IDno randomly generated? Not sure) and/or nickname?

    Edit - Overheat, please use the search function next time, before asking.
    To award the national dex, use this:
    special 0x16F
     

    LaDestitute

    Razor Sharp
    84
    Posts
    11
    Years
  • Can someone proof-check this for me? I'm using a compare variable to set different NPC movement depending on variable value (with the three script events sharing the same variable, but different values) but it's not working as I thought.

    Code:
    #dynamic 0x800000
    
    #org @start
    countpokemon
    compare 0x800D 0x1
    if 0x1 goto @continue
    goto @nopokemon
    
    #org @nopokemon
    compare 0x4000 0x1
    if 0x1 goto @nopass0
    if 0x2 goto @nopass1
    if 0x3 goto @nopass2
    
    #org @continue
    release
    end
    
    #org @nopass0
    applymovement 0x1 @move3
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move4
    waitmovement 0x0
    release
    setflag 0x200
    end
    
    #org @nopass1
    applymovement 0x1 @move1
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move2
    waitmovement 0x0
    release
    setflag 0x200
    end
    
    #org @nopass2
    applymovement 0x1 @move5
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move6
    waitmovement 0x0
    release
    setflag 0x200
    end
    
    #org @move1
    #raw 0x62 
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move2
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @move3
    #raw 0x62 
    #raw 0x0A
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move4
    #raw 0x11
    #raw 0x11
    #raw 0x0B
    #raw 0xFE
    
    #org @move5
    #raw 0x62 
    #raw 0x0B
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move6
    #raw 0x11
    #raw 0x11
    #raw 0x0A
    #raw 0xFE
    
    #org @1
    = I can't let you pass because you\ndon't have any Pokémon.\pIt's not safe to go out without\nat least one.
     
    5,256
    Posts
    16
    Years
  • Can someone proof-check this for me? I'm using a compare variable to set different NPC movement depending on variable value (with the three script events sharing the same variable, but different values) but it's not working as I thought.

    Code:
    #dynamic 0x800000
    
    #org @start
    countpokemon
    compare 0x800D 0x1
    if 0x1 goto @continue
    goto @nopokemon
    
    #org @nopokemon
    compare 0x4000 0x1
    if 0x1 goto @nopass0
    if 0x2 goto @nopass1
    if 0x3 goto @nopass2
    
    #org @continue
    release
    end
    
    #org @nopass0
    applymovement 0x1 @move3
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move4
    waitmovement 0x0
    release
    setflag 0x200
    end
    
    #org @nopass1
    applymovement 0x1 @move1
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move2
    waitmovement 0x0
    release
    setflag 0x200
    end
    
    #org @nopass2
    applymovement 0x1 @move5
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move6
    waitmovement 0x0
    release
    setflag 0x200
    end
    
    #org @move1
    #raw 0x62 
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move2
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @move3
    #raw 0x62 
    #raw 0x0A
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move4
    #raw 0x11
    #raw 0x11
    #raw 0x0B
    #raw 0xFE
    
    #org @move5
    #raw 0x62 
    #raw 0x0B
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move6
    #raw 0x11
    #raw 0x11
    #raw 0x0A
    #raw 0xFE
    
    #org @1
    = I can't let you pass because you\ndon't have any Pokémon.\pIt's not safe to go out without\nat least one.
    Code:
    #dynamic 0x800000
    
    #org @start
    countpokemon
    compare 0x800D 0x1
    This means the script will only not activate if the player has one Pokémon in their party - use checkflag 0x828 instead.

    Code:
    if 0x1 goto @continue
    goto @nopokemon
    
    #org @nopokemon
    compare 0x4000 0x1
    if 0x1 goto @nopass0
    if 0x2 goto @nopass1
    if 0x3 goto @nopass2

    You need to add the compare line everytime.

    Code:
    #org @continue
    release
    end
    
    #org @nopass0
    applymovement 0x1 @move3
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move4
    waitmovement 0x0
    release
    setflag 0x200
    end
    Release always goes before end, without any commands in between.

    Code:
    #org @nopass1
    applymovement 0x1 @move1
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move2
    waitmovement 0x0
    release
    setflag 0x200
    end
    
    #org @nopass2
    applymovement 0x1 @move5
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move6
    waitmovement 0x0
    release
    setflag 0x200
    end
    Again, release goes directly before end.
    Code:
    #org @move1
    #raw 0x62 
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move2
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @move3
    #raw 0x62 
    #raw 0x0A
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move4
    #raw 0x11
    #raw 0x11
    #raw 0x0B
    #raw 0xFE
    
    #org @move5
    #raw 0x62 
    #raw 0x0B
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move6
    #raw 0x11
    #raw 0x11
    #raw 0x0A
    #raw 0xFE
    
    #org @1
    = I can't let you pass because you\ndon't have any Pokémon.\pIt's not safe to go out without\nat least one.

    So, the fixed script would look like this:

    Code:
    #dynamic 0x800000
    
    #org @start
    checkflag 0x828
    if 0x1 goto @continue
    goto @nopokemon
    
    #org @nopokemon
    compare 0x4000 0x1
    if 0x1 goto @nopass0
    compare 0x4000 0x1
    if 0x2 goto @nopass1
    compare 0x4000 0x1
    if 0x3 goto @nopass2
    goto @continue
    
    #org @continue
    release
    end
    
    #org @nopass0
    applymovement 0x1 @move3
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move4
    waitmovement 0x0
    setflag 0x200
    release
    end
    
    #org @nopass1
    applymovement 0x1 @move1
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move2
    waitmovement 0x0
    setflag 0x200
    release
    end
    
    #org @nopass2
    applymovement 0x1 @move5
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x1 @move6
    waitmovement 0x0
    setflag 0x200
    release
    end
    
    #org @move1
    #raw 0x62 
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move2
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @move3
    #raw 0x62 
    #raw 0x0A
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move4
    #raw 0x11
    #raw 0x11
    #raw 0x0B
    #raw 0xFE
    
    #org @move5
    #raw 0x62 
    #raw 0x0B
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org @move6
    #raw 0x11
    #raw 0x11
    #raw 0x0A
    #raw 0xFE
    
    #org @1
    = I can't let you pass because you\ndon't have any Pokémon.\pIt's not safe to go out without\nat least one.

    To be honest, you could save a lot of space by using the call command for the nopass parts but this will work.
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Since I don't have the patience to read through 327 pages of questions I don't know if this has been asked yet but How do you give the player character the National dex early in the game?

    There is a nice little search feature up in the top right hand corner. Search this and the Simple Questions thread since it has been answered..... Far too many times.
     

    Varion Bluefire

    A.K.A The Glitch
    655
    Posts
    11
    Years
    • Seen Jan 3, 2015
    C+P'd from RHO.

    So, I'm trying my hands at scripting, using XSE

    This is my script:

    "#dynamic 0x2A28C8
    #org @start
    lock
    faceplayer
    msgbox @1 0x6
    release
    end

    #org @1
    = Hello world!"

    I've put the offset 2A28C8 which i got from FSF into aMap on the event person i desire.

    When talking to this person, nothing happens.

    What do? :/
     
    Last edited:

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • C+P'd from RHO.

    So, I'm trying my hands at scripting, using XSE

    This is my script:

    "#dynamic 0x2A28C8
    #org @start
    lock
    faceplayer
    msgbox @1 0x6
    release
    end

    #org @1
    = Hello world!"

    I've put the offset 2A28C8 which i got from FSF into aMap on the event person i desire.

    When talking to this person, nothing happens.

    What do? :/

    It sounds like you're using an outdated version of XSE. Try using version 1.1.1 which was the most recent update.
     
    5,256
    Posts
    16
    Years
  • On another note, you could save space by doing this:

    Code:
    #dynamic 0x800000
    
    #org @start
    msgbox @string1 0x2
    end
    
    #org @string1
    = Hello world!

    msgbox 0x2 automatically includes the lock, faceplayer and release.
     

    horcruxrocks

    Pokemon Lover
    12
    Posts
    11
    Years
    • Seen Aug 6, 2016
    Guys read this script
    #dynamic 0x800000

    #org @start
    lockall
    faceplayer
    checkflag 0x828
    if 0x1 goto @done
    msgbox @talk1 0x6
    givepokemon 0x4 0x8 0x0 0x0 0x0 0x0
    giveitem 0x3F 0x1 0x0
    setflag 0x828
    releaseall
    end

    #org @done
    msgbox @talk2 0x0
    release
    end

    #org @talk1
    = Erik obtained a CHARMANDER!

    #org @talk2
    = Sorry you got your item!

    I inserted it to an event and when i checked it out its not working
    Just a msgbox appears with no text.Any help would be appreciated
    Also can any one teach me abt these cmmands as i have not understood completely :
    checkflag 0x828
    if 0x1 goto @done
    msgbox @talk1 0x6
    givepokemon 0x4 0x8 0x0 0x0 0x0 0x0
    giveitem 0x3F 0x1 0x0
    setflag 0x828
    releaseall
    end

    #org @done
    msgbox @talk2 0x0
    release
    end

    #org @talk1
    = Erik obtained a CHARMANDER!

    #org @talk2
    = Sorry you got your item!

    Thank you

    -Horcrux
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Guys read this script


    I inserted it to an event and when i checked it out its not working
    Just a msgbox appears with no text.Any help would be appreciated
    Also can any one teach me abt these cmmands as i have not understood completely :

    Thank you

    -Horcrux

    It sounds like you are using an old version of XSE. You need to have v1.1.1. Also, what commands exactly need an explanation?
     
    Status
    Not open for further replies.
    Back
    Top