• 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.

[CRYSTAL] Adding new evolution stones

98
Posts
6
Years
  • This is just temporary, of course in the end you might want to add more items (for now we're using the "Teru-sama" placeholders). If you have a disassembly of Pokemon GS, it will most likely work the same, though I only know about the Pokemon Crystal disassembly. No questions about how to setup it, how to make your rom from the disassembly or whatsoever. This is purely how to add more evolution stones and how to change a Pokemon's evolution to that item.

    First of all, make sure you have your disassembly open in a program. I recommend Atom or Sublime because you can open a whole folder as a "project" so you can open all files without having to browse through a lot of files. Also you can search for a specific keyword in the whole folder hierarchy, including subfolders and sub-subfolders. If you do not know what I'm talking about, you can always open all your files you need (I'll tell which files, no worries) in notepad and edit it in there.

    I use atom, so it looks like:

    VPQvk4i.png


    Don't worry, the yellow ones indicate changed files as I've already done stuff.

    Next up... um, we're starting to create a new evolution stone.

    First of all, we need to edit one of the "Teru-sama"'s names. Open up 'items/item_names.asm'. This contains a list of all the items in the game, but only their names.

    For displaying "Poke", you can use a # (like the Poke from Pokeball).

    You see for example:

    [S-HIGHLIGHT]db "MASTER BALL@"[/S-HIGHLIGHT]

    Of course, we want to change an useless item. Since I already have changed a few items, I'm not going to pick one from the begin of the file. I'd like to go with the one after this:

    [S-HIGHLIGHT]db "PASS@"[/S-HIGHLIGHT]

    So find that row, in the row below there are couple of teru-sama's. Change the one below pass to your desired item.

    For me it ends up looking like:

    [S-HIGHLIGHT] db "PASS@"
    db "BABY STONE@"[/S-HIGHLIGHT]

    Now, this file is done, close it. Next file to open is 'items/item_descriptions.asm'. Don't worry, all the items should be in the same order. So we can just search for the pass description and change the teru-sama below it.

    Find this:

    [S-HIGHLIGHT]dw PassDesc[/S-HIGHLIGHT]

    Below it, change

    [S-HIGHLIGHT]dw TeruSama9Desc[/S-HIGHLIGHT]

    Into something better. Make sure you remember what you changed it in. You can also leave it like that but I like to rename it because it looks better. For me it ends up like:

    [S-HIGHLIGHT]dw BabyStoneDesc[/S-HIGHLIGHT]

    Now, search for

    [S-HIGHLIGHT]PassDesc:[/S-HIGHLIGHT]

    Below it, change

    [S-HIGHLIGHT]TeruSama9Desc:[/S-HIGHLIGHT]

    Into what you just changed, so for me it'd be like:

    [S-HIGHLIGHT]BabyStoneDesc:[/S-HIGHLIGHT]

    Change the description of the item. Make sure of this:

    - You can only use 2 lines
    - The @ should be at the end of the full string, so not at every line.

    For me it ends up like:

    [S-HIGHLIGHT]BabyStoneDesc:
    db "For evolving"
    next "BABY #MON.@"[/S-HIGHLIGHT]

    The second line uses next instead of db. Make sure of that. Also the # is still a replacement for Poke.

    Next thing, open up 'items/item_attributes.asm'. Finally we're going to go to the most important part. This will tell the game what kind of item it is. Before searching, we're going to take a look at the format of the items.

    [S-HIGHLIGHT]item_attribute: MACRO
    ; price, held effect, parameter, property, pocket, field menu, battle menu
    dw \1
    db \2, \3, \4, \5
    dn \6, \7
    ENDM[/S-HIGHLIGHT]

    [S-HIGHLIGHT]; MASTER BALL
    item_attribute 0, 0, 0, CANT_SELECT, BALL, ITEMMENU_NOUSE, ITEMMENU_CLOSE[/S-HIGHLIGHT]

    First, don't worry about the 'ItemXAttributes' (like Item1Attributes, Item2Attributes ...), we won't be going over those in this tutorial. But for now, they're not important at all anyways. Now, see that line? If you don't know ASM, everything after a semicolon (;) will be a comment. This won't get executed. The comment '; MASTER BALL' doesn't tell the name, description or whatsoever of the item. It's just so you know which item it is.

    The first 'item_attribute' is simply a call to the described macro. A macro is a simplified function you can call which executes multiple instructions. Look at the item_attribute: MACRO code. It simply tells that when the macro is called, this will get executed:

    [S-HIGHLIGHT]
    dw \0
    db \2, \3, \4, \5
    dn \6, \7
    [/S-HIGHLIGHT]

    I'm not going to go in depths about the 'dw', 'db' and 'dn', you can read about them somewhere else if you want to. But the \NUMBER tells the assembler to take the parameter at NUMBER. You might be thinking: but there's 0. This is because the parameters are zero-indexed. So if you want to get the first parameter, you use \0. For the second, use \1 etc.

    You could even make your own MACRO's although I'm not sure how many when it comes to space in your ROM. But that's not what this tutorial is about anyways.

    Next, we got 0. The first parameter - as described in the comments of the macro - is the price of the item. Since the master ball isn't available in a mart and can't be sold for money, the price is 0. There's no such thing as a selling price, the selling price is ALWAYS half of the price defined here.

    Next 2 parameters are held effect and parameter. I'm not entirely sure what to put at them, I haven't discovered that yet... As for property, it currently is CANT_SELECT, which is useless as only key items can be selected anyways. But this tells that the item can't be 'SELECTED' (as in, can't be registered I think). I believe for the property parameter (just so you know, this is the fourth parameter) you can also add CANT_TOSS if you want an item to not be tossed away, but I'm unsure if this actually works. (the only item having that is the TOWN MAP which isn't available.

    The next parameter is 'BALL'. This tells the game in which pocket the item is stored. You could store Pokeballs in the ITEMS pocket if you really wanted. Though... let's just store balls in BALLS.

    The next 2 parameters are really important. Those are the menus when in bag and when in battle. For evolution stones, there's only one important combination. I will definitely explain all the others in a separate tutorial.

    If you look at moon stone, it uses "ITEMMENU_PARTY, ITEMMENU_NOUSE". This means that in the bag, you can use it on your party. In a battle, the item has no use (hence... the name ITEMMENU_NOUSE. Sounds logic... right?)

    So, now we have to find the pass. Search on:

    [S-HIGHLIGHT]; PASS[/S-HIGHLIGHT]

    After it, you have to change the item. It looks like:

    [S-HIGHLIGHT]; TERU-SAMA
    item_attribute $9999, 0, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE[/S-HIGHLIGHT]

    So, change '$9999' and 'ITEMMENU_NOUSE'. Change the '$9999' into any price you want, change (ONLY the first) ITEMMENU_NOUSE to ITEMMENU_PARTY. I don't think in-battle evolutions can be done, if you want to test it out, be my guest, then change the second one to ITEMMENU_PARTY as well, but I think it'll glitch).

    For me, I end up with:

    [S-HIGHLIGHT]; BABY STONE
    item_attribute 1200, 0, 0, 0, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE[/S-HIGHLIGHT]

    Now, if we would make the rom and try to use it, OAK's bitching about us that "blabla I'm OAK and I'm old and you can't use this item". This is because the item has no effect yet. Open up 'items/item_effects.asm'. Follow the instructions carefully! (yeah.. um, late warning I guess?)

    Search for

    [S-HIGHLIGHT] dw Pass[/S-HIGHLIGHT]

    After it, change the next item into what you made. Give it a simple name - no spaces or special characters - so it's easier to find back. For me, it will end up like:

    [S-HIGHLIGHT] dw Pass
    dw BabyStone[/S-HIGHLIGHT]

    Now, search for the following next:

    [S-HIGHLIGHT]Item87:[/S-HIGHLIGHT]

    And remove it. If it's correct, it's placed in a long list above 'jp IsntTheTimeMessage'. By removing it, we remove it from the list of items that give that message. Now, search for ANY evolutionary stone. I'd like to go with 'moonstone' (make sure you type it as ONE word).

    You'll find this piece of code:

    [S-HIGHLIGHT]MoonStone:
    FireStone:
    Thunderstone:
    WaterStone:
    LeafStone:
    SunStone:[/S-HIGHLIGHT]

    Simply add a new case (another row with NAME:). Use the name you changed 'dw Item87 into' For me, it ends up looking like:

    [S-HIGHLIGHT]MoonStone:
    FireStone:
    Thunderstone:
    WaterStone:
    LeafStone:
    SunStone:
    BabyStone:[/S-HIGHLIGHT]

    Now, we have to change the constant of the item to make it easier to access (for give item scripts and for the marts). Open up 'constants/item_constants.asm' and search for

    [S-HIGHLIGHT]const PASS ; $86[/S-HIGHLIGHT]

    The row below, change it to whatever constant you want your item to have. Give it a name that makes sense which tells you what item it is. Preferably use the same name as above step. For me, it ends up looking like:

    [S-HIGHLIGHT] const PASS ; $86
    const BABYSTONE ; $87[/S-HIGHLIGHT]

    (preferably do all in caps as that's the convention to use when defining constants)

    Now, we're going to make sure the item appears in a mart. Open up 'items/marts.asm'.

    Now I don't know exactly as of now what all the marts are. But simply go to any mart. I go with the first one (of cherrygrove without the pokeballs) just for debugging purpose.

    It looks like:

    [S-HIGHLIGHT]Mart0: ; 160ed
    db 4 ; # items
    db POTION
    db ANTIDOTE
    db PARLYZ_HEAL
    db AWAKENING
    db $ff
    ; 160f3[/S-HIGHLIGHT]


    So first of all, increase the item count by 1. It is 4 now (the list starts off with one db of the item count). If you don't do this the cancel button won't appear anymore (the item will override it). Then, after 'db AWAKENING', add another db (on another row) with your item constant. This is why you want to name your constant good. It ends up looking for me like:

    [S-HIGHLIGHT]Mart0: ; 160ed
    db 5 ; # items
    db POTION
    db ANTIDOTE
    db PARLYZ_HEAL
    db AWAKENING
    db BABYSTONE
    db $ff
    ; 160f3[/S-HIGHLIGHT]

    Now, one thing left to do. Open up 'engine/link.asm', and find:

    [S-HIGHLIGHT]db ITEM_87, BERRY[/S-HIGHLIGHT]

    Remove this line or change it to the constant of your new item.

    Now, when we make our rom, this is the outcome:

    8Bu5DFl.png


    mltBQTD.png


    xKmydPX.png


    Now, no Pokemon can evolve. Last step is making a Pokemon being able to evolve. During this, I'll use Cyndaquil because I'm too lazy to edit wild Pokemon but you can do it at every Pokemon.

    Open 'data/evos_attacks.asm' and search for your Pokemon. Search it like

    [S-HIGHLIGHT]PokemonEvosAttacks[/S-HIGHLIGHT]

    For me, I'll search on

    [S-HIGHLIGHT]CyndaquilEvosAttacks[/S-HIGHLIGHT]

    The first line below it describes the evolution. For cyndaquil, it looks like:

    [S-HIGHLIGHT]db EVOLVE_LEVEL, 14, QUILAVA[/S-HIGHLIGHT]

    Where EVOLVE_LEVEL is the method of evolving, 14 is either the level or the item (if any) and QUILAVA is the pokemon it evolves into. If the pokemon has no evolution, it simply says 'db 0'.
    Since we want to use an item, we use the method EVOLVE_ITEM. As for 14, we'll change it to the item constant we also used at the mart. In my case BABYSTONE. I'll keep Quilava since I still want it to evolve into Quilava.

    My line will look like:

    [S-HIGHLIGHT]db EVOLVE_ITEM, BABYSTONE, QUILAVA[/S-HIGHLIGHT]

    You can do this at as much Pokemon as you want.

    Next, we make the rom again. Let's test it:

    4R18RRo.png


    In case of any questions, leave them behind. All steps can be done in the same way just remember what item is close to the item you have to edit, search for that item, change the item stuff and you can make as many evo stones as you want (until you got no more teru samas).

    Also, illuminati confirmed.
     
    Back
    Top