The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Making new in-game trades

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old May 24th, 2019 (6:36 AM).
Haltmann's Avatar
Haltmann Haltmann is offline
 
Join Date: May 2019
Gender: Female
Posts: 15
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?
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 24th, 2019 (9:23 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
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.
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 25th, 2019 (12:05 AM).
Haltmann's Avatar
Haltmann Haltmann is offline
 
Join Date: May 2019
Gender: Female
Posts: 15
Thanks. The dialog is no longer glitchy, but the trade animation is; it just never finishes. Any idea on how to fix this?
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:19 AM.