• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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] Making new in-game trades

  • 15
    Posts
    5
    Years
    • Seen Jan 28, 2024
    I am trying to make new in-game trades in my Emerald hack. I've already created them with the Advance Trade tool, but now I need help putting them in the game.
    XSE's guide doesn't help much because it's made for FRLG. Not only that, but when I take scripts from other trades in order to edit them, the tool either makes the text glitchy (like putting the same text line in every dialog box the NPC has), or it simply removes most of the lines. Is there any way to fix this issue in XSE?
     
    The errors you're receiving with glitchy text makes it sounds like you're not inserting your new trade scripts into free space. You should be using dynamic offsets whenever you create a new script. For your convenience, here's the trade in Pacifidlog Town with dynamic offsets and some comments to help explain what's going on in the script:

    Code:
    #dynamic 0x9C0B20
    
    #org @start
    lock
    faceplayer
    checkflag 0x9A // Checks if you've already done this trade before
    if 0x1 goto @AlreadyTraded
    setvar 0x8008 0x2 // Sets 0x8008 to the trade value (i.e which trade you want to activate)
    copyvar 0x8004 0x8008
    special2 0x800D 0xFF // Buffers the species names of the Pokemon involved in the trade into [buffer1] and [buffer2]. Also loads the species number that the trader wants into 0x800D
    copyvar 0x8009 0x800D // Copies the species number of the Pokemon the trader wants into 0x8009
    msgbox @Introduction 0x5
    compare 0x800D 0x0
    if 0x1 goto @AnswerNo
    special 0xA2 // Shows party screen
    waitstate
    copyvar 0x800A 0x8004 // Places the party position of the Pokemon you chose into 0x800A
    compare 0x8004 0xFF // Checks if player pressed cancel
    if 0x1 goto @AnswerNo
    copyvar 0x8005 0x800A // Places the party position of the Pokemon you chose into 0x8005
    special2 0x800D 0x102 // Loads the species number of the Pokemon the trader wants into 0x800D
    copyvar 0x800B 0x800D // Copies the species number of the Pokemon the trader wants into 0x800B
    comparevars 0x800D 0x8009
    if 0x5 goto @NotTheSame // Checks if the species of the Pokemon you chose (0x800D) is the same as the one the trader want (0x8009)
    copyvar 0x8004 0x8008 // Copies trade value into 0x8004
    copyvar 0x8005 0x800A // Copies party position of the Pokemon you're trading into 0x8005
    special 0x100
    special 0x101 // Executes trade animation
    waitstate
    bufferpokemon 0x0 0x8009
    msgbox @FinishTrade 0x6
    setflag 0x9A // Sets flag to indicate that you've done this trade
    release
    end
    
    #org @AlreadyTraded
    msgbox @Done 0x6
    release
    end
    
    #org @AnswerNo
    msgbox @NoText 0x6
    release
    end
    
    #org @NotTheSame
    bufferpokemon 0x0 0x8009
    msgbox @WrongPokemon 0x6
    release
    end
    
    #org @Introduction
    = Check out this [buffer2]!\pIt's the [buffer2] that I caught\nyesterday to celebrate my birthday!\pOh, I can see that you want it!\nAfter all, it's priceless!\pI'll tell you what. I might be willing\nto trade it for a [buffer1].
    
    #org @FinishTrade
    = Oh, so this is a [buffer1]?\pIt's sort of like a [buffer2],\nand yet it's subtly different.\pThank you!
    
    #org @Done
    = I know I could go looking for one\non my own, but[.]\pBut I really wanted to get a BAGON\nthat another TRAINER caught[.]
    
    #org @NoText
    = Oh, so you're not going to go through\nwith this?\pThat's cool. I'm not desperate to make\na trade or anything.
    
    #org @WrongPokemon
    = No, no, no! I won't accept any\nless than a real [buffer1]!

    With this script, the only things you would need to change would be the flag that checks whether you've done the trade before, the trade value at the very beginning and the text to whatever you want. Once you've done those, compile the script, assign it to the NPC and it should work fine.
     
    Thanks. The dialog is no longer glitchy, but the trade animation is; it just never finishes. Any idea on how to fix this?
     
    Back
    Top