• 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] How To Write a "Trade Script"? (Advance Map/XSE)

  • 2
    Posts
    4
    Years
    • Seen Jun 10, 2023
    Hello Community!

    I started hacking Gen 3 games about a week ago. I already wrote many scripts. Some with the help of tutorials and some with the help of decompiling already existing offsets. Now I want to add a NPC in Pokémon Emerald who wants to Trade a Pokémon (I don't know which Pokémon to trade yet). I also decompiled an already existing offset of a NPC who wants to trade. But I don't know what exactly happens in this script. There are many setvar, copyvar and special commands. And I didn't see any numbers which specify the requested and given Pokémon...

    Do anyone know how to write such a script? And can someone explain what all these commands cause?
     
    The trading scripts used by the game use assembly language (also called ASM) code to both verify you have selected the right Pokémon for trading and to set which Pokémon will be traded to you. I'm actually in the process of trying to unravel the trading script secrets as well. Until I figured it out you may want to take a look at this tutorial (https://www.pokecommunity.com/showthread.php?p=9775737). This will allow you to do a kind of trading in the game by letting you take a Pokémon from the players party and showing them another Pokémon which is then inserted into their party. But it does not check for a specific species of Pokémon and instead lets the player trade away any Pokémon they want.
     
    Back
    Top