• 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.
32
Posts
13
Years
    • Seen Dec 5, 2023
    minor said:
    A) what does altering the var number on tile scripts do? (the ones you walk on)
    The var numbers for scripts on map tiles give those scripts unique identities. It's been my experience that some scripts don't like to run if they don't have a variable assigned to them (but I'm probably doing something wrong).
    With a var number assigned to the script, you can "turn off" the script simple by assigning a different value to that variable in a script.
    That is, a good way to ensure that a script only runs once (even after warping back into an area) is to include a line such as "setvar 0x5000 (or whatever your scripts assigned var is) 0x1"

    As far as your other concerns, just by looking at your scripts I can't say for sure; however I can say that you do not need the "pause" line at all.
    Setting flag 0x828 may or may not be the problem; it's the flag which enables the "Pokemon" section on the Start menu.

    minor said:
    anyways here the script. appreciate it if you could point out what's wrong and how i can fix it? thanks.

    checkflag 0x200
    if 0x1 goto @done
    faceplayer
    msgbox @talk1 0x6
    pause 0x1
    message @talk2 0x5
    callstd 1
    if 0x1 goto @fight
    else goto @no
    end

    I don't know that it's necessary, but put "lock" and "faceplayer" at the very beginning of script; there's no need for them anywhere else after, usually.

    You entered "message" rather than "msgbox" before @talk2.
    Instead of callstd 1, put in "compare LASTRESULT 0x1"; LASTRESULT is not a command, it's a variable where data is temporarily stored. In this case, the answer to the yes/no question.

    Also, it looks like you assigned flag 0x200 to this fight/dialogue; make sure you have the script set that flag at some point, if you want it recognize that the fight has already occurred.
     
    7
    Posts
    11
    Years
    • Seen Jun 25, 2017
    SOLVED

    Game: Fire Red (US9
    Type: Level
    Editor: XSE
    The problem is it actually works, but only once, and I want it to keep happening until I set the flag.
    Script:
    Spoiler:
     
    Last edited:

    Darkdata

    15 year old me was an idiot.
    137
    Posts
    18
    Years
    • Seen Nov 25, 2013
    You can remove the flag, and the setvar from this script.
    Set the var up by one when you want the script to stop activating.
     
    154
    Posts
    11
    Years
    • Seen Jan 8, 2017
    So, I recently messed up my rom by deleting scripts and flags that were important, and someone on here told me that most people when they hack roms dont even delete the scripts and flags from the actual memory, they just take them off the map and add their own, I only deleted them because I didnt think there would b enough room for all my scripts, which leads me to my question:
    If I don't use any of the flags that are already in the game, is it possible tomake my own flags and use those? How woudl I do that?
    Also, how will I know when there isn't enough memory in my rom while making new scripted events?
     
    88
    Posts
    14
    Years
  • Pokemon FireRed At the beginning of the game when you choose a Pokemon and your rival chooses as well; I need to change that so the Player goes and gets two eggs from different aides and then the rival goes to a third aide and gets his one egg. I need that to work out so that Oak let's you leave. If deleting the battle is going to screw something up please tell me.

    I also need to know how to make a signpost script
     
    Last edited:

    tajaros

    Hi I'm dawg
    855
    Posts
    12
    Years
  • Game: Fire Red (US9
    Type: Level
    Editor: XSE
    The problem is it actually works, but only once, and I want it to keep happening until I set the flag.
    Script:
    Spoiler:

    You have to input a setvar command, use it so the event won't happen again, and again... xD

    Use the setvar you use in the map script... :) And put it in the end of the script... :)
     

    miksy91

    Dark Energy is back in action! ;)
    1,480
    Posts
    15
    Years
  • So, I recently messed up my rom by deleting scripts and flags that were important, and someone on here told me that most people when they hack roms dont even delete the scripts and flags from the actual memory, they just take them off the map and add their own, I only deleted them because I didnt think there would b enough room for all my scripts, which leads me to my question:
    If I don't use any of the flags that are already in the game, is it possible tomake my own flags and use those? How woudl I do that?
    Also, how will I know when there isn't enough memory in my rom while making new scripted events?
    Most people here rely on tools for checking where there is memory for the events you include or not. All pokemon roms have a lot of free space in them (even Emerald and 1st and 2nd gen games which I believe you're not looking an answer for). I personally delete most of the original events when I make those of my own but I'm a 2nd gen hacker and if you're going to go with FireRed for instance, you don't have to do this.

    You can't make your own flags because flags are actually bits of memory in GBA's ram. Basically, someone has probably told you data consists of 0's and 1's. Well, when a flag is unset, a certain part of memory is 0 and when that flag is set, that part of memory turns into 1. Where there is free space in ram memory, lots of 0's (in hexadecimal, shown as 00), you can make your flags set bits (value of bit - 0/1) in there.

    This probably felt a bit confusing and I know I wouldn't have understood a thing about it 2 years ago myself but still, this is how it goes. There are ought to be some unused flag bits around which you can use for unused ram memory (as explained above, contains lots of 00's of which values do not change during the gameplay). I believe there is a list of flag bits you can safely use in Research & Development section but that's only a belief (as I've seen a thread related to flags not a long time ago).
     

    Satoshi Ookami

    Memento Mori
    14,254
    Posts
    15
    Years


  • You have to input a setvar command, use it so the event won't happen again, and again... xD

    Use the setvar you use in the map script... :) And put it in the end of the script... :)
    I think that's precisly what he doesn't want.
    Since he wants script to happen over and over until the flag is set, setting the variable would be killing his wish =D
     

    tajaros

    Hi I'm dawg
    855
    Posts
    12
    Years

  • I think that's precisly what he doesn't want.
    Since he wants script to happen over and over until the flag is set, setting the variable would be killing his wish =D

    Oh, sorry I thought he said that it happens all over again and he/she doesn't want that to happen...
     
    88
    Posts
    14
    Years
  • Pokemon FireRed
    At the beginning of the game when you choose a Pokemon and your rival chooses as well; I need to change that so the Player goes and gets two eggs from different aides and then the rival goes to a third aide and gets his one egg. I need that to work out so that Oak let's you leave. If deleting the battle is going to screw something up please tell me.
    And I also need to know how to make a signpost script
     
    7
    Posts
    11
    Years
    • Seen Jun 25, 2017


    Oh, sorry I thought he said that it happens all over again and he/she doesn't want that to happen...

    Thanks, I already fixed it, I must be getting blind because I hadn't noticed I had used a setvar there, oh well, everything is good now.
     
    40
    Posts
    12
    Years
  • No, it didn't work. When has it worked for you?

    Try this, it's from diegoisawesome's xse script tutorial:

    #dynamic 0x800000

    #org @start
    checkflag 0x200
    if 0x1 goto @next
    setweather 0x3
    doweather
    setflag 0x200
    release
    end

    #org @next
    setweather 0x2
    doweather
    clearflag 0x200
    release
    end
     

    The_Show

    Banned
    43
    Posts
    12
    Years
  • Try this, it's from diegoisawesome's xse script tutorial:

    #dynamic 0x800000

    #org @start
    checkflag 0x200
    if 0x1 goto @next
    setweather 0x3
    doweather
    setflag 0x200
    release
    end

    #org @next
    setweather 0x2
    doweather
    clearflag 0x200
    release
    end

    Unfortunately this didn't work either. What I did do, however, is I plugged the weather script into a talking script. So whenever you talk to that person the weather will start... hopefully I can get the weather script to work on a level script.
    ----------------------------------
    Pokemon Ruby
    XSE
    SCRIPT BOX

    I want this script to look like a normal warp, so when you step into it it will warp you to a place, tricking the player into thinking he has actually stepped into a warp..... a little confusing but it will have a big use:

    Spoiler:


    Spoiler:


    But when I step on the box, nothing happens.
     
    Last edited:
    124
    Posts
    12
    Years
  • Unfortunately this didn't work either. What I did do, however, is I plugged the weather script into a talking script. So whenever you talk to that person the weather will start... hopefully I can get the weather script to work on a level script.

    Ah, so you are trying to make it a level script.
    If that's the case, follow my tutorial on level scripts by using your own weather script just to make sure you have the steps correct.
    Tutorial: http://www.youtube.com/watch?v=rhvDX1_b8Ek

    It could just be that you're forgetting a step in the process.
     
    154
    Posts
    11
    Years
    • Seen Jan 8, 2017
    can someone tell me whats wrong here? I'm trying to make it so if they player selects "no" he just ends the script, but if they player chooses "yes" they warp directly into the lab. but when i talk to oak, the correct thing happens when i choose "no", but when i choose "yes" he also goes to the no part of the script. I dunno why? :/

    #dynamic 0x0034EBA2
    #org @start
    lock
    faceplayer
    msgbox @1 0x5
    compare 0x1 0x0
    if 0x1 goto @warp

    msgbox @2 0x6
    release
    end

    #org @warp
    msgbox @3 0x6
    closeonkeypress
    warp 0x4 0x3 0x0 0x6 0xC
    setvar 0x4055 0x2
    release
    end

    #org @1
    = Oh! For once a trainer that\ndoesn't run off without me! Would\lyou like to follow me to my lab?

    #org @2
    = Very well then, just don't try and\ngo running off on your own!

    #org @3
    = Excellent! Let's go!
     

    Satoshi Ookami

    Memento Mori
    14,254
    Posts
    15
    Years
  • @Spade: I think the problem is with compare command...
    The usual compare command is like this: "compare LASTRESULT 0x1" which means if player chose the yes do the next command.
    But I read somewhere that the newest XSE doesn't support LASTRESULT...
    Well you may as well try it to see if it works for you.
     

    tajaros

    Hi I'm dawg
    855
    Posts
    12
    Years
  • can someone tell me whats wrong here? I'm trying to make it so if they player selects "no" he just ends the script, but if they player chooses "yes" they warp directly into the lab. but when i talk to oak, the correct thing happens when i choose "no", but when i choose "yes" he also goes to the no part of the script. I dunno why? :/

    #dynamic 0x0034EBA2
    #org @start
    lock
    faceplayer
    msgbox @1 0x5
    compare 0x1 0x0
    if 0x1 goto @warp

    msgbox @2 0x6
    release
    end

    #org @warp
    msgbox @3 0x6
    closeonkeypress
    warp 0x4 0x3 0x0 0x6 0xC
    setvar 0x4055 0x2
    release
    end

    #org @1
    = Oh! For once a trainer that\ndoesn't run off without me! Would\lyou like to follow me to my lab?

    #org @2
    = Very well then, just don't try and\ngo running off on your own!

    #org @3
    = Excellent! Let's go!

    Well everything is good except for compare 0x1 0x0, just change it to compare 0x800D 0x1, as ASH493 said LASTRESULT is not anymore recognized in the latest version of XSE, it has now been changed to 0x800D

    So for you to get the script easily here's the working script... :)
    #dynamic 0x0034EBA2
    #org @start
    lock
    faceplayer
    msgbox @1 0x5
    compare 0x800D 0x1
    if 0x1 goto @warp

    msgbox @2 0x6
    release
    end

    #org @warp
    msgbox @3 0x6
    closeonkeypress
    warp 0x4 0x3 0x0 0x6 0xC
    setvar 0x4055 0x2
    release
    end
    #org @1
    = Oh! For once a trainer that\ndoesn't run off without me! Would\lyou like to follow me to my lab?

    #org @2
    = Very well then, just don't try and\ngo running off on your own!

    #org @3
    = Excellent! Let's go!

    Hope this helps... xD
     
    9
    Posts
    14
    Years
    • Seen May 19, 2013
    Hey, not sure if this is the right place to post this. Correct me if I'm doing something wrong.

    So anyway, the problem is that, whenever I make a script, save it as a .rbc, and right click to compile, the '(LOG) Instant' window shows up and does all its usual stuff, but then just stops at the end.

    Here is the entire code if it helps any

    Code:
    #PROCESS: script.rbc F:2 for input
    ---------------------------------
     
    #OFFSET: 0, 0
    3: Code Command - checkflag [2B] 
     -> 43 &h828
    attached: "+(" into 0
    5: Code Alias
    if1 [6] 
     -> 6 1 $done
    attached: "!PTR" into 0
    - log $done in buffer 0 at byte: 5
    7: Code Alias
    loadpointer [F] 
     -> 15 &h00 $1
    attached: "
    - log $1 in buffer 0 at byte: 11
    9: Code Command - boxset [9] 
     -> 9 6
    attached: "	" into 0
    11: Code Command - applymovement [4F] 
     -> 79 &h04 $move
    attached: "O
    - log $move in buffer 0 at byte: 20
    13: Code Command - pausemove [51] 
     -> 81 &h0
    attached: "Q
    15: Code Command - applymovement [4F] 
     -> 79 &hff $move2
    attached: "Oÿ
    - log $move2 in buffer 0 at byte: 30
    17: Code Command - pause [28] 
     -> 40 &h30
    attached: "(0
    19: Code Alias
    loadpointer [F] 
     -> 15 &h00 $2
    attached: "
    - log $2 in buffer 0 at byte: 39
    21: Code Command - boxset [9] 
     -> 9 6
    attached: "	" into 0
    23: Code Command - playsound [33] 
     -> 51 &h13E
    attached: "3>" into 0
    25: Code Command - nop [1] 
     -> 1
    attached: "" into 0
    27: Code Command - applymovement [4F] 
     -> 79 &h04 $move3
    attached: "O
    - log $move3 in buffer 0 at byte: 52
    29: Code Command - applymovement [4F] 
     -> 79 &hff $move3
    attached: "Oÿ
    - log $move3 in buffer 0 at byte: 59
    31: Code Command - pausemove [51] 
     -> 81 0
    attached: "Q
    33: Code Command - fadesound [35] 
     -> 53 &h12C
    attached: "5," into 0
    35: Code Command - nop [1] 
     -> 1
    attached: "" into 0
    37: Code Command - release [6C] 
     -> 108
    attached: "l" into 0
    39: Code Command - end [2] 
     -> 2
    attached: "" into 0
     
    #OFFSET: 0, 0
    44: Code Command - release [6C] 
     -> 108
    attached: "l" into 0
    46: Code Command - end [2] 
     -> 2
    attached: "" into 0
     
    #OFFSET: 0, 0
    51: RAW DATA - raw &h62 &h12 &h12 &h12 &h12 &hFE
     
    #OFFSET: 0, 0
    56: RAW DATA - raw &h03 &hFE
     
    #OFFSET: 0, 0
    61: RAW DATA - raw &h13 &h13 &h13 &h13 &hFE
     
    #OFFSET: 0, 0
     
    #INLINE: 0, 1
    66: Encoding text: 1 1
    CODE: ÑÕÕÕÝÝÝÝèèèè«««ÿ
    - Into buffer 1
     
    #OFFSET: 0, 0
     
    #INLINE: 0, 1
    71: Encoding text: 2 1
    CODE: Óãé
    - Into buffer 1
    |
    \- Processed 820 Lines
     
    #PROCESS: C:\Users\Dustin\Desktop\script.buf F:2 for write
    ---------------------------------------------------------
    COMMENT BUFFER DROP 10 [NO COMMENT]
    DROPPING 7 Pointers
    $done at buffer 0 position 5 
    $1 at buffer 0 position 11 
    $move at buffer 0 position 20 
    $move2 at buffer 0 position 30 
    $2 at buffer 0 position 39 
    $move3 at buffer 0 position 52 
    $move3 at buffer 0 position 59 
    DROPPING 5 Offsetts
    $start at buffer 0 position 0 
    $done at buffer 0 position 72 
    $move at buffer 0 position 74 
    $move2 at buffer 0 position 80 
    $move3 at buffer 0 position 82 
    DROPPING 2 Offsetts
    $1 at buffer 1 position 0 
    $2 at buffer 1 position 16 
    BUFFER 0 DROP: 87 [+(!PTR
    BUFFER 1 DROP: 93 [ÑÕÕÕÝÝÝÝèèèè«««ÿÓãé
    |
    \- Processed 16 Buffers
     
    |
    \- Processed 820 Lines
     
    |
    \- Processed 0 Lines

    And then, the little bufrite window never pops up. (You know, the one with burn, destination, assign, and all that jazz)

    So what I'm asking is if there is any alternative way to get it up, or if I am just missing files/doing something wrong. (Weather it be with the script or with my just being outright stupid.)

    Before anyone asks, this is the code I am trying to use. (Although I HAVE tried other scripts and the same problem takes place)

    Code:
    #org $start
    countpokemon
    compare LASTRESULT 0x1
    if b_true goto $continue
    lock
    message $1
    boxset 6
    applymovement 0xFF $move
    release
    end
    
    #org $1
    $1 1 =I better check what's \nin that box...
    
    #org $move
    #raw 0x09 0xFE
    
    #org $continue
    release
    end

    Any help is appreciated guys, Thanks!!
     

    Satoshi Ookami

    Memento Mori
    14,254
    Posts
    15
    Years

  • Well everything is good except for compare 0x1 0x0, just change it to compare 0x800D 0x1, as ASH493 said LASTRESULT is not anymore recognized in the latest version of XSE, it has now been changed to 0x800D
    Hope this helps... xD
    So it's the same :D 800D was the "number" of LASTRESULT even in the old XSE... it seems it did not change that much :D
     
    Status
    Not open for further replies.
    Back
    Top