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

The Void

hiiiii
1,416
Posts
13
Years
  • Okay, so I was wondering how you would be able to have a sprite, like professor oak in pallet town, be able to be invisible before activating any "disappear" scripts, and then appear at a later time? By the way, I'm using pksv.

    I don't get what you mean here. Do you mean to say like a certain event has to be triggered first before Prof. Oak (or the sprite you want) wants to appear first? For that, you'll be needing some sort of flag or a var.
     
    27
    Posts
    12
    Years
  • I don't get what you mean here. Do you mean to say like a certain event has to be triggered first before Prof. Oak (or the sprite you want) wants to appear first? For that, you'll be needing some sort of flag or a var.
    I know how to make a sprite disappear and reappear, what I can't seem to figure out is how to make it so that, like professor oak at the beginning of fire red, he begins by not being there, without any scripts (or at least not any that I know of) having activated to make him that way.
     
    2
    Posts
    12
    Years
    • Seen Aug 25, 2012
    I know how to make a sprite disappear and reappear, what I can't seem to figure out is how to make it so that, like professor oak at the beginning of fire red, he begins by not being there, without any scripts (or at least not any that I know of) having activated to make him that way.
    There are map-scripts that trigger when you enter a map. They move and hide sprites or change tiles.
     

    Darthatron

    巨大なトロール。
    1,152
    Posts
    18
    Years
  • I know how to make a sprite disappear and reappear, what I can't seem to figure out is how to make it so that, like professor oak at the beginning of fire red, he begins by not being there, without any scripts (or at least not any that I know of) having activated to make him that way.

    Some flags (such as Oak's one) are set when the New Game option is selected. It's not done by a script, but by Assembly.
     
    37
    Posts
    13
    Years
    • Seen Feb 7, 2014
    I'm having major problems with sprites reappearing even when I use setflag and hidesprite. They are gone temporarily, and will appear again some time when I come back to the map. If I leave the map and come back right after the script has occurred, they will be gone. However, if I go off and train my Pokemon, continue on the story, etc, the sprite will reappear when I come back. I am not reusing flags, and the flags are in the 2000's and 4000's ranges, so they're definitely not interfering with flags already put into the game.

    I'll just write a random script that would normally hide the sprite:
    Code:
    #dynamic 8000000
    
    #org @start
    trainerbattle 0x1 0xA 0x0 @a @b @c (I have no idea if the 2 and 3 lines are switched up or not; don't even worry about it.)
    release
    end
    
    #org @c
    msgbox @d MSG_FACE
    fadescreen 0x1
    hidesprite 0x4 (Yes, I know it's the Person Event No.)
    setflag 0x2542 (Yes, I know it's the Person ID.)
    fadescreen 0x0
    release
    end
    
    msgbox @a
    = Hey!\pLet's battle!
    
    msgbox @b
    = Argh!  You won!
    
    msgbox @d
    = I'll see you around.\pGoodbye!

    When trainers like the above reappear, nothing happens when you interact with them; you just hear a clicking noise.

    If it's just a simple one like this..
    Code:
    #dynamic 8000000
    
    #org @start
    checkflag 0x820
    if 0x1 goto @did
    msgbox @hi MSG_FACE
    release
    end
    
    #org @did
    msgbox @bye MSG_FACE
    fadescreen 0x1
    hidesprite 0x3
    setflag 0x3500
    fadescreen 0x0
    release
    end
    
    #org @hi
    = I am the door guarder.\pYou must have the 1st badge\nto enter this door.
    
    #org @bye
    = Wow!\pYou got the first badge?\nWell, I guess I must leave.

    ...the sprite, when it reappears, will perform the script again (says bye, screen fades, sprite disappears). Then, if you come back some random time after you progressed in the game more, he'll be there again.
     

    Quickster

    Dream or Drop?
    351
    Posts
    16
    Years
    • Seen Apr 4, 2016
    I'm having major problems with sprites reappearing even when I use setflag and hidesprite. They are gone temporarily, and will appear again some time when I come back to the map. If I leave the map and come back right after the script has occurred, they will be gone. However, if I go off and train my Pokemon, continue on the story, etc, the sprite will reappear when I come back. I am not reusing flags, and the flags are in the 2000's and 4000's ranges, so they're definitely not interfering with flags already put into the game.

    I'll just write a random script that would normally hide the sprite:
    Code:
    #dynamic 8000000
    
    #org @start
    trainerbattle 0x1 0xA 0x0 @a @b @c (I have no idea if the 2 and 3 lines are switched up or not; don't even worry about it.)
    release
    end
    
    #org @c
    msgbox @d MSG_FACE
    fadescreen 0x1
    hidesprite 0x4 (Yes, I know it's the Person Event No.)
    setflag 0x2542 (Yes, I know it's the Person ID.)
    fadescreen 0x0
    release
    end
    
    msgbox @a
    = Hey!\pLet's battle!
    
    msgbox @b
    = Argh!  You won!
    
    msgbox @d
    = I'll see you around.\pGoodbye!

    When trainers like the above reappear, nothing happens when you interact with them; you just hear a clicking noise.

    If it's just a simple one like this..
    Code:
    #dynamic 8000000
    
    #org @start
    checkflag 0x820
    if 0x1 goto @did
    msgbox @hi MSG_FACE
    release
    end
    
    #org @did
    msgbox @bye MSG_FACE
    fadescreen 0x1
    hidesprite 0x3
    setflag 0x3500
    fadescreen 0x0
    release
    end
    
    #org @hi
    = I am the door guarder.\pYou must have the 1st badge\nto enter this door.
    
    #org @bye
    = Wow!\pYou got the first badge?\nWell, I guess I must leave.

    ...the sprite, when it reappears, will perform the script again (says bye, screen fades, sprite disappears). Then, if you come back some random time after you progressed in the game more, he'll be there again.

    This would happen to me whenever I would use flags above 1000 to hide OWs. As far as I know, using flags lower than 1000 is the only way to fix it.
     
    37
    Posts
    13
    Years
    • Seen Feb 7, 2014
    This would happen to me whenever I would use flags above 1000 to hide OWs. As far as I know, using flags lower than 1000 is the only way to fix it.

    Thank you soooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo much! (Each o is a bucket of thanks)

    Also, I've used flags in the 1000's range that work just fine. 4000's works fine too. Obviously, 2000's does not.
     
    Last edited:
    27
    Posts
    12
    Years
  • Sorry guys, but I have another question for you pksv users out there. I'm working on a team rocket script in which I want the player to battle a grunt, and, after completing the fight, keep on going with the script, like how gym leaders talk after you have battled them.
    I've had to use the script generator to create the battle part of the script, as I don't understand what the values mean in the command:

    trainerbattle 0x? 0x? 0x? @intro @defeat

    I get that the second value is the trainer id, but what are the first and third ones? And does anyone know how to continue a script after a battle without releasing the player first?
     

    droomph

    weeb
    4,285
    Posts
    12
    Years
  • Sorry guys, but I have another question for you pksv users out there. I'm working on a team rocket script in which I want the player to battle a grunt, and, after completing the fight, keep on going with the script, like how gym leaders talk after you have battled them.
    I've had to use the script generator to create the battle part of the script, as I don't understand what the values mean in the command:

    trainerbattle 0x? 0x? 0x? @intro @defeat

    I get that the second value is the trainer id, but what are the first and third ones? And does anyone know how to continue a script after a battle without releasing the player first?

    From Reference as of 06-03pm 09-24-11, DavidJCobb:
    Arguments:
    byte type
    word index
    word local_id
    pointer intro
    pointer loss
    pointer extra (run script after battle)
    pointer extra2 (not used often)

    And does anyone know how to continue a script after a battle without releasing the player first?

    Set "type" to 1 or 2 and use the last four arguments accordingly.

    You should really search around before asking stuff like that.

    This might be a n00b question, but so far, I haven't found a way for the game to check if you have a certain wild pokemon before continuing. If there is already a "checkpokemon" command, then can u explain how to use it? If not, I kinda have a hint of where to start:
    Spoiler:

    I dont know exactly how to do it, but I'm on the right track.
    Also:
    Spoiler:

    Special 0x17C is the special which checks the Pokémon in FireRed. Since 0x15FD60 is the Specials Table, you can use that to find 0x15FD60 + (0x17C x 4). Then you go to where the pointer tells you, go forward six bytes and try finding the next twenty bytes in whichever version you want to do it on. Then find out which special it is.

    Once you've got that working, proceed to do it how you would normally do it:
    Code:
    [B]setvar[/B] 0x8004 0x[[I]Pokémon[/I]]
    [B]special2[/B] 0x8004 0x[[I]Special[/I]]
    etc.

    Beware though, because the routine is only complete in FR/LG for sure. You will need to test it before actually using it. (For example, in Emerald the routine is completely bare-bones and will require you to edit it to conform to how it's supposed to work.)
     
    Last edited:

    N!elz

    Beginning Hack-maker
    7
    Posts
    16
    Years
    • Seen Mar 28, 2012
    Game: FireRed v1.0 - All cleaned out of scripts
    Scripteditor: PKSV (newest)

    What I want to do is to activate the @birthday script as soon as the hero enters the room from upstairs and gets the player to his mom as she will talk to him(for the first time). I can get the right moves to work for myself I think, but not the script that tells him to get to his mom.
    But I really don't know how to do get the @birthday script to work as soon as he enters the room, so that's my question! Can you help me with that?

    P.S: I think that the @birthday event won't repeat itself because of the checkflag, right? And it's my first script, haven't even debugged it yet, so if there's any mistake in it, please point it out for me :)

    Spoiler:


    Greetings,
    N!elz
     
    32
    Posts
    12
    Years
    • Seen Mar 28, 2012
    Game: FireRed v1.0 - All cleaned out of scripts
    Scripteditor: PKSV (newest)

    What I want to do is to activate the @birthday script as soon as the hero enters the room from upstairs and gets the player to his mom as she will talk to him(for the first time). I can get the right moves to work for myself I think, but not the script that tells him to get to his mom.
    But I really don't know how to do get the @birthday script to work as soon as he enters the room, so that's my question! Can you help me with that?

    P.S: I think that the @birthday event won't repeat itself because of the checkflag, right? And it's my first script, haven't even debugged it yet, so if there's any mistake in it, please point it out for me :)

    Spoiler:


    Greetings,
    N!elz

    I think you should use level scripts. I'm still a novice in scripting but I'm pretty sure you need to use level scripts if you want a script to execute upon entering a map. A member, cooley, has compile a nice tutorial in the Tutorials' section, if you like to have a look; however, the scripting environment used is presumably XSE. I doubt you'll have trouble converting as I heard the two syntax are awfully similar. I hope this is what you are looking for.
     

    N!elz

    Beginning Hack-maker
    7
    Posts
    16
    Years
    • Seen Mar 28, 2012
    I think you should use level scripts. I'm still a novice in scripting but I'm pretty sure you need to use level scripts if you want a script to execute upon entering a map. A member, cooley, has compile a nice tutorial in the Tutorials' section, if you like to have a look; however, the scripting environment used is presumably XSE. I doubt you'll have trouble converting as I heard the two syntax are awfully similar. I hope this is what you are looking for.

    Thanks, I'll check! This is my first "difficult" script, and I only am practising since last night,
    so I don't know all the terms yet! But I'll keep levelscripting in thd back of my head! :) And it isn't hard to convert, tried it for a couple of times.
    Thanks for the help anyways!
     
    4
    Posts
    12
    Years
    • Seen Jun 12, 2013
    Hi I was just wondering if it would be possible to take a pokemon out of your party with a script, like givepokemon, but in reverse. Pretty much the player will be lent a pokemon and give it back later.
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Hi I was just wondering if it would be possible to take a pokemon out of your party with a script, like givepokemon, but in reverse. Pretty much the player will be lent a pokemon and give it back later.

    There is no basic scripting command that will allow you to do that. However, HackMew did make an ASM routine that will allow you to do this. If you don't know how to insert ASM then you could use metapod23's script, but HackMew's routine is far better. Besides, it wouldn't hurt to learn how to put ASM into a ROM.
     
    4
    Posts
    12
    Years
    • Seen Jun 12, 2013
    could i get some help with this script.
    im using fire red rom, XSE and amap

    #dynamic 0x2DD100

    #org @start
    checkflag 0x1209
    if 0x1 goto @done
    applymovement 0x04 @move
    msgbox @talk 0x6
    setflag 0x1209
    release
    end

    #org @move
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0xFE

    #org @talk
    = Gary rushed off so quick i\ncouldn't give him his pokedex!\lCould you please go get Gary for\lme?

    #org @dex
    = Thank you! Gary, you rushed off so\nfast i couldn't give you your'e\lpokedex!

    #org @done
    checkflag 0x1207
    if 0x1 goto @dex
    if 0x1 setflag 0x829
    release
    end

    a little explanation.. after you get ur first pokemon and after the battle u try to go out and oak comes down telling you to go get gary. so i step on the tile and nothing happens. i want to make it so that after you get gary from this place you go back to oaks lab and he gives you the pokedex. help please :)
     

    Alignment

    Revered with the stars
    308
    Posts
    14
    Years
    • Seen Dec 25, 2016
    could i get some help with this script.
    im using fire red rom, XSE and amap

    #dynamic 0x2DD100

    #org @start
    checkflag 0x1209
    if 0x1 goto @done
    applymovement 0x04 @move
    msgbox @talk 0x6ile
    setflag 0x1209
    release
    end

    #org @move
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0xFE

    #org @talk
    = Gary rushed off so quick i\ncouldn't give him his pokedex!\lCould you please go get Gary for\lme?

    #org @dex
    = Thank you! Gary, you rushed off so\nfast i couldn't give you your'e\lpokedex!

    #org @done
    checkflag 0x1207
    if 0x1 goto @dex
    if 0x1 setflag 0x829
    release
    end

    a little explanation.. after you get ur first pokemon and after the battle u try to go out and oak comes down telling you to go get gary. so i step on the tile and nothing happens. i want to make it so that after you get gary from this place you go back to oaks lab and he gives you the pokedex. help please :)

    After applymovement you need waitmovement. Other than that there doesn't seem to be any other errors, most likely you have the script var value/number messed up in A-map. Double check that.

    My question is kinda silly, but after I set a tile through a script how do I make it update the map immediately. So far I have
    fadescreen 0x1
    setmaptile 0x14 0x1A 0x358 0x0
    fadescreen 0x0
    but that didn't work out :/
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    My question is kinda silly, but after I set a tile through a script how do I make it update the map immediately. So far I have
    fadescreen 0x1
    setmaptile 0x14 0x1A 0x358 0x0
    fadescreen 0x0
    but that didn't work out :/

    you need the code special 0x8E after the setmaptile code. ;)
     
    1
    Posts
    12
    Years
    • Seen Jul 26, 2016
    Game: FireRed
    Type: Person
    Editor: XSE or Pksvui (whichever one is better)
    Script:
    Spoiler:


    Trying to make person upgrade you pokedex after you get it. Sorry if there are a lot of errors, I'm brand new to hacking lol
     
    7
    Posts
    12
    Years
    • Seen Mar 30, 2016
    Hi, I'm new at scripting and on this community page. As far as i've read the threads and posting I'm very impressed about the knowledge and abilities in scripting. Well, but im posting because my script(s) don't work.

    I use AM 1.92 and the latest XSE version. I'm hacking the german 1.0 Version of Ruby. I designed a giveitem with flag, a givepokemon with flag, a wildbattle script with flag and setmaptile, one trainerbattle and two warps. I deleted all former header scripts from my map so that there is none in the header. As long as i don't leave the map everything works fine. But after I leave and get back and after a wildbattle in the gras my sprite won't move, but I somehow move the camera and can even get to wildpokemon battles. It's really creepy. When I somehow accomplish to leave the map again then I can move my sprite again. I Hope someone can help.

    1.

    '---------------
    #org 0x801849
    checkflag 0x200
    if 0x1 goto 0x8801864
    giveitem 0x35 0x1 MSG_OBTAIN
    setflag 0x200
    release
    end

    '---------------
    #org 0x801864
    msgbox 0x880186F MSG_NORMAL '"Hier ist sonst nichts."
    release
    end


    2.

    '---------------
    #org 0x80116D
    lock
    faceplayer
    checkflag 0x800
    if 0x1 goto 0x8800E2C
    msgbox 0x8800E37 MSG_YESNO '"Hallo.\nIch habe keine Lust\nmehr ..."
    compare LASTRESULT 0x1
    if 0x1 goto 0x8800DE8
    msgbox 0x8800E9A MSG_NORMAL '"Schade.\pDann setze ich es\neben a..."
    release
    end

    '---------------
    #org 0x800E2C
    msgbox 0x8800F45 MSG_NORMAL '"Ist GLUMANDA stärker\ngeworden?"
    release
    end

    '---------------
    #org 0x800DE8
    givepokemon 0x4 0xA 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox 0x8800ECD MSG_KEEPOPEN '"[red_rs]Du erhälst GLUMANDA!"
    waitfanfare
    closeonkeypress
    setflag 0x800
    msgbox 0x8800EED MSG_YESNO '"[red_rs]Möchtest du GLUMANDA\neine..."
    compare LASTRESULT 0x1
    if 0x1 call 0x8000004
    msgbox 0x8800F23 MSG_NORMAL '"Trainiere ihn gut!"
    release
    end

    '---------------
    #org 0x4
    cmd24 0x6951AEFF

    3.

    '---------------
    #org 0x8016D6
    checkflag 0x500
    if 0x1 goto 0x880170F
    msgbox 0x8801669 MSG_NORMAL '"MOGELBAUM: ?!"
    cry 0xB9 0x0
    wildbattle 0xB9 0xA 0x8B
    fadescreen 0x1
    fadescreen 0x0
    setflag 0x500
    setmaptile 0x16 0x26 0x119 0x0
    setmaptile 0x16 0x27 0x121 0x0
    special 0x8E
    end

    '---------------
    #org 0x80170F
    end


    4.

    #org 0x8017C8
    trainerbattle 0x0 0x267 0x0 0x88017E1 0x88017F8
    msgbox 0x8801811 MSG_NORMAL '"Meine Pikachus können\nim Dunkel..."
    release
    end
     

    droomph

    weeb
    4,285
    Posts
    12
    Years
  • Hi, I'm new at scripting and on this community page. As far as i've read the threads and posting I'm very impressed about the knowledge and abilities in scripting. Well, but im posting because my script(s) don't work.

    I use AM 1.92 and the latest XSE version. I'm hacking the german 1.0 Version of Ruby. I designed a giveitem with flag, a givepokemon with flag, a wildbattle script with flag and setmaptile, one trainerbattle and two warps. I deleted all former header scripts from my map so that there is none in the header. As long as i don't leave the map everything works fine. But after I leave and get back and after a wildbattle in the gras my sprite won't move, but I somehow move the camera and can even get to wildpokemon battles. It's really creepy. When I somehow accomplish to leave the map again then I can move my sprite again. I Hope someone can help.
    Code:
    1.
    
    '---------------
    #org 0x801849
    checkflag 0x200
    if 0x1 goto 0x8801864
    giveitem 0x35 0x1 MSG_OBTAIN
    setflag 0x200
    release
    end
    
    '---------------
    #org 0x801864
    msgbox 0x880186F MSG_NORMAL '"Hier ist sonst nichts."
    release
    end
    Check if any scripts already use flag 0x200.
    Code:
    2.
    
    '---------------
    #org 0x80116D
    lock
    faceplayer
    checkflag 0x800
    if 0x1 goto 0x8800E2C
    msgbox 0x8800E37 MSG_YESNO '"Hallo.\nIch habe keine Lust\nmehr ..."
    compare LASTRESULT 0x1
    if 0x1 goto 0x8800DE8
    msgbox 0x8800E9A MSG_NORMAL '"Schade.\pDann setze ich es\neben a..."
    release
    end
    
    '---------------
    #org 0x800E2C
    msgbox 0x8800F45 MSG_NORMAL '"Ist GLUMANDA stärker\ngeworden?"
    release
    end
    
    '---------------
    #org 0x800DE8
    givepokemon 0x4 0xA 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox 0x8800ECD MSG_KEEPOPEN '"[red_rs]Du erhälst GLUMANDA!"
    waitfanfare
    closeonkeypress
    setflag 0x800
    msgbox 0x8800EED MSG_YESNO '"[red_rs]Möchtest du GLUMANDA\neine..."
    compare LASTRESULT 0x1
    if 0x1 call 0x8000004
    msgbox 0x8800F23 MSG_NORMAL '"Trainiere ihn gut!"
    release
    end
    
    '---------------
    #org 0x4
    cmd24 0x6951AEFF
    Okay, why would you use address 4? That's part of the header, and the Game won't work if you mess with it.

    Also, nicknaming a Pokémon is a special command. Look at BIRCH in his lab for the exact special.
    Code:
    3.
    
    '---------------
    #org 0x8016D6
    checkflag 0x500
    if 0x1 goto 0x880170F
    msgbox 0x8801669 MSG_NORMAL '"MOGELBAUM: ?!"
    cry 0xB9 0x0
    wildbattle 0xB9 0xA 0x8B
    fadescreen 0x1
    fadescreen 0x0
    setflag 0x500
    setmaptile 0x16 0x26 0x119 0x0
    setmaptile 0x16 0x27 0x121 0x0
    special 0x8E
    end
    
    '---------------
    #org 0x80170F
    end
    That should work.
    Code:
    4.
    
    #org 0x8017C8
    trainerbattle 0x0 0x267 0x0 0x88017E1 0x88017F8
    msgbox 0x8801811 MSG_NORMAL '"Meine Pikachus können\nim Dunkel..."
    release
    end
    You should replace the first 0x0 with 0x3.

    Game: FireRed
    Type: Person
    Editor: XSE or Pksvui (whichever one is better)
    Script:
    Trying to make person upgrade you pokedex after you get it. Sorry if there are a lot of errors, I'm brand new to hacking lol

    Code:
    #org 0x800000
    lock
    faceplayer
    checkflag 0x10A
    if 1 jump [S-HIGHLIGHT][B]0x820000[/B][/S-HIGHLIGHT]
    special 0x16F
    setflag 0x10A
    fanfare 0x13E
    msgbox 0x[S-HIGHLIGHT][B]8[/B][/S-HIGHLIGHT]810000
    callstd 0x6
    waitfanfare
    release
    end
    
    #org 0x820000
    msgbox 0x[S-HIGHLIGHT][B]8[/B][/S-HIGHLIGHT]800070
    callstd 0x6
    release
    end
    
    #org 0x[S-HIGHLIGHT][B]8[/B][/S-HIGHLIGHT]810000
    = Hey! You got a POKéDEX from PROF.\nOAK didn't you?\pHe likes to cheap out sometimes and\lnot get all the upgrades for it.\pLucky for you, I've got one you\lcan have!
    
    #org [S-HIGHLIGHT][B]0x[I]8[/I]800070[/B][/S-HIGHLIGHT]
    = If your wondering why I just gave\nthis to you,\pI have a good feeling that you will\lgo far in the future.\pDon't make a liar out of me!
    All mistakes marked in bold and highlighted.
     
    Last edited:
    Status
    Not open for further replies.
    Back
    Top