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

Renegade

Time for real life...
995
Posts
12
Years
  • Hello, I have just recently started rom hacking and i'm new to scripting and advance map and all that good stuff. Naturally, i'd find some tutorials on how to make my people say different things and I found Diego's tutorial for a basic message saying hello.



    However, when I put this exact code into XSE and use the free space offset for my person, my rom either freezes or does nothing when I talk to them. Why is this? Do I need to have a specific amount of free bytes in my offset? Is there something special I need to do with my coding? I'm not trying something super advanced here I just want my person to say hello. I've tried many other tutorials as well and haven't had any luck. Help would be appreciated as I don't know where else to turn to. :/

    Your "#dynamic 0x (FSF Offset)" command can just be 0x800000 for all of your scripts. You don't need to put in any other offset.

    Also, did you compile your script and insert it into the game?
    Click Tools --> Batch Compiler --> Checkmark your script that you want to insert --> Click Compile --> Click the copy button. (That will copy the offset that XSE gives you.

    Next, go into A-Map. Go to the person event that you want to give the script to. To the right, there should be a bunch of boxes. Near the bottom, there should be a box called "Script Offset". Get rid of the $000000 and change it to the offset that XSE gave you. (The one that you copied) Save it. Then check in game.
     

    blue

    gucci
    21,057
    Posts
    16
    Years
  • Just wondering what is wrong with the following:
    Spoiler:


    I got it right the first time, this is the second script.
    SetVar = 5051
    Person ID = 1245
    Person Event Number = 10

    I'm not sure whether I've got the Hex/Dec mixed up but basically what happens is when the player walks on the Script tile, it activates but instead of the OW walking upto the player then opening up with the speech, it just opens the speech and battles without any Sprite walking on screen.

    Also, I'm not sure whether the Setvar should stay the same considering the last Setvar was 5050, it's been a while since I've done this.
     

    johnr754

    I am JOHN, heck yeah!
    78
    Posts
    14
    Years
  • I tried to make a wild battle script in XSE, and it half-worked. There was no battle. Instead, the cry was made, and it left. Makes it sound like a roaming Pokémon.

    Spoiler:
     

    Renegade

    Time for real life...
    995
    Posts
    12
    Years
  • Just wondering what is wrong with the following:
    Spoiler:


    I got it right the first time, this is the second script.
    SetVar = 5051
    Person ID = 1245
    Person Event Number = 10

    I'm not sure whether I've got the Hex/Dec mixed up but basically what happens is when the player walks on the Script tile, it activates but instead of the OW walking upto the player then opening up with the speech, it just opens the speech and battles without any Sprite walking on screen.

    Also, I'm not sure whether the Setvar should stay the same considering the last Setvar was 5050, it's been a while since I've done this.

    Does the OW Sprite start off screen? If so, then you need to have the OW exactly one tile away from being able to be seen by the player. Also, you might need a "showsprite 0x0A" command before the "applymovement 0x0A @move" command.

    I tried to make a wild battle script in XSE, and it half-worked. There was no battle. Instead, the cry was made, and it left. Makes it sound like a roaming Pokémon.

    Spoiler:

    I'm not sure why you have the additional 0x0 0x0 0x0 at the end of the "wildbattle" command, but they are not needed. Try getting rid of them and see if that works. Also, if the Pokemon is not holding an item, you don't need the first 0x0 either. Just "wildbattle 0x90 0x1E".
     
    Last edited:

    johnr754

    I am JOHN, heck yeah!
    78
    Posts
    14
    Years
  • I'm not sure why you have the additional 0x0 0x0 0x0 at the end of the "wildbattle" command, but they are not needed. Try getting rid of them and see if that works. Also, if the Pokemon is not holding an item, you don't need the first 0x0 either. Just "wildbattle 0x90 0x1E".

    I tried doing that; it said I was missing #define or #parameter on line 8. Also, I'm doing this for Pokémon Emerald Version.
     

    Skull Kid

    The One and Only
    24
    Posts
    14
    Years
    • Seen Sep 12, 2015
    Your "#dynamic 0x (FSF Offset)" command can just be 0x800000 for all of your scripts. You don't need to put in any other offset.

    Also, did you compile your script and insert it into the game?
    Click Tools --> Batch Compiler --> Checkmark your script that you want to insert --> Click Compile --> Click the copy button. (That will copy the offset that XSE gives you.

    Next, go into A-Map. Go to the person event that you want to give the script to. To the right, there should be a bunch of boxes. Near the bottom, there should be a box called "Script Offset". Get rid of the $000000 and change it to the offset that XSE gave you. (The one that you copied) Save it. Then check in game.

    You did help me get the message box to appear, but the hiker uses text belonging to someone else instead of the text I assigned to him. He says "I tripped over a rocky pokemon geodude" Instead of what I wanted him to say "Hey! No barging in my house!" I followed all your steps and I made sure I put in the offset XSE gave me the 2nd time.

    Complier Output
    Spoiler:
     

    Renegade

    Time for real life...
    995
    Posts
    12
    Years
  • You did help me get the message box to appear, but the hiker uses text belonging to someone else instead of the text I assigned to him. He says "I tripped over a rocky pokemon geodude" Instead of what I wanted him to say "Hey! No barging in my house!" I followed all your steps and I made sure I put in the offset XSE gave me the 2nd time.

    Complier Output
    Spoiler:

    Did you delete any of the original events that were already in the game?
     

    Skull Kid

    The One and Only
    24
    Posts
    14
    Years
    • Seen Sep 12, 2015
    Did you delete any of the original events that were already in the game?

    No, I've been good about moving the npcs I don't need out of bounds. Just to make sure, I even got an original firered rom untouched and I didn't do anything except add 1 person and followed the steps you told me to do before again. The person still doesn't say anything. I've pretty much lost hope in scripting since my anti-virus software got rid of XSE for having a trojan. Thanks for trying to help me at least :/
     
    Last edited:

    Renegade

    Time for real life...
    995
    Posts
    12
    Years
  • Hello, I have a problem with this script:

    Code:
    #dynamic 0x800000
    
    #org @start
    lock
    special 0x113
    applymovement 0x7F @m1
    waitmovement 0x0
    special 0x114
    textcolor 0x0
    message @t1 6
    applymovement 0x2 @m2
    applymovement 0x3 @m2
    waitmovement 0x0
    message @t2 6
    applymovement 0x1 @m3
    waitmovement 0x0
    message @t3 6
    special 0x113
    applymovement 0x1 @m4
    applymovement 0x7F @m15
    waitmovement 0x0
    special 0x114
    message @t4 6
    playsong 0x0000 0x0
    special 0x113
    applymovement 0x7F @m5
    waitmovement 0x0
    special 0x114
    applymovement 0xFF @m3
    waitmovement 0x0
    pause 0x20
    applymovement 0xFF @m6
    waitmovement 0x0
    clearflag 0x531
    showsprite 0x4
    pause 0x15
    applymovement 0x4 @m7
    waitmovement 0x0
    message @t5 6
    applymovement 0xFF @m8
    applymovement 0x4 @m8
    waitmovement 0x0
    message @t6 6
    special 0x113
    applymovement 0x7F @m9
    waitmovement 0x0
    special 0x114
    fadedefault
    message @t7 6
    special 0x113
    applymovement 0x1 @m10
    applymovement 0x7F @m10
    waitmovement 0x0
    special 0x114
    trainerbattle 0x1 0x2DF 0x0 @before @after @further
    end
    
    #org @further
    message @t8 6
    applymovement 0x2 @m11
    applymovement 0x3 @m11
    waitmovement 0x0
    message @t9 6
    applymovement 0x2 @m11
    applymovement 0x3 @m11
    waitmovement 0x0
    message @t10 6
    fadescreen 0x1
    hidesprite 0x1
    setflag 0x532
    hidesprite 0x2
    setflag 0x533
    hidesprite 0x3
    setflag 0x534
    hidesprite 0x5
    setflag 0x535
    special 0x113
    applymovement 0x7F @m12
    waitmovement 0x0
    special 0x114
    special 0x0
    fadescreen 0x0
    pause 0x10
    applymovement 0x4 @m7
    applymovement 0xFF @m13
    waitmovement 0x0
    message @t11 6
    applymovement 0x4 @m14
    applymovement 0xFF @m14
    waitmovement 0x0
    message @t12 6
    applymovement 0x4 @m7
    applymovement 0xFF @m13
    waitmovement 0x0
    message @t13 6
    applymovement 0x4 @m16
    waitmovement 0x0
    hidesprite 0x4
    setflag 0x531
    setvar 0x5027 0x1
    release
    end
    
    #org @m15
    #raw 0x10
    #raw 0x10
    #raw 0xFE
    
    #org @m16
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0xFE
    
    #org @t13
    = Anyways, I'm going to OLIVETREE\nCITY. I'm going to collect all of\lthe gym badges and complete the\lPOKéDEX.\pI'm not sure what you or \v\h06\nwill do, but remember this, I'll\lalways be close by!\pSee ya!
    
    #org @t12
    = The LAPRAS is gone. Oh well.
    
    #org @m14
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @t11
    = LUKE: \v\h01, I was going to ask\nyou if you wanted to battle...\pBut man, that was weird. I guess\nthose were the same black suits\lthat we saw at OAKWOOD TOWN.\pThey call themselves TEAM SHADOW.\nWhat do they even want, anyways?\pOh, look!
    
    #org @m13
    #raw 0x3
    #raw 0xFE
    
    #org @m12
    #raw 0x10
    #raw 0x12
    #raw 0xFE
    
    #org @t10
    = GRUNTS: SIR!
    
    #org @t9
    = GRUNTS: SIR!\pVALANCE: Let us departure at once!\nWe'll find another POKéMON to get\lus to MONATIOUS ISLAND...
    
    #org @m11
    #raw 0x21
    #raw 0x21
    #raw 0xFE
    
    #org @t8
    = VALANCE: What? Why are you getting\nin our way? Err..\pGRUNTS!
    
    #org @after
    = Err.. How..?
    
    #org @before
    = Prepare to battle!
    
    #org @m10
    #raw 0x10
    #raw 0xFE
    
    #org @t7
    = I am done playing games with you.
    
    #org @m9
    #raw 0x13
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @t6
    = VALANCE: Okay, you are done.
    
    #org @m8
    #raw 0x1
    #raw 0xFE
    
    #org @t5
    = LUKE: \v\h01! I was going to tell\nyou that I am going on a POKéMON\ljourney but then I ran into some\lof these black suits...
    
    #org @m7
    #raw 0x2
    #raw 0xFE
    
    #org @m6
    #raw 0x12
    #raw 0x3
    #raw 0xFE
    
    #org @m5
    #raw 0x10
    #raw 0x10
    #raw 0xFE
    
    #org @t4
    = Who do we have here?\pGRUNTS: This is the boy we were\ntalking about. He is getting in\lthe way of our plans.\pVALANCE: Hmm. You dare to disturb\nthe plans of TEAM SHADOW?\pPrepare to...\pHuh?
    
    #org @m4
    #raw 0x8
    #raw 0xFE
    
    #org @t3
    = VALANCE: Hmm?
    
    #org @m3
    #raw 0x0
    #raw 0xFE
    
    #org @t2
    = GRUNTS: B..B..Boss!
    
    #org @m2
    #raw 0x0
    #raw 0x62
    #raw 0xFE
    
    #org @t1
    = VALANCE: Ah, yes. LAPRAS.\nYou will come with me. I need\lyour surfing abilities so I can\lfinally get to MONATIOUS ISLAND.
    
    #org @m1
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0xFE

    Everything works out great, but at the end of the script, the player freezes and can't move... Help please?
     

    miksy91

    Dark Energy is back in action! ;)
    1,480
    Posts
    15
    Years
  • Hello, I have a problem with this script:

    Code:
    special 0x114
    trainerbattle 0x1 0x2DF 0x0 @before @after @further
    end

    Everything works out great, but at the end of the script, the player freezes and can't move... Help please?
    What's specifically this "end" of the script?
    Anyway, I haven't been keeping an eye an FR's scripting system that much but as far as I remember, when executing trainerbattle, these "@before, @after, @further" are pointers used when looking for text data to show.

    I couldn't find @before & @after at all so perhaps those work but @further points to script data instead. Currently, the game looks for text to display but instead, you're trying to use a message -code. Basically, it tries to display text through that script data in @further.
     

    johnr754

    I am JOHN, heck yeah!
    78
    Posts
    14
    Years
  • I'm not sure why you have the additional 0x0 0x0 0x0 at the end of the "wildbattle" command, but they are not needed. Try getting rid of them and see if that works. Also, if the Pokemon is not holding an item, you don't need the first 0x0 either. Just "wildbattle 0x90 0x1E".
    I tried doing that; it said I was missing #define or #parameter on line 8. Also, I'm doing this for Pokémon Emerald Version.

    They were once one post, but can anyone help?
     

    Renegade

    Time for real life...
    995
    Posts
    12
    Years
  • What's specifically this "end" of the script?
    Anyway, I haven't been keeping an eye an FR's scripting system that much but as far as I remember, when executing trainerbattle, these "@before, @after, @further" are pointers used when looking for text data to show.

    I couldn't find @before & @after at all so perhaps those work but @further points to script data instead. Currently, the game looks for text to display but instead, you're trying to use a message -code. Basically, it tries to display text through that script data in @further.

    Na, my script was correct. I just needed to put something extra in it. But thanks anyways.
     

    johnr754

    I am JOHN, heck yeah!
    78
    Posts
    14
    Years
  • Again, can anyone help me with this? Whenever I try to compile it, it says that I have to add define or parameter in line 8. Here is the script:

    Spoiler:
     

    blue

    gucci
    21,057
    Posts
    16
    Years
  • Again, can anyone help me with this? Whenever I try to compile it, it says that I have to add define or parameter in line 8. Here is the script:

    Spoiler:
    Spoiler:
    Spoiler:
    Spoiler:
    Spoiler:
     
    Last edited:

    johnr754

    I am JOHN, heck yeah!
    78
    Posts
    14
    Years


  • Try compiling this, it works fine for me (Make sure you set the Person ID to the flag number which I've put as 1261)
    Spoiler:

    That did not work. It said the same message. Missing #define or parameter.

    It's for Pokémon Emerald, if you were wondering. I'm also using XSE 1.1.1.
     

    machomuu

    Stuck in Hot Girl Summer
    10,507
    Posts
    16
    Years
  • Also, could someone help me with this? Rather than giving the Pokemon it skips to the given text.
    Spoiler:
    Sounds like Flag 0x828 is already activated.
     

    miksy91

    Dark Energy is back in action! ;)
    1,480
    Posts
    15
    Years
  • By what exactly? This is a clean FR ROM where I have only used Flags 1200+
    Depends on what flag no. 828 stands for in the original rom file. For example, the flag of old man, in Viridian City who teaches you how to catch a pokemon, is originally set (1) when the "game starts" (or you'll arrive at your house and can move) and is cleared (0) at the event when Pokedex is gotten.
    *Of course it could have been programmed otherwise but I think this is how Gamefreak wants to do the stuff

    So I'd assume flag 828 is set during the intro sequence (along with some other flags).
     

    blue

    gucci
    21,057
    Posts
    16
    Years
  • Depends on what flag no. 828 stands for in the original rom file. For example, the flag of old man, in Viridian City who teaches you how to catch a pokemon, is originally set (1) when the "game starts" (or you'll arrive at your house and can move) and is cleared (0) at the event when Pokedex is gotten.
    *Of course it could have been programmed otherwise but I think this is how Gamefreak wants to do the stuff

    So I'd assume flag 828 is set during the intro sequence (along with some other flags).

    Ah right, Okay well it's fine now, I've fixed it so thanks.
     
    Status
    Not open for further replies.
    Back
    Top