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

trebornosliw

Learning
516
Posts
14
Years
    • Seen Jul 22, 2012
    There are certain flags you can use for this. 2c is one of them - it's the one used to hide Professor Oak's sprite in Pallet Town. If you set any sprite to this, it will stay hidden on the map until a script activates a showsprite command for it. There's also a similar flag for the people in Saffron City, 3e or 3f or something.



    In the script that you're using to set the flag, use "hidesprite" to hide the sprite you don't want to be seen. If you're hiding a sprite on a map other than the one you're in at the time, then you'll probably have to make a script for the header of the map that sprite is in.



    I'm not sure how it was done in the Eruption hack, but one way to do this is to make a sprite of the thing you want to appear - like how the small trees that get cut aren't actually part of the terrain, but are separate person events. Like, if you were going to cut a hedge, you could put in a sprite with the image of a hedge, then hide the sprite to allow passage.

    Hope some of this helps!
    Okay, I get that now, but what do you mean by "set a flag" to someone? I know the usual check/setflag scripts, but I'm not sure what you mean. Do you mean I need to have something like:
    checkflag 0x2C
    if 0x1 goto @appear
    Or something like that?

    How do I include a map header in a script?

    And I don't mean editing a sprite, I mean actually editing the terrain, but this info is helpful anyway.
     

    metapod23

    Hardened Trainer
    673
    Posts
    15
    Years
    • Seen Aug 18, 2016
    Okay, I get that now, but what do you mean by "set a flag" to someone? I know the usual check/setflag scripts, but I'm not sure what you mean. Do you mean I need to have something like:
    checkflag 0x2C
    if 0x1 goto @appear
    Or something like that?

    How do I include a map header in a script?

    And I don't mean editing a sprite, I mean actually editing the terrain, but this info is helpful anyway.

    What I mean by set a flag to someone, is to put "2C" in the PERSON ID of that particular sprite. You can't permanently hide a sprite unless it has a Person ID. When you put 2C into a sprite's Person ID, it will stay hidden on the map. It will only appear when you activate a script with showsprite - And remember to use the sprite number, not the ID number when doing the showsprite command.

    As for the header, you'd have to go to the HEADER tab in AdvanceMap. There's a place fore Headers called MAP SCRIPT. These are basically scripts that are triggered once you enter a map. Most towns and cities have headers already, because the game needs to "sethealingplace" for each one when you enter (for whatever reason). You would have to put whatever's in the header already in your new script, then add to it and place the script number in the header slot.

    So, for instance, let's say you had a script with a setvar 0x6000 0x1 earlier, and you wanted to make a sprite appear in a later map only if that script was activated. You could put something like:

    Spoiler:


    Or something like that. Though I'm not sure if using the setvar command on a different variable between the two events will mess this up. If so, you might need to set it to 0x2 or 0x3 or 0x4 0r 0x5 instead, and not set another variable to that number in the meantime, but I haven't tested this, I'm just speculating.

    Sorry if this sounds complicated. I'm still figuring some of it out myself ...
     

    trebornosliw

    Learning
    516
    Posts
    14
    Years
    • Seen Jul 22, 2012
    Okay, thanks! I'll try this out.

    For anyone looking at this thread, I'd still like to know how to change terrain.
    Thanks again Metapod23!
    Oh, and can anyone tell me how to set a script to run as soon as I enter the map?
     
    Last edited:

    cooley

    ///Keepin' it simple
    1,148
    Posts
    17
    Years
  • Okay, thanks! I'll try this out.

    For anyone looking at this thread, I'd still like to know how to change terrain.
    Thanks again Metapod23!
    Oh, and can anyone tell me how to set a script to run as soon as I enter the map?
    Change Terrain? Like setmaptile? xD
    EDIT: For your last question, look at the link below

    Yeah, trust me.

    And I know that's not the problem anyway, even with coordinates that are are within the map it still goes to black when that script is set to run on entering the map.

    Is there a way to make it run a script after that warpmuted?
    Well, what Samike said, except I wrote a tutorial that explains it better than that. (No offense Samike ^_^).

    Here's the link
    http://www.pokecommunity.com/showthread.php?t=141650

    I suggest you scroll down to the "extras" section
     

    Aljam

    [i]Sweepin' ain't easy...[/i]
    615
    Posts
    15
    Years
  • This is a pretty lame scripting based question, but, how do you make it so that as soon as you start playing (when you're in the room) It starts a script? (without moving down a tile from the start position)
     

    trebornosliw

    Learning
    516
    Posts
    14
    Years
    • Seen Jul 22, 2012
    Change Terrain? Like setmaptile? xD
    Yes, actually, but how do I use it? For instance, how do I define a certain tile to be changed and the tile to change it to?
    Thanks for your answer to my other question, by the way, this tutorial is terrific.
     

    trebornosliw

    Learning
    516
    Posts
    14
    Years
    • Seen Jul 22, 2012
    Does anyone know to what events the flags 255 and 256 apply in Firered?

    @Ash 493; Check the tutorials section. Someone wrote up a full description of how to do that.
     

    monkeyman2092

    Aipom Awesome!!
    140
    Posts
    14
    Years
    • Seen Sep 7, 2009
    This is a pretty lame scripting based question, but, how do you make it so that as soon as you start playing (when you're in the room) It starts a script? (without moving down a tile from the start position)

    That require two Map Scripts. They can be found under "Header". You need a "Validates Values 02" and a "On enter map/not on menu close 03" script. The Validates Values for the script itself, and the "On enter map" to prevent it from happening twice.
     

    cooley

    ///Keepin' it simple
    1,148
    Posts
    17
    Years
  • This is a pretty lame scripting based question, but, how do you make it so that as soon as you start playing (when you're in the room) It starts a script? (without moving down a tile from the start position)
    Exactly what Monkeyman said, and if you get lost here is a tutorial:

    http://www.pokecommunity.com/showthread.php?t=141650
    It should be down in the section called "Extras"

    trebornosliw said:
    Yes, actually, but how do I use it? For instance, how do I define a certain tile to be changed and the tile to change it to?
    Thanks for your answer to my other question, by the way, this tutorial is terrific.
    And don't forget the "Special 0x8E" after it. XSE doesn't tell you that.
     
    857
    Posts
    15
    Years
  • I haven't scripted in a while :/
    What's wrong with this script?
    Code:
    '-----------------------
    #org 0x765767
    lock
    faceplayer
    checkflag 0x2222
    if 0x1 goto 0x87657D3
    msgbox 0x87657DC '"You have the THUNDERBADGE?\nYou mus..."
    compare LASTRESULT 0x1
    if 0x1 goto 0x8765795
    msgbox 0x8765872 '"That's okay.\pI'm sure someone else..."
    release
    end
    
    '-----------------------
    #org 0x7657D3
    msgbox 0x876592F '"Are you taking good care\nof Squrit..."
    release
    end
    
    '-----------------------
    #org 0x765795
    givepokemon 0x9 0x14 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox 0x87658AE '"[black_fr]You received a Squirtle!"
    waitfanfare
    closeonkeypress
    setflag 0x2222
    msgbox 0x87658D2 '"[black_fr]Would you like to give a\..."
    compare LASTRESULT 0x1
    if 0x1 call 0x87657CC
    msgbox 0x876590D '"OK! Please treat Squirtle right!"
    release
    end
    
    '-----------------------
    #org 0x7657CC
    call 0x81A74EB
    return
    
    '-----------------------
    #org 0x1A74EB
    fadescreen 0x1
    special 0x9E
    waitstate
    return
    
    
    '---------
    ' Strings
    '---------
    #org 0x7657DC
    = You have the THUNDERBADGE?\nYou must be a good trainer!\lI just caught a squirtle that was\lgetting into mishcheif. Would you\ltake good care of it?
    
    #org 0x765872
    = That's okay.\pI'm sure someone else will\ntake care of it.
    
    #org 0x76592F
    = Are you taking good care\nof Squritle?
    
    #org 0x7658AE
    = [black_fr]You received a Squirtle!
    
    #org 0x7658D2
    = [black_fr]Would you like to give a\nnickname to Squirtle?
    
    #org 0x76590D
    = OK! Please treat Squirtle right!
     

    monkeyman2092

    Aipom Awesome!!
    140
    Posts
    14
    Years
    • Seen Sep 7, 2009
    I haven't scripted in a while :/
    What's wrong with this script?
    Code:
    '-----------------------
    #org 0x765767
    lock
    faceplayer
    checkflag 0x2222
    if 0x1 goto 0x87657D3
    msgbox 0x87657DC '"You have the THUNDERBADGE?\nYou mus..."
    compare LASTRESULT 0x1
    if 0x1 goto 0x8765795
    msgbox 0x8765872 '"That's okay.\pI'm sure someone else..."
    release
    end
     
    '-----------------------
    #org 0x7657D3
    msgbox 0x876592F '"Are you taking good care\nof Squrit..."
    release
    end
     
    '-----------------------
    #org 0x765795
    givepokemon 0x9 0x14 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox 0x87658AE '"[black_fr]You received a Squirtle!"
    waitfanfare
    closeonkeypress
    setflag 0x2222
    msgbox 0x87658D2 '"[black_fr]Would you like to give a\..."
    compare LASTRESULT 0x1
    if 0x1 call 0x87657CC
    msgbox 0x876590D '"OK! Please treat Squirtle right!"
    release
    end
     
    '-----------------------
    #org 0x7657CC
    call 0x81A74EB
    return
     
    '-----------------------
    #org 0x1A74EB
    fadescreen 0x1
    special 0x9E
    waitstate
    return
     
     
    '---------
    ' Strings
    '---------
    #org 0x7657DC
    = You have the THUNDERBADGE?\nYou must be a good trainer!\lI just caught a squirtle that was\lgetting into mishcheif. Would you\ltake good care of it?
     
    #org 0x765872
    = That's okay.\pI'm sure someone else will\ntake care of it.
     
    #org 0x76592F
    = Are you taking good care\nof Squritle?
     
    #org 0x7658AE
    = [black_fr]You received a Squirtle!
     
    #org 0x7658D2
    = [black_fr]Would you like to give a\nnickname to Squirtle?
     
    #org 0x76590D
    = OK! Please treat Squirtle right!

    1. You use [player], not [black_fr].
    2. You don't have the flag for the THUNDERBADGE.
    3. Oh yeah, you need a "yesnobox" command or a "callstd 0x5" above "compare LASTRESULT 0x1"
     

    cooley

    ///Keepin' it simple
    1,148
    Posts
    17
    Years
  • 1. You use [player], not [black_fr].
    2. You don't have the flag for the THUNDERBADGE.
    3. Oh yeah, you need a "yesnobox" command or a "callstd 0x5" above "compare LASTRESULT 0x1"
    He was not trying to use [player] he was trying to make the msgbox text black Lol
     

    BlitŻ1

    guahh my dog is so cute
    472
    Posts
    15
    Years
  • Yesterday, I tried scripting in Ruby for the first time( I've been loyal to FR for so long...) and my first script didn't work. I sure there weren't any probs, but when I stepped on the tile it didn't activiate.

    So how do I fix this, is there something different I need to put in the unknown and var vlues boxes? Or is it something else?
     
    8
    Posts
    14
    Years
    • Seen Aug 10, 2009
    prof oak script

    i am currently remakeing the script prof oak uses in firered...

    MY SCRIPT:
    Code:
    #org $script
    lock
    faceplayer
    message $talk
    $talk 1 = Wait! Follow me...
    boxset 6
    applymovement 1 $move
    $move 1 ; #binary 0x10 0x10 0x10 0x10 0x10 0x10 0x13 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x13 0x13 0x13 0x11 0xFE
    applymovement 0xFF $move
    pausemove 0x0000
    release
    end

    it says mismatch... WTF!!!! cen you help me fix this?

    also just because im THAT much of a noob does anyone know where i ca n find the original Prof Oak script because i know theres also a whole part i have to add to give the pokemon...Right?
     

    ExitWound

    Boggle
    79
    Posts
    16
    Years
    • Seen Sep 22, 2016
    I'm still having problems with my script...

    This is what happens:

    http://www.youtube.com/watch?v=t4Y3MPNGsEQ

    This is the guy and the script properties:

    ScriptProblem.png


    This is the script:

    Spoiler:
     

    trebornosliw

    Learning
    516
    Posts
    14
    Years
    • Seen Jul 22, 2012
    I'm still having problems with my script...



    This is the script:

    Spoiler:
    First, I don't think you're supposed to use lock for an applymovement script.
    Second, if B_true is only for Pokescript, as far as I know. For XSE it should be if 0x1.
    If neither of those helps, you can try changing the Var number to 4050.
    Hope that helped!
    Oh, and change the guy's unknown value to 03 (the unknown right under X/Y position).
    I'm not sure why the battle just skips like that, but this might help you to actually see the OW.


    Now for my own dilemma. I have a script installed so that as soon as you walk downstairs at the game's start, a level script starts up, a little cutscene plays, and then you are supposed to be warped to map 43.0, where another level script should start up. Everything works fine except for the warp. I've tried taking out fadescreen, but nothing changed, so I put it back in. Here's the first script (I only included the script's framework, since everything else is working fine):
    Spoiler:


    And here's the second script:
    Spoiler:


    So again, what I want to happen is, after the warp in script 1, script 2 immediately starts up in the location you're warped to. Everything's fine up to the point that I actually warp, which is when the entire screen goes black. Any ideas?
     
    Last edited:

    metapod23

    Hardened Trainer
    673
    Posts
    15
    Years
    • Seen Aug 18, 2016
    Now for my own dilemma. I have a script installed so that as soon as you walk downstairs at the game's start, a level script starts up, a little cutscene plays, and then you are supposed to be warped to map 43.0, where another level script should start up. Everything works fine except for the warp. I've tried taking out fadescreen, but nothing changed, so I put it back in. Here's the first script (I only included the script's framework, since everything else is working fine):
    Spoiler:


    And here's the second script:
    Spoiler:


    So again, what I want to happen is, after the warp in script 1, script 2 immediately starts up in the location you're warped to. Everything's fine up to the point that I actually warp, which is when the entire screen goes black. Any ideas?

    Maybe because map 0x43 doesn't exist. When putting in the codes for maps, you have to use the hex counting. So 0x43 = 0x67. Try:

    warp 0x2B 0x0 0x1 0x1 0x9

    instead and see if it leads you to the right place.
     
    Status
    Not open for further replies.
    Back
    Top