• 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.
4
Posts
11
Years
    • Seen Jun 6, 2013
    Game: Fire Red
    Editor: XSE 1.1.1
    Script: De-Leveler

    So I thought of an idea for my hack last night. It seems possible, just not quite there yet. Basically a Pokemon De-Leveler that will choose a Poke from the party and reset it to Lv 1. So Charizard gets de-leveled to Lv 1 essentially.

    I already know the problem is with the way Im comparing variables in the second check. Just not quite sure how to make it do what I want. The script functions as normal through the second check, but compare always returns 0x0, never 0x1.

    A quick explanation of the two specials used and a few others that may work better.
    Spoiler:


    Special 0c1 actually does almost everything Im looking for all on its own. Except it doesnt reset the Pokemons attacks. If anyone knows a quick way to reset that data, that might be the simplest way.

    Im also unclear as to how to create trades in game. Special 1bb might also work if someone knows how to use that one properly.

    The script below is obviously unfinished. The way it is currently set up it will be huge, unless special 0c1 can work for this. I also dont have any framework included yet for taking the original Pokemon away, but that can come later.

    I really appreciate the feedback this community always provides.
    Spoiler:
     
    Last edited:
    416
    Posts
    11
    Years
    • Seen Feb 10, 2024
    How can I check if the player has used FLASH?

    I have a simple script idea

    check if flashused
    if no call random number generator
    generate number 1-100
    if number is under 5 start poke battle
    if flash is used jump "release end"

    that way no pokebattles will appear after the player uses flash... i just dont know how to check if flash is used...

    really i only want 1 pokemon to be limited... all the other pokes wont care about flash... but thats not the point HOW DO I CHECK IF FLASH USED...
     
    154
    Posts
    11
    Years
    • Seen Jan 8, 2017
    so its been a while since ive scripted and i cant seem to get the nickname command to work.
    heres what happens. you get a pkmn, then it asks to nickname it, then if the player chooes yes, it takes them to the nickname screen, but after they input the name, they come back to where they were, but the event does not continue afterwards.
    Spoiler:
     
    416
    Posts
    11
    Years
    • Seen Feb 10, 2024
    so its been a while since ive scripted and i cant seem to get the nickname command to work.
    heres what happens. you get a pkmn, then it asks to nickname it, then if the player chooes yes, it takes them to the nickname screen, but after they input the name, they come back to where they were, but the event does not continue afterwards.
    Spoiler:

    you cannot use the command "return" when you are using "goto" or "jump"
    if you intend to "return" from the command, you must use "call"

    that should fix your issue:
    msgbox @nickname 0x5
    compare 0x800D 0x1
    if 0x1 call @name


    ------------------------------------------------------------------------------------------
    How can I check if the player has used FLASH?

    I have a simple script idea

    check if flashused
    if no call random number generator
    generate number 1-100
    if number is under 5 start poke battle
    if flash is used jump "release end"

    that way no pokebattles will appear after the player uses flash... i just dont know how to check if flash is used...

    really i only want 1 pokemon to be limited... all the other pokes wont care about flash... but thats not the point HOW DO I CHECK IF FLASH USED...


    To elaborate a bit on my previous question... this is how my script looks now:
    Spoiler:


    the red text is what I would like to replace with something that tells me if they have USED flash, rather than just having it on a team member (like checkattack)

    maybe a copybyte or something like that... if anyone knows where the byte containing the info about if the map has been flashed is...
     
    Last edited:

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • I was making a level script and for some reason every time I include the "hidesprite 0xFF" command, the script either doesn't work or glitches up beyond compare. I don't know why, but when I remove the "hidesprite 0xFF" command the script works perfectly, it's just that when I put it in (and I need it in) it suddenly decides not to work.

    Spoiler:
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • I was making a level script and for some reason every time I include the "hidesprite 0xFF" command, the script either doesn't work or glitches up beyond compare. I don't know why, but when I remove the "hidesprite 0xFF" command the script works perfectly, it's just that when I put it in (and I need it in) it suddenly decides not to work.

    Spoiler:

    There is a hidesprite command built into the applymovement script. So, instead, use this:

    Code:
    #org 0x81A59F
    lock
    applymovement 0xFF @move1
    waitmovement 0x0
    applymovement 0x1 0x881A7AE
    waitmovement 0x0
    msgbox 0x881A627 MSG_NORMAL '"This is my son, in whom I am well\..."
    goto 0x881A5BB
    
    #org @move1
    #raw 0x60 'hide_sprite
    #raw 0xFE

    Please note that this will not compile as is. This is just an example to show how to use #raw 0x60 to hide sprites.
     

    Extremeromhacker

    I need ideas
    7
    Posts
    10
    Years
    • Seen Jun 7, 2013
    I need help figuring out what is wrong with my script, It works exactly the way I want it until the very end it just freezes...

    My Script *Check The Bottom*

    #org $script
    jingle
    applymovement 0xFF $!
    $! 1 ; #binary 0x62 0xFE
    pausemove 0
    special 0x113
    applymovement 0x7F $screengo
    $screengo 1 ; #binary 0x11 0x11 0x12 0x12 0x12 0x12 0x12 0xFE
    pausemove 0
    applymovement 0x7F $screengo1
    $screengo1 1 ; #binary 0x12 0x12 0x12 0x12 0x12 0xFE
    pausemove 0
    playsound 0x13B
    nop
    applymovement 3 $jump
    $jump 1 ; #binary 0x54 0xFE
    pausemove 0
    message $gary
    $gary 1 = \c\h01\h02\v\h06: PIDGEY use TACKLE!
    boxset 6
    cry 0xA1 16
    nop
    nop
    message $pidgey
    $pidgey 1 = Pi pidge!
    boxset 6
    applymovement 4 $tackle
    $tackle 1 ; #binary 0x62 0x54 0x16 0x49 0x49 0x02 0xFE
    pausemove 0
    message $ya
    $ya 1 = \c\h01\h02\v\h06: Ya! You got em'!
    boxset 6
    cry 0xA1 21
    nop
    nop
    message $spearow
    $spearow 1 = Spea spear!
    boxset 6
    applymovement 5 $peck
    $peck 1 ; #binary 0x55 0x17 0x12 0x12 0x03 0xFE
    pausemove 0
    message $gary1
    $gary1 1 = \c\h01\h02\v\h06: Once more PIDGEY!
    boxset 6
    cry 0xA1 16
    nop
    nop
    message $pidgey
    boxset 6
    applymovement 4 $tackle
    pausemove 0
    removesprite 5
    message $gary2
    $gary2 1 = \c\h01\h02\v\h06: Great job PIDGEY, return!
    boxset 6
    applymovement 4 $return
    $return 1 ; #binary 0x13 0xFE
    pausemove 0
    removesprite 4
    applymovement 3 $who
    $who 1 ; #binary 0x62 0x03 0xFE
    pausemove 0
    applymovement 0x7F $screencome
    $screencome 1 ; #binary 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0xFE
    pausemove 0
    applymovement 0x7F $screencome1
    $screencome1 1 ; #binary 0x13 0x10 0x10 0xFE
    pausemove 0
    special 0x114
    applymovement 3 $move
    $move 1 ; #binary 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x10 0xFE
    pausemove 0
    message $hey
    $hey 1 = \c\h01\h02\v\h06: Hi, I'm \v\h06 OAK!\nMy gramps talked alot about you,\pso I waited around here to see if\nyou were the real deal.\pLet's battle!
    boxset 6
    trainerbattle 0x09 0x01 $win $lose
    $win 1 = You are good!
    $lose 1 = \hb0Was my gramps wrong?\hb0
    message $speak
    $speak 1 = \c\h01\h02\v\h06: That was a great battle!\nI hope to meet you on the road\pagain.
    boxset 6
    applymovement 3 $leave
    $leave 1 ; #binary 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0xFE
    pausemove 0
    removesprite 3
    fadesound 0x116
    nop *My script freezes right after the music goes back to normal*
    applymovement 0xFF $movement
    $movement 1 ; #binary 0x63 0x02 0xFE
    pausemove 0
    setflag 0x1203
    setvar 0x6002 0x0001
    release
    end
     

    totodile493

    Person
    11
    Posts
    13
    Years
    • Seen Jan 22, 2021
    Spoiler:

    I'm no expert, but near the end with the fadesound, did you try putting "waitfanfare" or "waitstate" or whatever it was?
     

    kearnseyboy6

    Aussie's Toughest Mudder
    300
    Posts
    15
    Years
    • Seen Jun 22, 2019
    This is my map script,

    #dynamic 0x800000

    #org @main
    checkflag 0x821
    if 0x1 goto @clear
    setflag 0x250
    end

    #org @clear
    clearflag 0x250
    end

    How ever the sprites with 250 as ID don't disappear when the badge isn't obtained.

    I used [03] On entering map/ not on menu close.

    I have tried [02] validates values ... etc with a unused variable.

    I have no idea why the script isn't working?
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • This is my map script,

    #dynamic 0x800000

    #org @main
    checkflag 0x821
    if 0x1 goto @clear
    setflag 0x250
    end

    #org @clear
    clearflag 0x250
    end

    How ever the sprites with 250 as ID don't disappear when the badge isn't obtained.

    I used [03] On entering map/ not on menu close.

    I have tried [02] validates values ... etc with a unused variable.

    I have no idea why the script isn't working?

    Have you tried entering and exiting the room?
     
    21
    Posts
    10
    Years
    • Seen Jun 15, 2013
    setwildbattle 0x90 0x32 0x0

    ^ Taken directly from Articuno's Fire Red Battle

    I know this seems very simple but can someone just breakdown that command for me please.
     

    totodile493

    Person
    11
    Posts
    13
    Years
    • Seen Jan 22, 2021
    Spoiler:


    So what I want to happen is, if flag 901 isn't activated (it becomes activated elsewhere), the script continues execution from @go. If it is, a trainer battle ensues. After the battle is done, flag 900 is set and if he is talked to again, script continues execution from @srs.
    What happens instead is, for some odd reason, the script compiles into this:

    Spoiler:


    As you can see, @go is gone and turns into that uselessness. What happens in the game is, when I click on the guy, all that happens is the "ding" select sound and nothing else. I'm not even locked to him.
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Spoiler:


    So what I want to happen is, if flag 901 isn't activated (it becomes activated elsewhere), the script continues execution from @go. If it is, a trainer battle ensues. After the battle is done, flag 900 is set and if he is talked to again, script continues execution from @srs.
    What happens instead is, for some odd reason, the script compiles into this:

    Spoiler:


    As you can see, @go is gone and turns into that uselessness. What happens in the game is, when I click on the guy, all that happens is the "ding" select sound and nothing else. I'm not even locked to him.

    First of all, unless you used Jambo's flag hack, no flags over 900. (If you did use it, that info is necessary to share with your script) The problem is the "end" after @srs and @go. Here is a fix:

    Code:
    #dynamic 0x800300
    #org @start
    checkflag 0x901
    if 0x0 goto @go
    checkflag 0x900
    if 0x1 goto @srs
    trainerbattle 0x0 0x1 0x0 @see @defeat
    msgbox @loser 0x6
    setflag 0x900
    end
    
    #org @go
    = Move along, sir.
    
    #org @srs
    = (He doesn't look too good...)
    
    #org @see
    = I didn't lose my legs in 'Nam\nso illegal filth like you can\lfreeload off of MY country!
    
    #org @defeat
    = Agh! My poor old heart!
    
    #org @loser
    = Seriously! Get an ambulance,\nplease!
     

    totodile493

    Person
    11
    Posts
    13
    Years
    • Seen Jan 22, 2021
    First of all, unless you used Jambo's flag hack, no flags over 900. (If you did use it, that info is necessary to share with your script) The problem is the "end" after @srs and @go. Here is a fix:

    Code:
    #dynamic 0x800300
    #org @start
    checkflag 0x901
    if 0x0 goto @go
    checkflag 0x900
    if 0x1 goto @srs
    trainerbattle 0x0 0x1 0x0 @see @defeat
    msgbox @loser 0x6
    setflag 0x900
    end
    
    #org @go
    = Move along, sir.
    
    #org @srs
    = (He doesn't look too good...)
    
    #org @see
    = I didn't lose my legs in 'Nam\nso illegal filth like you can\lfreeload off of MY country!
    
    #org @defeat
    = Agh! My poor old heart!
    
    #org @loser
    = Seriously! Get an ambulance,\nplease!

    You got most of it to work, but it compiles into this:
    Spoiler:

    so if I click on him before flag 8C4 is set, all that happens is the "ding" click sound. :\
    I'm beginning to think this isn't really user error.
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • You got most of it to work, but it compiles into this:
    Spoiler:

    so if I click on him before flag 8C4 is set, all that happens is the "ding" click sound. :\
    I'm beginning to think this isn't really user error.

    Oh my god, I had just gotten up and I didn't read your script properly. This is definitely user error. You are trying to display text without a command. Here:

    Code:
    #dynamic 0x800300
    #org @start
    checkflag 0x901
    if 0x0 goto @go
    checkflag 0x900
    if 0x1 goto @srs
    trainerbattle 0x0 0x1 0x0 @see @defeat
    msgbox @loser 0x6
    setflag 0x900
    end
    
    #org @go
    msgbox @gotext 0x2
    End
    
    #org @gotext
    = Move along, sir.
    
    #org @srs
    msgbox @srstext 0x2
    End
    
    #org @srstext
    = (He doesn't look too good...)
    
    #org @see
    = I didn't lose my legs in 'Nam\nso illegal filth like you can\lfreeload off of MY country!
    
    #org @defeat
    = Agh! My poor old heart!
    
    #org @loser
    = Seriously! Get an ambulance,\nplease!

    Look up the msgbox command.
     

    totodile493

    Person
    11
    Posts
    13
    Years
    • Seen Jan 22, 2021
    Spoiler:


    I mean I did do that, and after I compiled it into the game, I re-opened the script offset to find it changed. I re-did it anyway using what you did, and this is what it compiled into yet again:

    Spoiler:
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Spoiler:


    I mean I did do that, and after I compiled it into the game, I re-opened the script offset to find it changed. I re-did it anyway using what you did, and this is what it compiled into yet again:

    Spoiler:

    Well, I just copied and pasted what I sent you, and after compiling, it looks like this:

    Spoiler:


    So, I think you aren't doing something right. Try to compile this again, and make sure to change the offset in A-Map:

    Code:
    #dynamic 0x800300
    #org @start
    checkflag 0x901
    if 0x0 goto @go
    checkflag 0x900
    if 0x1 goto @srs
    trainerbattle 0x0 0x1 0x0 @see @defeat
    msgbox @loser 0x6
    setflag 0x900
    end
    
    #org @go
    msgbox @gotext 0x2
    End
    
    #org @gotext
    = Move along, sir.
    
    #org @srs
    msgbox @srstext 0x2
    End
    
    #org @srstext
    = (He doesn't look too good...)
    
    #org @see
    = I didn't lose my legs in 'Nam\nso illegal filth like you can\lfreeload off of MY country!
    
    #org @defeat
    = Agh! My poor old heart!
    
    #org @loser
    = Seriously! Get an ambulance,\nplease!
     

    totodile493

    Person
    11
    Posts
    13
    Years
    • Seen Jan 22, 2021
    Spoiler:


    That... that actually compiled perfectly. WTF?

    Anyway, would you happen to know of any way to make it so a trainer doesn't approach you unless a flag is set? Currently, the guy doesn't approach you no matter what.
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • That... that actually compiled perfectly. WTF?

    I think you compiled it, then looked at the old offset by mistake, and didn't realize it. I have done that many timed.

    Anyway, would you happen to know of any way to make it so a trainer doesn't approach you unless a flag is set? Currently, the guy doesn't approach you no matter what.

    Checkflag 0xXXX
    If 0x1 goto @trainer_walk_forward_and_battle

    Done. Put that at the begining of the script. This will not work unless it is in a script tile or map script. It can't be attached to a regular OW.
     
    Status
    Not open for further replies.
    Back
    Top