The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script Fire red in-game Pokémon trade (https://www.pokecommunity.com/showthread.php?t=384984)

PokemonValor December 7th, 2016 12:30 PM

Fire red in-game Pokémon trade
 
So can someone help me out with the simplest way to script in-game npcs to trade with you? If there's an easy way to edit existing traders, and maybe just change the Pokémon numbers that they want/trade? Hopefully someone can help out, thanks.

PokemonValor December 9th, 2016 6:35 AM

Anyone got anything? Please?

MonopolyRubix December 9th, 2016 11:21 AM

I'm definitely not a pro at this, but I got it to work once. I sort of forget how, but this is the script I used (I use PKSV-UI, not XSE for scripting):

Spoiler:

#dyn 0x740000
#org @main
lock
faceplayer
setvar 0x8008 0x1
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFC
copyvar 0x8009 LASTRESULT
checkflag 0xABCD
if == jump @alreadydone
message @ask
callstd MSG_YESNO
compare LASTRESULT NO
if == jump @endscript
special 0x9F
waitspecial
lock
faceplayer
copyvar 0x800A 0x8004
compare 0x8004 0x6
if >= jump @playerclickedB
copyvar 0x8005 0x800A
special2 LASTRESULT 0xFF
copyvar 0x800B LASTRESULT
comparevars2 LASTRESULT 0x8009
if != jump @notrightpokemon
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0xFD
special 0xFE
waitspecial
lock
faceplayer
message @thankyou
callstd MSG_NORMAL
setflag 0xABCD
release
end

#org @ask
= You know what?\pI'm thinking I'd like to\nbecome a PSYCHIC.\pBut I don't have any PSYCHIC\ntype POK\eMON.\pSay[.]\nDo you have a \v\h02?\pI'll trade you my \v\h03\nfor it.

#org @thankyou
= Sweet!\nHey, thanks a lot!

#org @alreadydone
message @howisit
callstd MSG_NORMAL
release
end

#org @howisit
= Hey!\nHow's \v\h03 treating you?\pI love my \v\h02!\nThanks a lot!

#org @endscript
message @notrade
callstd MSG_NORMAL
release
end

#org @notrade
= Really?\nAww, man[.]\pWell, if you ever get a\n\v\h02, let me know, okay?

#org @playerclickedB
message @nevermind
callstd MSG_NORMAL
release
end

#org @nevermind
= Really?\nAww, man[.]\pWell, if you ever change\nyour mind, I'll be here.

#org @notrightpokemon
storepokemon 0x0 0x8009
message @notit
callstd MSG_NORMAL
release
end

#org @notit
= Huh?\nThat's not a \v\h02.\pIf you ever get a \v\h02,\nlet me know, okay?


So when you talk to this guy ingame, \h\02 turns into the name of what you're trading him and \h\03 turns into the name of what he trades you.

This script uses the Poliwhirl for Jynx trade, so I edited that trade using Trader Advanced (https://www.pokecommunity.com/showthread.php?t=132530).

I think the Trader Advanced readme comes with a guide for doing it in XSE.

PokemonValor December 9th, 2016 7:02 PM

Wow, totally perfect. Worked 100% for me. I've been stuck on this problem for a loooong time so thank you!

MonopolyRubix December 10th, 2016 12:54 PM

No prob!


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


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.