• 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.
199
Posts
12
Years
    • Seen Jul 18, 2016
    So I am trying to make a script that starts an alternate trainer battle in emerald if a flag has been set.
    Basically, I am making an E4 rematch where they have upgraded teams and such.

    Here is my current script. Also the alternate trainer battle starts phoebe's battle. Just a placeholder to test.

    Spoiler:


    and here is what it looks like after compiling it.

    Spoiler:


    Why does the part in bold appear?
    The script works fine when tested unless you talk to the npc a second time, at which it tries to warp
    the player it seems.
     
    64
    Posts
    10
    Years
    • Seen Mar 30, 2016
    You must have a complete new offset for the script.
    Because 2 scripts overwrote each other, this abnormal thing has outputted.
     
    199
    Posts
    12
    Years
    • Seen Jul 18, 2016
    You must have a complete new offset for the script.
    Because 2 scripts overwrote each other, this abnormal thing has outputted.

    I am not really sure what you mean. ~_~
    I forgot to put the msgbox there I just realized. Will report back if it fixes it or more problems.
     
    64
    Posts
    10
    Years
    • Seen Mar 30, 2016
    You put msgbox there afterwards, and you forgot to repoint the script, so everything is messed up now.
     
    199
    Posts
    12
    Years
    • Seen Jul 18, 2016
    You put msgbox there afterwards, and you forgot to repoint the script, so everything is messed up now.

    It appears that I have it working. Both the when fighting the e4 for the first time and on the rematch.
    Also think I understood that. Thanks.
     
    Last edited:

    GoGoJJTech

    (☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
    2,475
    Posts
    11
    Years
  • what is the command to make the player follow a move script?
    like applymovement 0x.. @move

    I used 0xFE and it doesnt work i am using XSE

    0xFF is the player. 0xFE is the camera. But you need specials for the camera to move.
     

    M.L

    Invisible
    761
    Posts
    13
    Years
    • Seen Dec 21, 2017
    This may be slightly noobish and i have gone through it 100 times atleast but it doesn't seem to be doing what i want.
    Spoiler:
     

    ep!c

    Banned
    124
    Posts
    11
    Years
    • Seen Jan 4, 2015
    You clear the flag 0x6089 (I dunno why you want to mess up the variable-area..)
    at the beginning of the script, which makes no sense, cause if you have the ticket, the flag is still cleared and you cant proceed. Then, always use "waitmovement 0x0" after an applymovement. It saves you 1 byte and is much more accurate.

    Do you use a green S-field with this script?
    Then I recommend you using a variable such as "setvar 0x4080 0x1". In AdvanceMap
    put at "flag" 4080 then. As I metioned above, dont use flags above 0xFFF..
    Well that's everything I found wrong in the script..
    This would be my correction:

    Code:
    #dynamic 0x740000
    
    #org @start
    checkflag 0x200
    if 0x0 call @done1
    applymovement 0xFF @move1
    waitmovement 0x0
    msgbox @1 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @take
    msgbox @2 0x6
    applymovement 0xFF @move
    waitmovement 0x0
    release
    end
    
    #org @take
    checkflag 0x201
    if 0x1 goto @done
    msgbox @2 0x6
    applymovement 0xFF @move
    waitmovement 0x0
    release
    end
    
    #org @done
    setvar 0x4090 0x1
    msgbox @3 0x6
    setflag 0x200
    release
    end
    
    #org @done1
    clearflag 0x201
    return
    
    #org @move
    #raw 0x10
    #raw 0xFE
    
    #org @move1
    #raw 0x02
    #raw 0xFE
    
    #org @1
    = Do you have a ticket?
    
    #org @2
    = You do not have the\nticket.\pReturn when you obtain the\nticket.
    
    #org @3
    = You do have the ticket\nyou may go through.

    Just don't forget to put the var 4090 into AdvanceMap!
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • mhh anyone can explain me a Follow here Script?
    pls °O°

    You have the person that's following be one step behind the person that's being followed. Essentially, you're gonna have them have the same movements but the follower will be one movement behind the followee.
     

    ep!c

    Banned
    124
    Posts
    11
    Years
    • Seen Jan 4, 2015
    Its possible with a little ASM snippet, which compares your button imput and lets a virtual sprite (or a real sprite which you have placed in the map) move.
    This is easy, but map switch, warps, etc are a huge problem.
     
    61
    Posts
    10
    Years
    • Seen Nov 8, 2015
    Does anyone know if I need a call or something else to go to a custom script/asm in a GBC rom? I need to go from a specific ROM bank location to a custom one, meaning to go from RO14 to RO1E or RO1F...
     

    miksy91

    Dark Energy is back in action! ;)
    1,480
    Posts
    15
    Years
  • Does anyone know if I need a call or something else to go to a custom script/asm in a GBC rom? I need to go from a specific ROM bank location to a custom one, meaning to go from RO14 to RO1E or RO1F...
    See what they say here in Pandocs --> Memory Bank Controllers under "MBC3".

    Code:
    [B][SIZE=3]2000-3FFF - ROM Bank Number (Write Only)[/SIZE][/B]
     
    Same as for MBC1, except that the whole 7 bits of the RAM Bank Number are written directly to this address. As for the MBC1, writing a value of 00h, will select Bank 01h instead. All other values 01-7Fh select the corresponding ROM Banks.
    To make more sense, what this small text string here says is that by writing a value to somewhere in ram between addresses $2000 and $3FFF, the rom bank that is currently accessable from addresses $4000-$7FFF is changed.
    (Writing 00 won't "work" since rom bank 0 has to be always accessable right here between $0000-$3FFF.)

    This is how you can change rom banks in all of its simplicity. However, it's safe to say that we would run into problems if all we could do would be jumping from rom bank into another without being able to call anything from another rom bank. In Gold and Silver, "RST 8" is made to function as a "3-byte call" from current address to rom address determined by a and hl (a = rom bank, hl = address).

    Code:
    ld a, (rom bank)
    ld hl, (address)
    RST 8
    ....
    ---------
    00:0008
    jp 2E27
    ---------
    00:2E27 // whole functionality
    1) Stores the current rom bank onto stack
    2) Calls RST 10 to switch the rom bank
    3) Call 2E48 calls "jp hl" which now jumps to the address determined before RST 8 (a:hl). When that routine ends with "ret", we return here after this call 2E48.
    4) Value of bc is stored in CFE0-CFE1.
    5) Original rom bank (and the value of f register) is popped into bc.
    6) Call RST 10 returns the original rom bank.
    7) Original value of bc is taken back from CFE0-CFE1.
    8) Routine ends and we go back executing code at the original routine (after RST 8).
     
    Last edited:
    215
    Posts
    11
    Years
    • Seen Jul 14, 2020
    Alright so I am writing a script where when you talk to this man, him and his abra will teleport you across the lake. When he does, you him and his abra will appear on the otherside and you can talk to him again and get teleported again.

    I have it set up so there are two old man (one is always hidden with a flag) and there is always an abra beside the old man (there are two but one is always hidden by a flag).

    This is what ACTUALLY happens when I talk to the old man. I get teleported across, but the old man I just talked to doesn't disapear while the abra does. When I try to talk to the other old man, he just stops after he tells abra to teleport.

    this is the code

    Spoiler:


    Anyone know what's wrong with my script? Please let me know!
     

    JordanB500

    Former Pokemon League Champion
    104
    Posts
    16
    Years
  • Emerald:
    Person Event:
    PKSV-UI:
    Spoiler:


    Did i do that correctly??




    i used a modifyed sample of a script that i got from a thread on pokecommunity i tryed to compile it but even the sample script wouldnt compile kept saying "Unknown value in IF (Value must be integer)" so i was wondering is there a way to fix this script also idk if im doing this right with the modified script i want to be able to trade 10 ultra balls for a masterball

    but i also want to be able to repeat the event
     

    Rezordaxx

    Asks many questions!
    290
    Posts
    10
    Years
  • Emerald:
    Person Event:
    PKSV-UI:
    Spoiler:


    Did i do that correctly??




    i used a modifyed sample of a script that i got from a thread on pokecommunity i tryed to compile it but even the sample script wouldnt compile kept saying "Unknown value in IF (Value must be integer)" so i was wondering is there a way to fix this script also idk if im doing this right with the modified script i want to be able to trade 10 ultra balls for a masterball

    but i also want to be able to repeat the event

    Remove

    checkflag 0x201
    if B_True goto $Gotball
    if you want to repeat it

    Does it give you a line at the error like @line 22 or something?

    I recommend XSE instead of pokescript xse is much easy'r to work with,
     

    Teh Blazer

    Divider of Zero
    776
    Posts
    15
    Years
  • Remove

    checkflag 0x201
    if B_True goto $Gotball
    if you want to repeat it

    Does it give you a line at the error like @line 22 or something?

    I recommend XSE instead of pokescript xse is much easy'r to work with,

    In addition to that, you're also forgetting a dynamic.
    (If pksv doesn't use dynamics, then please ignore me completely)
     

    JordanB500

    Former Pokemon League Champion
    104
    Posts
    16
    Years
  • Initialized.
    #ORG
    -> 0x86B475C
    CHECKITEM
    -> 0x2
    Unknown value in CHECKITEM (Value must be integer)

    btw tried usin xse and it crashed
     
    Last edited:
    Status
    Not open for further replies.
    Back
    Top