• 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 Requests/Sharing/Discussion

Status
Not open for further replies.

Irish Witch

Office Jenny
147
Posts
17
Years
  • Meh, they don't work, can someone please show an correct example of a wild battle script? It's voor PokeScript.

    You can modify the 'simple tutorial' script for the basics. Replace the givepokemon command with

    wildbattle <pokemon> <level> <object>

    The pokemon number are the same as givepokemon. I think I posted them in the tut

    Code:
    #org $start
    lock
    applymovement [B]<Sprite No>[/B] $move
    [B]pausemove 0[/B]
    warp [B]<Bank> <map> <warp no>[/B]
    release
    end
    
    #org $move
    #raw ...
    #raw ...
    #raw ...
    #raw FE
    I've replaced the ... with descriptors in the above quote and added a command so the applymove works properly. The values have to be read from the map you're referring to in advanced map.

    ie(Fictional values):
    map 7(bank).3(map) has a warp with the warp no 7.
    and if your applying your movement to the main character use the value FF.
    If not get the sprite no from the map where your placing your script.

    the values for #RAW movement data are posted earlier in this thread.

    How would I make so a guy won't let you in a cave unless you have a Groudon. I am using PokeScript
    Thanks in advance

    Check my tutorial for usage in flags and displaying text. Then put a 'script' event in front of the door to the cave (or even the guy himself). Set the guy or scripts 'flag value' to the flag you set in your script!
     

    Quil

    Me
    67
    Posts
    17
    Years
    • Age 28
    • Seen Mar 1, 2010
    Code:
    '-----------------------
    #org 0x9D0000
    checkflag 0x9E2
    if 0x1 call 0x9D0900
    checkflag 0x9D3
    if 0x1 call 0x9D0800
    checkflag 0x9D1
    if 0x1 goto 0x9D0B00
    msgbox 0x89D0100 '"DWARF:So...\nYou wan..."
    callstd 0x5
    compare LASTRESULT 0x1
    if 0x1 call 0x9D0200
    msgbox 0x89D0300 '"DWARF:NO?! N00b...."
    release
    end
    
    '-----------------------
    #org 0x9D0900
    msgbox 0x89D0A00 '"DWARF:Isn't the unde..."
    callstd 0x2
    release
    end
    
    '-----------------------
    #org 0x9D0800
    setflag 0x9E2
    msgbox 0x89D0700 '"DWARF: You gave him ..."
    callstd 0x2
    release
    end
    
    '-----------------------
    #org 0x9D0200
    setflag 0x9D1
    msgbox 0x89D0400 '"DWARF:But you don't ..."
    callstd 0x2
    release
    end
    
    #org 0x9D0B00
    message 0x9D0C00
    boxset 0x2
    end
    
    '---------
    ' Strings
    '---------
    #org 0x9D0100
    = DWARF:So...\nYou wanna use my underground?
    #org 0x9D0300
    = DWARF:NO?! N00b.
    #org 0x9D0A00
    = DWARF:Isn't the underground easy to use?
    #org 0x9D0700
    = DWARF:You gave him the Lobster? Good.\nYou can use my Underground
    #org 0x9D0400
    = DWARF:But you don't use it before you\nhave earned the rights.\pGive a Fisher this...\p\c\h01Á\v\h01 Obianted a Lobster.\p\v\h01 Put it in the Quest Pocket.
    #org 0x9D0C00
    = DWARF:Already gave it to him?
    Code:
    '-----------------------
    #org 0x9D1000
    checkflag 0x9D3
    if 0x1 call 0x9D1500
    checkflag 0x9D1
    if 0x1 call 0x9D1200
    msgbox 0x89D1300 '"FISHER:I need a Lobs..."
    callstd 0x2
    end
    
    '-----------------------
    #org 0x9D1500
    msgbox 0x89D1600 '"FISHER:Thanks again!..."
    callstd 0x2
    end
    
    '-----------------------
    #org 0x9D1200
    setflag 0x9D2
    msgbox 0x89D1400 '"FISHER:You got a Lob..."
    callstd 0x2
    end
    
    #org 0x9D1300
    = FISHER:I need a Lobster!\nAww...\pWithout we can't live!
    #org 0x9D1600
    = FISHER:Thanks again!
    #org 0x9D1400
    = FISHER:You got a Lobster?!\p\c\h01Á\v\h01 Give the Lobster to the Fisher.\pYeah,Thanks

    This scripts i made, the first is form a DWARF that give you a quest, and de next one form the Fisher in the quest.
    But, the fisher only says:
    "FISHER:I need a Lobster!
    Aww...

    Without we can't live!"

    What's wrong? (I think a fault flag...)
     
    60
    Posts
    17
    Years
    • Seen Apr 26, 2024
    Here the wildbattle pokemon code:

    Code:
    #org 0xA00000
    checkflag 0x1412
    if 0x1 goto 0xA00100
    #raw 0xC5
    setvar 0x8004 0x????  <=== Pokemon Species
    setvar 0x8005 0x??     <=== Pokemon Level
    setvar 0x8006 0x????  <=== Item held
    special 0x1E2
    setflag 0x8C1
    special 0x139      <=== For Emerald are 0x139, 0x13A, 0x13B
    playsound 0x???? <=== Battle Music
    #raw 0x27
    clearflag 0x8C1
    setflag 0x1412        <=== Your Flag
    end
    
    #org 0xA00100
    end
     
    32
    Posts
    17
    Years
    • Seen Oct 12, 2018
    is it possible to make a pokemart script with 15 items? for pokescript so yes could some1 make it for me or give a start for it so i can try figure it out my own?
     
    17
    Posts
    18
    Years
    • Seen Jun 24, 2009
    Is it possible, through timed scripts to change the palette when it gets to be a certain time or change the weather to bit dark when it reaches a certain time. for example it will get dark at 6:00 pm and light again at 6:00 am?
     
    Last edited:
    153
    Posts
    18
    Years
    • Seen Jan 14, 2016
    I have a problem
    1 I make a script .
    2 I do Compile with SCripted
    3 The program adds new script in the rom(I don't understand because Amap don't add the offset which go from $1000000, also if I added new bytes at the Rom with an Hex Editor)
    4 I do a person with the new offset in Amap.
    5 I save and when I open the rom the script doesn't work!!!!!!(Sometimes the image crasch)

    Why this problem??
     

    zel 2.0

    Gold Remaker
    1,955
    Posts
    17
    Years
  • This scripts i made, the first is form a DWARF that give you a quest, and de next one form the Fisher in the quest.
    But, the fisher only says:
    "FISHER:I need a Lobster!
    Aww...

    Without we can't live!"

    What's wrong? (I think a fault flag...)

    As you say, it may be caused by the flags. I just see one problem in the script. At #org 0x9D1200, it says "setflag 0x9D2". I think it should be "setflag 0x9D3", it seems 9D3 is the "Lobster given to fisher" flag.

    I'm not too sure about using if 0x1 call 0x... When the dwarf gives you the yes/no choice, if you pick "yes", does he say his "DWARF:But you don't use it before you\nhave earned the rights..." stuff?, we need to know if that happens (if it happened, then the flag should be on)

    Anyway, I just use if 0x jump 0x , I don't know if that could fix anything. It's really weird your case...

    is it possible to make a pokemart script with 15 items? for pokescript so yes could some1 make it for me or give a start for it so i can try figure it out my own?

    Hmmm... I don't know about pokescript, but this is how I make my own custom pokemarts, without the need of editing an existing one.

    #org 0xSomewhere
    lock
    faceplayer
    #raw 0x67
    writebytetooffset 0x62 0x8666081A
    pokemart 0xListOfSoldItems
    release
    end

    #org 0xListOfSoldItems
    #binary hexItem1 hexItem1 hexItem2 hexItem2 ... hexLastItem hexLastItem 0 0


    The hex items are are like: TM01 = 0x121 = 0x01 0x21, then we just reverse the order 0x21 0x01 and that's what goes into the list in this order. The last two "0" are a must.

    Obviously, explanations for Scripted (don't know how Irish Witch implemented her pokemart command), and most likely just for FR (don't know if it could work on other versions...), and the list of hex values for items, well, I just have the FR one, maybe it's the same for the other games. If anyone wants it, I could post it later.

    I have a problem
    1 I make a script .
    2 I do Compile with SCripted
    3 The program adds new script in the rom(I don't understand because Amap don't add the offset which go from $1000000, also if I added new bytes at the Rom with an Hex Editor)
    4 I do a person with the new offset in Amap.
    5 I save and when I open the rom the script doesn't work!!!!!!(Sometimes the image crasch)

    Why this problem??

    Well, first of all, unless you expanded the rom (don't ask me about that, it seems you've been trying to do that, but I don't know...), you can normally only use up to offset 0xFFFFFF, so you can't put anything bigger (it'll just make the game crash)

    So, as long as you use free offsets in the normal space of the rom, you should be fine, since you'd be able to put it in Advance Map (I didn't know Advance Map didn't admit offsets bigger than FFFFFF, though)
     

    Hyunbin

    w00t!~
    166
    Posts
    17
    Years
  • can someone tell me what i did wrong in this script

    Code:
    <---
    CELEBI SCRIPT (WINDING FOREST)
    needed: TIME ORB
    --->
    
    #org 0x800000
    lock
    faceplayer
    checkitem 0x113
    checkflag 0x200
    compare LASTRESULT 0x1
    if 0x0 goto 0x800100
    message 0x800300
    boxset 5
    compare LASTRESULT 0x1
    if 0x1 goto 0x800500
    release
    end
    
    #org 0x800100
    message 0x800200
    boxset 6
    release
    end
    
    #org 0x800400
    message 0x800500
    boxset 0x6
    goto 0x800600
    release
    end
    
    #org 0x800600
    message 0x800700
    boxset 0x6
    cry PKMN_CELEBI
    wildbattle 0xFB 0x30 0x0
    release
    setflag 0x200
    end
    
    #org 0x800200
    = What an eerie tree...
    
    #org 0x800300
    = Place the TIME ORB here?
    
    #org 0x800500
    = Placed the TIME ORB under the tree.
    
    #org 0x800700
    = BIIIIIII!!!
     
    32
    Posts
    17
    Years
    • Seen Oct 12, 2018
    Hmmm... I don't know about pokescript, but this is how I make my own custom pokemarts, without the need of editing an existing one.

    #org 0xSomewhere
    lock
    faceplayer
    #raw 0x67
    writebytetooffset 0x62 0x8666081A
    pokemart 0xListOfSoldItems
    release
    end

    #org 0xListOfSoldItems
    #binary hexItem1 hexItem1 hexItem2 hexItem2 ... hexLastItem hexLastItem 0 0


    The hex items are are like: TM01 = 0x121 = 0x01 0x21, then we just reverse the order 0x21 0x01 and that's what goes into the list in this order. The last two "0" are a must.

    Obviously, explanations for Scripted (don't know how Irish Witch implemented her pokemart command), and most likely just for FR (don't know if it could work on other versions...), and the list of hex values for items, well, I just have the FR one, maybe it's the same for the other games. If anyone wants it, I could post it later.

    k ty then i will try with scripted even i dont know how it works
     

    foofatron

    Banned
    309
    Posts
    17
    Years
    • Seen Sep 2, 2007
    Can someone make a script that a guy walks up to you from 6 spaces away and and before he talks to you the waether changes to the dark one and then he says (This was caused by the evil pokemon.You must stop it!)This is for RUBY !
     
    91
    Posts
    17
    Years
    • Seen Nov 1, 2010
    I've searched free space with an hex-editor, and compiled this script:

    Code:
    #org 0x9C8020
    checkflag 0x12C
    applymovement 0xFF 0x9C8030
    pause 0x10
    applymovement 0x1 0x9C8040
    pause 0x60
    trainerbattle 0x0 0x160 0x0 0x9C8050 0x9C8060
    message 0x9C8070
    boxset 0x2
    #raw 0x5C
    applymovement 0x1 0x9C8080
    pause 0x70
    setflag 0x12C
    end
    
    #org 0x9C8030
    #raw 0x62
    #raw 0xFE
    
    #org 0x9C8040
    #raw 0x1D
    #raw 0x1D
    #raw 0x1D
    #raw 0x1D
    #raw 0x1D
    #raw 0xFE
    
    #org 0x9C8050
    = Get lost kid!
    
    #org 0x9C8060
    = What!
    
    #org 0x9C8070
    = I have to tell this!
    
    #org 0x9C8080
    #raw 0x62
    #raw 0x1E
    #raw 0x1E
    #raw 0x1E
    #raw 0x1E
    #raw 0x1E
    #raw 0x1E
    #raw 0xFE

    It doesn't work though, you only will see '!' from the player and then the script ends.
     

    Irish Witch

    Office Jenny
    147
    Posts
    17
    Years
  • I managed to grab a computer for a few minutes so I'll answer this question:

    Zel said:
    Hmmm... I don't know about pokescript, but this is how I make my own custom pokemarts, without the need of editing an existing one.
    #org 0xListOfSoldItems
    #binary hexItem1 hexItem1 hexItem2 hexItem2 ... hexLastItem hexLastItem 0 0

    The hex items are are like: TM01 = 0x121 = 0x01 0x21, then we just reverse the order 0x21 0x01 and that's what goes into the list in this order. The last two "0" are a must.

    Pokescript is FULLY compatible with Scripted... FULLY
    A script written for scripted will work in pokescript, all you do when the compiled project opens in bufrite is go straight to 'burn'. I haven't changed the language at all... (EDIT, well. Actually I have ADDED a couple of commands, but the existing ones all work the same way!)

    That said what I am about to say works in scripted too.
    You do NOT need to break the numbers for your items up.. if you want to write intiger values in a #Binary command simply do this:
    Code:
    #binary [B]int[/B] 0x121 0x80 0x58 [I]0x00[/I]
    last 0x0 is the 0 0 to finalise as per Zels instructions.

    It was programmed into the #Binary and #Raw commands in scripted (and so in pokescript) to accept the following keywords.
    b , byte , char == byte ie: 0x01
    i , int , word == int ie 0x0120
    l , long , dword == dword ie 0x00800000
    p , ptr , pointer == Actually the same as Dword!​

    Use any of these and all values after that word (within the binary statement) will be treeted as that type until another keyword is used!
    How do I know this; Easy. I've seen the source code!:cheeky:


    I've searched free space with an hex-editor, and compiled this script:

    Code:
    .....

    It doesn't work though, you only will see '!' from the player and then the script ends.

    I can tell you right now, your offsetts are too close together. They're overwriting each other. Either make the spaces bigger or use pokescript and let bufrite re-assign the offsets (the book button) so they don't overlap!

    EDIT

    Also: what is your checkflag for... You have to follow it with an if statement for it to mean anything.

    #raw 0x5c is the bytecode for trainerbattle. put it before that command not before the applymovement.... (if you were using pokescript that command would work properly without having to write the raw command)

    and for christ sake.. Will people stop using PAUSE to wait for movement scripts. None of you are getting the timing right...
    Use the command: pausemove 0
    that will wait for all movement script to finish properly.
     
    Last edited:
    91
    Posts
    17
    Years
    • Seen Nov 1, 2010
    I can tell you right now, your offsetts are too close together. They're overwriting each other. Either make the spaces bigger or use pokescript and let bufrite re-assign the offsets (the book button) so they don't overlap!

    Also: what is your checkflag for... You have to follow it with an if statement for it to mean anything.

    #raw 0x5c is the bytecode for trainerbattle. put it before that command not before the applymovement.... (if you were using pokescript that command would work properly without having to write the raw command)

    and for christ sake.. Will people stop using PAUSE to wait for movement scripts. None of you are getting the timing right...
    Use the command: pausemove 0
    that will wait for all movement script to finish properly.

    Yes, i saw that #raw 0x5C before. No thanks, i don't like pokéscript that much.
    Btw, Pausemove isn't a command for Diamondcutter, so i cant use it.
     
    32
    Posts
    17
    Years
    • Seen Oct 12, 2018
    I managed to grab a computer for a few minutes so I'll answer this question:




    Pokescript is FULLY compatible with Scripted... FULLY
    A script written for scripted will work in pokescript, all you do when the compiled project opens in bufrite is go straight to 'burn'. I haven't changed the language at all... (EDIT, well. Actually I have ADDED a couple of commands, but the existing ones all work the same way!)

    That said what I am about to say works in scripted too.
    You do NOT need to break the numbers for your items up.. if you want to write intiger values in a #Binary command simply do this:
    Code:
    #binary [B]int[/B] 0x121 0x80 0x58 [I]0x00[/I]
    last 0x0 is the 0 0 to finalise as per Zels instructions.

    It was programmed into the #Binary and #Raw commands in scripted (and so in pokescript) to accept the following keywords.
    b , byte , char == byte ie: 0x01
    i , int , word == int ie 0x0120
    l , long , dword == dword ie 0x00800000
    p , ptr , pointer == Actually the same as Dword!​

    Use any of these and all values after that word (within the binary statement) will be treeted as that type until another keyword is used!
    How do I know this; Easy. I've seen the source code!:cheeky:


    :paranoid: i dont understand that

    so this need work for pokescript:(so yes, i get an error all time when i wanna compile it)

    Code:
    #org 0xSomewhere
    lock
    faceplayer
    #raw 0x67
    0x01 0x62 0x8666081A
    pokemart 0xListOfSoldItems
    release
    end
    
    #org 0xListOfSoldItems
    #binary int 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0x13 0x14 0x17 0x00
     

    foofatron

    Banned
    309
    Posts
    17
    Years
    • Seen Sep 2, 2007
    When I insertr this script I get this 1 - SEEK

    #org 0x800000
    message 0x800030
    boxset 0x2
    message 0x800055
    boxset BOXSET_YESNO
    compare LASTRESULT 1
    if 1 0x800150
    message 0x800100
    boxset 0x2
    break

    #org 0x800150
    message 0x800125
    boxset 0x2
    warp 0x00 0x12 0x01
    break

    #org 0x800030
    = Hello, Can I help you?
    #org 0x800055
    = Wanna lift to Pineco Rocks?
    #org 0x800100
    = To bad, come again.
    #org 0x800125
    = Okay, let's go.

    Cleaning up...
    Closing file...
    Finished processing stdpoke.rbh.
    Processing xx.rbc...
    File handle: 3
    1 - SEEK
    > pNewOffset = 800000
    2 - (0F) MESSAGE (native)
    > pText = 8800030
    3 - (09) - BOXSET
    > bByte = 2
    4 - (0F) MESSAGE (native)
    > pText = 8800055
    5 - (09) - BOXSET
    > bByte = 5
    6 - (21) - COMPARE
    > iWord = 800D
    > iWord = 1
    7 - (??) IF (native)
    > bCondition = 1
    No kind specified. Assuming call.
    > pTarget = 8800150
    8 - (0F) MESSAGE (native)
    > pText = 8800100
    9 - (09) - BOXSET
    > bByte = 2
    10 - (02) - END
    12 - SEEK
    > pNewOffset = 800150
    13 - (0F) MESSAGE (native)
    > pText = 8800125
    14 - (09) - BOXSET
    > bByte = 2
    15 - (39) - WARP
    > bByte = 0
    > bByte = 12
    > bByte = 1
    16 - (02) - END
    18 - SEEK
    > pNewOffset = 800030
    19 - RAW TEXT
    > sOld = "Hello, Can I help you?"
    > sNew = "ÂÙààã¸
    Cleaning up...
    Closing file...
    Finished processing xx.rbc.

    I'm using Ruby thats most of it.I compile it with Daimond cutter.
     
    16
    Posts
    17
    Years
    • Seen Jun 20, 2007
    :paranoid: i dont understand that

    so this need work for pokescript:(so yes, i get an error all time when i wanna compile it)

    Code:
    #org 0xSomewhere
    lock
    faceplayer
    #raw 0x67
    0x01 0x62 0x8666081A
    pokemart 0xListOfSoldItems
    release
    end
    
    #org 0xListOfSoldItems
    #binary int 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0x13 0x14 0x17 0x00


    Posting in the stead of my Aunt here..... plus english your second language is it??

    Anyway... Get the update to fix a bug with the #Raw and #Binary commands...
    Plus: I have put the directives page up again!

    And from what I see above try the script like this:
    #org $Somewhere
    lock
    faceplayer
    #raw 0x67
    writebytetooffset 0x62 0x8666081A
    pokemart $ListOfSoldItems
    release
    end

    #org $ListOfSoldItems
    #binary int 0x1 0x2 0x3 0x4 0x5 0x6 0x7
    #binary int 0x8 0x9 0xa 0xb 0xc 0x13 0x14 0x17 0x00

    You were missing the word in bold.

    EDIT - Missed an INT
     
    Last edited:
    112
    Posts
    17
    Years
  • When i try to compile this in ScriptEd it kinda doesnt work.
    It says Runtime Error '6' Overflow
    Can someone check if anything is wrong?

    Spoiler:
     

    foofatron

    Banned
    309
    Posts
    17
    Years
    • Seen Sep 2, 2007
    Your script is too big size it down.I'm not sure but I think it would still work if you took out this part #org 0x900800
    message 0x900900
    boxset 0x6
    release
    end
     
    32
    Posts
    17
    Years
    • Seen Oct 12, 2018
    Posting in the stead of my Aunt here..... plus english your second language is it??

    Anyway... Get the update to fix a bug with the #Raw and #Binary commands...
    Plus: I have put the directives page up again!

    And from what I see above try the script like this:


    You were missing the word in bold.

    yeah it works thnxs but now i hold the probleme 1. he doesnt pop up a menu bar for sell/buy/cancel and when i talk to the person it says all time Céccé etc and then he doesnt stop
     
    16
    Posts
    17
    Years
    • Seen Jun 20, 2007
    When i try to compile this in ScriptEd it kinda doesnt work.
    It says Runtime Error '6' Overflow
    Can someone check if anything is wrong?


    #org 0x900100
    = Heya \v\ho1 just up to my usual training.
    #org 0x900200
    = You up for a battle \v\h01?
    #org 0x900600
    = Ok here i come!
    #org 0x900700
    = I....lost?
    #org 0x900500
    = I cant beleive i lost to you!
    #org 0x900900
    = Ok just talk to me if you\nwant to battle.

    Ok.. Even I can see what's whong with this. I know enough from retyping Aunts Documentation that that should be zero one, not oh one! (\h01 not \ho1)
     
    Status
    Not open for further replies.
    Back
    Top