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

Articuno23

Sub-Zero
16
Posts
12
Years
    • Seen May 31, 2012
    #org 0x71C7CC
    lockall
    setvar 0x7001 0x0
    goto 0x71C830
    end

    '-----------------------
    #org 0x1C830
    textcolor 0x0
    msgbox 0x71CBB0 '"come here message."
    callstd 0x4
    closeonkeypress
    playsong 0x110 0x0
    compare 0x7001 0x0
    if 0x1 call 0x71CC2C
    compare 0x7001 0x1
    if 0x1 call 0x8C458C
    compare 0x7001 0x2
    if 0x1 call 0x8C45F0
    msgbox 0x93788C 'going to boat msg
    callstd 0x4
    closeonkeypress
    applymovement 0x5 0x937760 'disappear off screen sequence
    waitmovement 0x0
    fadedefault
    clearflag 0x9000
    releaseall
    end

    '-----------------------
    #org 0x1CC2C 'nearest tile
    applymovement MOVE_PLAYER 0x7200B0 'player move
    waitmovement 0x0
    return

    '-----------------------
    #org 0xC458C '2 nearest tile
    applymovement MOVE_PLAYER 0x8C4654 'move player
    waitmovement 0x0
    return

    '-----------------------
    #org 0xC45F0 '3 tile away
    applymovement MOVE_PLAYER 0x8C471C 'move player
    waitmovement 0x0
    return


    '-----------
    ' Movements
    #org 0x37760 'diasapear
    #raw 12 'Step Left (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw 13 'Step Right (Normal)
    #raw 13 'Step Right (Normal)
    #raw 13 'Step Right (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw FE 'End of Movements

    #org 0x200B0 '1 tile
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw FE 'End of Movements

    #org 0xC4654 '2 tile
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw FE 'End of Movements


    #org 0xC471C '3 tile
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw FE 'End of Movements
    '---------
    ' Messages
    #org 0x1CBB0
    = Hello v\h01, come quick.

    #org 0x3788C
    = I'm heading to the boat now.

    This script I wrote isn't working at all, I have tried to make the player as soon as he enters the building to go up and see prof OAK. But when ever he steps on the green scripting tiles I have set with this code on them the game freezes. I am using XSE version 1.0.0 and AdvancedMap 1.95(Latest version) and running the Rom for testing on VisualBoyAdvanced version 1.72. Please help I have watched several videos, read loads of tutorials but still it doesn't work. I have also analyzed in-game scripts and tried to adapt them but with no success, I would be very, very grateful for any help, and thanks in advance.
     
    13
    Posts
    14
    Years
    • Seen Aug 23, 2011
    Yes that what i set it to, with out that code it reapears after the first step so it works, but when I leave pallet town, and come back It reapears!



    thats because you need
    setflag 0x828
    setflag 0x291
    Alright, I got the give pokemon part working, but now whichever script I make, the text boxes don't show up.
    I made this real quick:
    Spoiler:

    Any idea what I'm doing wrong?
     
    4
    Posts
    12
    Years
  • Alright, I got the give pokemon part working, but now whichever script I make, the text boxes don't show up.
    I made this real quick:
    Spoiler:
    Any idea what I'm doing wrong?
    You must insert the command 'waitmsg' after the msgbox.
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • #org 0x71C7CC
    lockall
    setvar 0x7001 0x0
    goto 0x71C830
    end

    '-----------------------
    #org 0x1C830
    textcolor 0x0
    msgbox 0x71CBB0 '"come here message."
    callstd 0x4
    closeonkeypress
    playsong 0x110 0x0
    compare 0x7001 0x0
    if 0x1 call 0x71CC2C
    compare 0x7001 0x1
    if 0x1 call 0x8C458C
    compare 0x7001 0x2
    if 0x1 call 0x8C45F0
    msgbox 0x93788C 'going to boat msg
    callstd 0x4
    closeonkeypress
    applymovement 0x5 0x937760 'disappear off screen sequence
    waitmovement 0x0
    fadedefault
    clearflag 0x9000
    releaseall
    end

    '-----------------------
    #org 0x1CC2C 'nearest tile
    applymovement MOVE_PLAYER 0x7200B0 'player move
    waitmovement 0x0
    return

    '-----------------------
    #org 0xC458C '2 nearest tile
    applymovement MOVE_PLAYER 0x8C4654 'move player
    waitmovement 0x0
    return

    '-----------------------
    #org 0xC45F0 '3 tile away
    applymovement MOVE_PLAYER 0x8C471C 'move player
    waitmovement 0x0
    return


    '-----------
    ' Movements
    #org 0x37760 'diasapear
    #raw 12 'Step Left (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw 13 'Step Right (Normal)
    #raw 13 'Step Right (Normal)
    #raw 13 'Step Right (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw 10 'Step Down (Normal)
    #raw FE 'End of Movements

    #org 0x200B0 '1 tile
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw FE 'End of Movements

    #org 0xC4654 '2 tile
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw FE 'End of Movements


    #org 0xC471C '3 tile
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw 12 'Step Left (Normal)
    #raw 12 'Step Left (Normal)
    #raw 11 'Step Up (Normal)
    #raw 11 'Step Up (Normal)
    #raw FE 'End of Movements
    '---------
    ' Messages
    #org 0x1CBB0
    = Hello v\h01, come quick.

    #org 0x3788C
    = I'm heading to the boat now.

    This script I wrote isn't working at all, I have tried to make the player as soon as he enters the building to go up and see prof OAK. But when ever he steps on the green scripting tiles I have set with this code on them the game freezes. I am using XSE version 1.0.0 and AdvancedMap 1.95(Latest version) and running the Rom for testing on VisualBoyAdvanced version 1.72. Please help I have watched several videos, read loads of tutorials but still it doesn't work. I have also analyzed in-game scripts and tried to adapt them but with no success, I would be very, very grateful for any help, and thanks in advance.

    Select the green script tile and make sure that the Unknown and Variable Number are set to these:
    after%20change.jpg
     
    4
    Posts
    12
    Years
  • Ah, I'll try it out.
    May I know why I should put that there?

    EDIT: When I try to compile it says: unknown keyword 'waitmsg', I'm using XSE.
    Because the command 'closeonkeypress' close the box with the message, but it must work after the message, so you insert 'waitmsg' that lock the script until the end of the message.
    It's strange, what version of XSE do you use? I use XSE 1.1.1 and I haven't that problem.
     
    13
    Posts
    14
    Years
    • Seen Aug 23, 2011
    Because the command 'closeonkeypress' close the box with the message, but it must work after the message, so you insert 'waitmsg' that lock the script until the end of the message.
    It's strange, what version of XSE do you use? I use XSE 1.1.1 and I haven't that problem.

    Ah, I was still using v1, stupid me xD

    EDIT: the link in HackMew's tools factory doesn't seem to work, could you possible provide me with another one?
     

    Articuno23

    Sub-Zero
    16
    Posts
    12
    Years
    • Seen May 31, 2012
    DrFuji: Select the green script tile and make sure that the Unknown and Variable Number are set to these:
    i have just tried this however my unknown and varnumber are set out a little bit different as you can see in the screen shot below. So i put the varnumber in but the unknown only lets me put in 2 digit numbers so i put in $03 and $4050 in the varnumber. I did this for all 3 green scripting tiles. 2 of them with the offset of the coding in my post before froze like normal and the music kept playing like normal. However 1 of the tiles when i step on it it asks me if I "Want the fire pokemon charmander" and if i step off it and on it again it keeps asking. Later i noticed the offset was the wrong one for my script i posted before. I changed the offset to the correct one and it keeps freezing. The unknown and varnumbers are $03 and $4050 but it still freezes. However with the script of the "choose pokemon" when stepped on the tiles respond and the game doesn't freeze but i don't want to choose a starting pokemon as soon as i come through the building door :D. Also could you tell me where you got the $4050 from please. I am guessing $03 is just the standard number for unknown. Sorry for messy writing on screen shot (touchpad) Thanks a lot. :)
     
    13
    Posts
    14
    Years
    • Seen Aug 23, 2011
    Yay! I finally got it to work thanks to ~merlino~, but now I have yet another problem: whenever I enter a battle it gives me the safari zone options instead of the regular battle options O.o

    EDIT: It doesn't give me the pokemon actually, it just makes me be in a safari, if I press 'retire' in the menu it teleports me to the Fuchsia city safari zone and I have no pokemon nor pokedex. O.o
     

    Articuno23

    Sub-Zero
    16
    Posts
    12
    Years
    • Seen May 31, 2012
    Yes,thanks to DrFuji i have it working now. I used a different script but the same unknown and varnumber!:
    #dynamic 0x800000

    #org @start
    lock
    faceplayer
    checkflag 0x200
    if 0x1 goto @done
    msgbox @message1
    boxset 0x6
    showsprite 1
    applymovement 0xFF @follow
    waitmovement 0x0
    applymovement 1 @movements
    waitmovement 0x0
    pause 0x30
    msgbox @message
    boxset 0x6
    msgbox @message2
    boxset 0x6
    applymovement 1 @goboat
    waitmovement 0x0
    hidesprite 1
    setflag 0x200
    setflag 0x1000
    release
    end

    #org @done
    release
    end

    #org @message1
    = Hello \v\h01, come quick!
    #org @message
    = Hi \v\h01, we must hurry.\pYou're the last one to visit.\nDid you sleep in?\pAnyway we are all heading to the main\nland, but you will need a Pok\h1Bmon!

    #org @movements
    #raw 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0x10 0x10 0x13 0x01 0xFE

    #org @follow
    #raw 0x11 0x11 0x12 0x12 0x12 0x12 0x12 0x12 0x01 0xFE

    #org @message2
    = There are only 3 Pok\h1Bmon left.\nMake your choice wisely.\pI will meet you on the boat.

    #org @goboat
    #raw 0x10 0x13 0x13 0x13 0x13 0x13 0x13 0x10 0xFE

    However, I have yet another problem. Once the sprite has exited the room his sprite is still at the starting place at the top of the room. I tried starting him off as a Hidden sprite but when i triggered the script it showed the first message and then weirdly it started the game again instead of doing the movements!
    P.S if DrFuji or anyone else could tell me why the Varnumber works as $4050 i would be very grateful, I really need to know for future scripts in this ROM. Thanks much :D
     
    58
    Posts
    13
    Years
    • Seen Jan 3, 2015
    In an attempt to learn some scripting, I face a rather annoying and time-consuming problem with a conditional segment. In C/C++ or programming languages in general, you have the option of using if condition in versatile ways.

    Code:
    if (x > 5 || y < 2)
        printf("Something");
    You have the logical or operator, which pretty much saves time through including multiple conditions in one if statement. My question would be: when using compare and if in XSE, which is similar to the if keyword in C, is it possible to include more than one condition in a single segment? Or include a range (from 0x1 to 0x6)?As such:

    Code:
    compare 0x8004 (0x1 [B]or[/B] 0x2 [B]or[/B] 0x3...)
        if 0x1 goto @pointer
    I might just be blabbering for nothing, and it turns out to be an obvious answer. But, any help is appreciated. Thank you in advance.
     
    Last edited:
    5,256
    Posts
    16
    Years
  • In an attempt to learn some scripting, I face a rather annoying and time-consuming problem with a conditional segment. In C/C++ or programming languages in general, you have the option of using if condition in versatile ways.

    Code:
    if (x > 5 || y < 2)
        printf("Something");
    You have the logical or operator, which pretty much saves time through including multiple conditions in one if statement. My question would be: when using compare and if in XSE, which is similar to the if keyword in C, is it possible to include more than one condition in a single segment? Or include a range (from 0x1 to 0x6)?As such:

    Code:
    compare 0x8004 (0x1 [B]or[/B] 0x2 [B]or[/B] 0x3...)
        if 0x1 goto @pointer
    I might just be blabbering for nothing, and it turns out to be an obvious answer. But, any help is appreciated. Thank you in advance.
    Unfortunately the only way to do this would be, using your example of three possible outcomes:
    Code:
    compare 0x8004 0x1
    if 0x1 goto @pointer1
    compare 0x8004 0x2
    if 0x1 goto @pointer2
    --stuff for pointer 3---
     

    colcolstyles

    Yours truly
    1,588
    Posts
    15
    Years
  • In an attempt to learn some scripting, I face a rather annoying and time-consuming problem with a conditional segment. In C/C++ or programming languages in general, you have the option of using if condition in versatile ways.

    Code:
    if (x > 5 || y < 2)
        printf("Something");
    You have the logical or operator, which pretty much saves time through including multiple conditions in one if statement. My question would be: when using compare and if in XSE, which is similar to the if keyword in C, is it possible to include more than one condition in a single segment? Or include a range (from 0x1 to 0x6)?As such:

    Code:
    compare 0x8004 (0x1 [B]or[/B] 0x2 [B]or[/B] 0x3...)
        if 0x1 goto @pointer
    I might just be blabbering for nothing, and it turns out to be an obvious answer. But, any help is appreciated. Thank you in advance.

    The games' scripting language doesn't have any of those nifty high-level tools. You'd have to do it like this for logical or (||):

    Code:
    compare VAR1 5
    if B_> goto @true
    compare VAR2 2
    if B_< goto @true

    And I usually use something like this for logical and (&&):

    Code:
    compare VAR1 5
    if B_> call @check2
    goto @false
    
    #org @check2
    compare VAR2 2
    if B_< goto @true
    return
     
    58
    Posts
    13
    Years
    • Seen Jan 3, 2015
    Unfortunately the only way to do this would be, using your example of three possible outcomes:
    Code:
    compare 0x8004 0x1
    if 0x1 goto @pointer1
    compare 0x8004 0x2
    if 0x1 goto @pointer2
    --stuff for pointer 3---

    The games' scripting language doesn't have any of those nifty high-level tools. You'd have to do it like this for logical or (||):

    Code:
    compare VAR1 5
    if B_> goto @true
    compare VAR2 2
    if B_< goto @true
    And I usually use something like this for logical and (&&):

    Code:
    compare VAR1 5
    if B_> call @check2
    goto @false
    
    #org @check2
    compare VAR2 2
    if B_< goto @true
    return

    Oh well. Thank you for the reply.

    Another simple question: does the free space in a FR ROM start at 0x800000? Or before?
     

    metapod23

    Hardened Trainer
    673
    Posts
    15
    Years
    • Seen Aug 18, 2016
    Could anyone tell me how to work out varnumbers Please need help urgently

    varnumbers are variables. Most variables are set a 0 when the game begins. It is understood that variables from 4050 and above are generally unused by the game and its mechanics, and so are safe to use for hackers.

    Variables are used to activate scripts. If you set a script's variable # as 4050, and its var value at 0000, then that script will activate when stepped on as long as variable 4050 is set to 0. Since all variables are set to 0 when the game begins, that script will activate whenever you step on it.

    In order to deactivate the script, you would need to set the variable to a different value in the script itself. So if you wanted the script to only activate the first time you step on it, you would have to put:

    Code:
    setvar 0x4050 0x1

    in the script itself. With variable 4050 set to 0001, the script will not activate again, because you've told it in A-Map to only activate when 4050 is set to 0.

    For future scripts, it is recommended that you use other variables, unless for some reason the future scripts are dependent on the previous one. For instance, you could have a second script that uses var # 4050 and value 0001. That script will only activate when var 4050 is set to value 0001, which means it will only activate once the first script has been fully executed.

    I hope that makes it a bit clearer.
     

    Vittorini

    Expert Trainer
    24
    Posts
    14
    Years

  • What version of XSE do you use?
    You see... if you're using 1.1.1 then it's okay, but if you're using older version msgbox commands needs callstd command.
    So instead of msgbox @test 0x5
    It should be like this:
    msgbox @test
    callstd 0x5


    No, I'm using the most up to date version of XSE. But what's even stranger, I tried the same script on a different map (same offset and everything) and it working perfectly! The script just did not want to work on a certain map I guess. I really have no idea what happened.
     

    Vittorini

    Expert Trainer
    24
    Posts
    14
    Years
  • Perhaps the map in which it doesn't work has an interefering level script?

    Perhaps, but I doubt it. The map the event was on was Route 1. I don't really have any knowledge of level scripts though. I really think I just have a bad ROM. I might try downloading a different version later.
     

    Satoshi Ookami

    Memento Mori
    14,254
    Posts
    15
    Years

  • Another simple question: does the free space in a FR ROM start at 0x800000? Or before?
    Not exactly... you see... Free Space in every ROM is practically everywhere.
    Though it's very common to use 800000 as main offset.
    But you can use also 700000. =)

    No, I'm using the most up to date version of XSE. But what's even stranger, I tried the same script on a different map (same offset and everything) and it working perfectly! The script just did not want to work on a certain map I guess. I really have no idea what happened.
    That's weird... it really might be your ROM...
     
    Status
    Not open for further replies.
    Back
    Top