-
Notifications
You must be signed in to change notification settings - Fork 93
Add a New Booster Pack
This tutorial will explain how to add a new booster pack in the game. Some versions of poketcg will have their names different than in other versions, so this will be represented by Name A / Name B format so that any version can read this guide.
=================================================================
This one is optional because I am not quite sure if it does anything. It involves generating booster packs from the debug menu. I don’t think this has an effect on normal gameplay, but just in case, I’ll leave this here. Go to engine > menus > debug
and:
db BOOSTER_COLOSSEUM_NEUTRAL
db BOOSTER_EVOLUTION_NEUTRAL
db BOOSTER_MYSTERY_NEUTRAL
db BOOSTER_LABORATORY_NEUTRAL
db BOOSTER_GENESIS_NEUTRAL
db BOOSTER_ENERGY_LIGHTNING_FIRE
=================================================================
Go to src> constants > booster constants
and find DEF NUM_BOOSTER_CARD_TYPES EQU const_value
. There, add in a new constant:
const BOOSTER_COLOSSEUM ; $00
const BOOSTER_EVOLUTION ; $01
const BOOSTER_MYSTERY ; $02
const BOOSTER_LABORATORY ; $03
const BOOSTER_GENESIS ; $04
Then, go immediately down below and you will see all of the various booster types that a booster pack can produce. For this example, we will be making only 1, but you can do this a lot more if you want. At the very end, add a new “neutral” booster pack loadout:
const BOOSTER_ENERGY_WATER_FIGHTING ; $1a
const BOOSTER_ENERGY_GRASS_PSYCHIC ; $1b
const BOOSTER_ENERGY_RANDOM ; $1c
const BOOSTER_GENESIS_NEUTRAL ; $1d
=================================================================
Go to constants > card data constants
. Find card set constants (set 1) and here we will add the new booster pack type.
const CARD_SET_COLOSSEUM ; $0
const CARD_SET_EVOLUTION ; $1
const CARD_SET_MYSTERY ; $2
const CARD_SET_LABORATORY ; $3
const CARD_SET_GENESIS ; $6
const CARD_SET_PROMOTIONAL ; $4
const CARD_SET_ENERGY ; $5
DEF NUM_CARD_SETS EQU const_value – 1
Likewise, directly below in DEF NUM_CARD_SETS EQU const_value – 1
, add the new booster.
DEF COLOSSEUM EQU CARD_SET_COLOSSEUM << 4
DEF EVOLUTION EQU CARD_SET_EVOLUTION << 4
DEF MYSTERY EQU CARD_SET_MYSTERY << 4
DEF LABORATORY EQU CARD_SET_LABORATORY << 4
DEF GENESIS EQU CARD_SET_GENESIS << 4
DEF PROMOTIONAL EQU CARD_SET_PROMOTIONAL << 4
DEF ENERGY EQU CARD_SET_ENERGY << 4
IMPORTANT: DO NOT PUT THE NEW BOOSTER PACK BELOW CARD_SET_PROMOTIONAL. This will cause the game to NEVER load your booster pack. For this reason, I have placed the example booster below Laboratory instead.
=================================================================
Go to constants > menu constants
and add the new booster type and the amount of cards you want in it into the menu constants function. In this example, I will be adding only 10 cards to the new booster pack. The maximum limit is around 60, or with Shaoden’s PoketcgV2 mod, 80.
DEF NUM_CARDS_COLOSSEUM EQU 56
DEF NUM_CARDS_EVOLUTION EQU 50
DEF NUM_CARDS_MYSTERY EQU 51
DEF NUM_CARDS_LABORATORY EQU 51
DEF NUM_CARDS_GENESIS EQU 10
DEF NUM_CARDS_PROMOTIONAL EQU 20
Next, we’ll have to make the game understand that we’ve added a new booster in the menus section, and alter the menus section. So go to engine > menus > card album
to add a bunch of things. First:
.GetEntryPrefix
push af
cp CARD_SET_PROMOTIONAL
jr nz, .genesis
lb de, 3, "FW3_P"
jr .got_prefix
.genesis
cp CARD_SET_GENESIS
jr nz, .laboratory
lb de, 3, "FW3_E"
jr .got_prefix
.laboratory
cp CARD_SET_LABORATORY
jr nz, .mystery
lb de, 3, "FW3_D"
jr .got_prefix
.mystery
cp CARD_SET_MYSTERY
………
Next, we need to do some menu alteration. At .BoosterPackMenuParams / .MenuParameters
, we have to alter the number of items in the menus and their displacement. In this case, we are altering the spaces between menu items to be 1 so that we can fit more boosters in it, and we will define the number of menu items as 6 for the +1 booster to be added.
db 3, 3 ; cursor x, cursor y
db 1 ; y displacement between items
db 6 ; number of items
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
dw NULL ; function pointer if non-0
Under .PrintCardsCount / .PrintCardCount
, alter it such that the menus can count the cards owned:
………
ld a, [wSelectedCardSet]
cp CARD_SET_PROMOTIONAL
jr nz, .check_genesis
; promotional
…
jr .has_card_set_count
.check_genesis
cp CARD_SET_GENESIS
jr nz, .check_laboratory
ldtx hl, Item6GenesisText
ld e, NUM_CARDS_GENESIS
jr .has_card_set_count
.check_laboratory
cp CARD_SET_LABORATORY
jr nz, .check_mystery
ldtx hl, Item4LaboratoryText
ld e, NUM_CARDS_LABORATORY
………
And now since we’ve edited the number of boosters in menu, we have to tell the game where the new position of the Promotional Cards section is. Under .draw_box
or .skip_clear_screen
:
; still has no promotional, print empty Card Set name
ld a, TRUE
ld [wUnavailableAlbumCardSets + CARD_SET_PROMOTIONAL], a
ld e, 8
ld d, 5
ldtx hl, EmptyPromotionalCardText
call InitTextPrinting_ProcessTextFromID
………
Finally, define the positions of each menu item in the menu in the very last section of this file.
.BoosterPacksMenuData
textitem 7, 1, BoosterPackText
textitem 5, 3, Item1ColosseumText
textitem 5, 4, Item2EvolutionText
textitem 5, 5, Item3MysteryText
textitem 5, 6, Item4LaboratoryText
textitem 5, 7, Item5GenesisText
textitem 5, 8, Item6PromotionalCardText
db $ff
=================================================================
Go to constants > scene constants
and add a new scene for the new booster. This lets the game create the scene after the player has won a duel and will receive a new booster pack.
………
const SCENE_JAPANESE_TITLE_SCREEN_2_COPY ; $1a
const SCENE_COLOR_PALETTE ; $1b
const SCENE_GENESIS_BOOSTER ; $1c
Likewise, go to data > scenes
to actually add the new scene. In scenepointers
:
………
dw Scene_JapaneseTitleScreen2
dw Scene_ColorPalette
dw Scene_GenesisBooster
assert_table_length NUM_SCENES
And at the end of this file:
Scene_GenesisBooster:
dw SGBData_GenesisBooster
dw NULL
db PALETTE_108, PALETTE_104, $01
db TILEMAP_GENESIS, TILEMAP_GENESIS_CGB, $80, $00
db SPRITE_BOOSTER_PACK_OAM
db PALETTE_117, PALETTE_117, $00
db $ff, SPRITE_ANIM_189, $00, $00
dw $00
Note that the palettes here were copied from another booster. You will have to edit in your own later.
=================================================================
Go to constants > tilemap
constants and add new booster pack tilemaps. We want both the normal tilemap and the cgb tilemap to be added since it is a booster.
………
const TILEMAP_COPYRIGHT ; $66
const TILEMAP_COPYRIGHT_CGB ; $67
const TILEMAP_NINTENDO ; $68
const TILEMAP_COMPANIES ; $69
const TILEMAP_GENESIS ; $6a
const TILEMAP_GENESIS_CGB ; $6b
Same thing with constants > tileset constants
. We need 2 new tilesets because that’s how boosters work.
………
const TILESET_JESSICA ; $54
const TILESET_STEPHANIE ; $55
const TILESET_AARON ; $56
const TILESET_GENESIS_1 ; $57
const TILESET_GENESIS_2 ; $58
Then we’ll have to get the computer to make sense of all of that in the engine. Go to engine > gfx > tilemaps
and add new ones at the end of the table:
………
tilemap CompaniesTilemap, TILESET_COMPANIES ; TILEMAP_COMPANIES
tilemap GenesisTilemap, TILESET_GENESIS_1 ; TILEMAP_GENESIS
tilemap GenesisCGBTilemap, TILESET_GENESIS_2 ; TILEMAP_GENESIS_CGB
assert_table_length NUM_TILEMAPS
And we have to do the same thing in engine > gfx >tilesets
:
………
tileset StephanieGfx, 36 ; TILESET_STEPHANIE
tileset AaronGfx, 36 ; TILESET_AARON
tileset Genesis1Gfx, 96 ; TILESET_GENESIS_1
tileset Genesis2Gfx, 86 ; TILESET_GENESIS_2
=================================================================
Time to define what the booster pack does. Go to data > booster packs
and in the first few lines, make a new booster rarity table:
db 1, 5, 3, 1 ; COLOSSEUM
db 1, 5, 3, 1 ; EVOLUTION
db 0, 6, 3, 1 ; MYSTERY
db 0, 6, 3, 1 ; LABORATORY
db 0, 6, 3, 1 ; GENESIS
In this case, the ratio indicates that each booster of Genesis will contain 0 energies, 6 commons, 3 uncommons and 1 rare. As always, you can adjust these ratios however you wish. At the very end of this document, add in the following:
BoosterPack_GenesisNeutral::
booster_set GENESIS ; booster pack set
dw NULL ; energy or energy generation function
; Card Type Chances
db 20 ; Grass Type Chance
db 20 ; Fire Type Chance
db 20 ; Water Type Chance
db 20 ; Lightning Type Chance
db 20 ; Fighting Type Chance
db 20 ; Psychic Type Chance
db 20 ; Colorless Type Chance
db 20 ; Trainer Card Chance
db 0 ; Energy Card Chance
This will give all types of card an equal chance of being in your booster. As always, you can adjust these ratios as you wish later.
=================================================================
Let’s add cards now. Go to data > cards
and start adding cards to Genesis. Since in step 3 we defined it as only having 10 cards, and because the booster ratios are 6:3:1 as defined in step 6, we will add exactly 6 commons, 3 uncommons and 1 rare card to Genesis. This would make for a very boring booster pack in real life, but it’s just an example to get started.
BulbasaurCard:
db TYPE_PKMN_GRASS ; type
gfx BulbasaurCardGfx ; gfx
tx BulbasaurName ; name
db CIRCLE ; rarity
db GENESIS | NONE ; sets
db BULBASAUR
db 40 ; hp
db BASIC ; stage
dw NONE ; pre-evo name
Repeat this 9 more times and you’re set.
=================================================================
Go to engine > booster packs
and define your booster in the jumptable:
……
dw BoosterPack_EnergyGrassPsychic
dw BoosterPack_RandomEnergies
dw BoosterPack_GenesisNeutral
assert_table_length NUM_BOOSTERS
Then, we will go into engine > menus > give booster pack to define how the game gives you the booster pack. First, in BoosterTypes
:
……
db BOOSTER_COLOSSEUM ; BOOSTER_ENERGY_GRASS_PSYCHIC
db BOOSTER_COLOSSEUM ; BOOSTER_ENERGY_RANDOM
db BOOSTER_GENESIS ; BOOSTER_GENESIS_NEUTRAL
assert_table_length NUM_BOOSTERS
Then in BoosterScenesAndNameTexts:
db SCENE_LABORATORY_BOOSTER, SCENE_LABORATORY_BOOSTER
tx LaboratoryBoosterText
db SCENE_GENESIS_BOOSTER, SCENE_GENESIS_BOOSTER
tx GenesisBoosterText
=================================================================
Let’s have some NPC’s give these boosters if they lose. Go to engine > overworld > scripting
and go to .booster_type_table
:
db BOOSTER_COLOSSEUM_TRAINER
db BOOSTER_EVOLUTION_TRAINER
db BOOSTER_MYSTERY_TRAINER_COLORLESS
db BOOSTER_LABORATORY_TRAINER
db BOOSTER_GENESIS_NEUTRAL
db NO_BOOSTER ; $ff
Next, choose an NPC to give these boosters to. I chose Sara of the Water Club in this example. I went to scripts > Water Club
and then:
……………
Script_BeatSara:
start_script
max_out_event_value EVENT_BEAT_SARA
print_npc_text SaraPlayerWon1Text
give_booster_packs BOOSTER_COLOSSEUM_WATER, BOOSTER_GENESIS_NEUTRAL, NO_BOOSTER
print_npc_text SaraPlayerWon2Text
quit_script_fully
=================================================================
Finally, it’s time to add graphics. First go to engine > sgb
and insert a copy of the booster pack code next to the existing ones:
SGBData_LaboratoryBooster:
dw $20 ; length
INCBIN "data/sgb_data/laboratory_booster_pals.bin.lz"
SGBData_GenesisBooster:
dw $20 ; length
INCBIN "data/sgb_data/genesis_booster_pals.bin.lz"
We need some free space to insert our new graphics. I found mine in section SECTION "Gfx 12", ROMX
in src > gfx.asm
, but your hack may be different. Point is, find some space and then insert some graphic definitions at the end.
Genesis1Gfx::
dw 96
INCBIN "gfx/booster_packs/genesis1.2bpp"
Genesis2Gfx::
dw 86
INCBIN "gfx/booster_packs/genesis2.2bpp"
Same thing with tilemaps. I inserted mine in SECTION "Card Gfx 11", ROMX
in the same file.
GenesisTilemap::
INCBIN "data/maps/tiles/dimensions/genesis.dimensions"
dw NULL
db FALSE ; cgb mode
INCBIN "data/maps/tiles/gb/genesis.bin.lz"
GenesisCGBTilemap::
INCBIN "data/maps/tiles/dimensions/genesis.dimensions"
dw NULL
db TRUE ; cgb mode
INCBIN "data/maps/tiles/cgb/genesis.bgmap.lz"
Now it’s time to actually add the graphics. Using your image editor of choice, “export as” the .png images of genesis1 and genesis2 into gfx > booster packs
. After Making the file, RGBDS will detect these files types and make a .2bpp and a .pal file. We will have to add the other files manually.
Go to data > sgb data
and copy the .pals.bin
and the .pals.bin.lz
files from another booster pack and rename them to genesis.pals.bin
and genesis.pals.bin.lz
respectively. This will create the palettes for your booster, you can edit them later.
Next we go to data > maps > tiles > dimensions
and copy one of the booster pack dimensions, then rename it to genesis.dimensions
. Since the dimensions of this booster pack is the same as all the others, we don’t need to edit this file.
Go back to data > maps > tiles > gb
and using the same methods as before, make a genesis.bin
file and a genesis.bin.lz
file.
Finally, go to data > maps > tiles > cgb
and create 3 files: genesis.bgmap, genesis.bgmap.lz, genesis.bgmap.lz.match
, once again, I recommend copying these from existing booster packs and then renaming them.
=================================================================
The last step. You will have noticed that throughout this tutorial, we made some text files. Time to define and create those. Go to text > text offsets
and add these at the end:
textpointer Item5GenesisText
textpointer GenesisBoosterText
Then find some free space in any of the text files and define them.
Item6PromotionalCardText:
text "6. Promotional Cards"
done
Item5GenesisText:
text "5. Genesis"
done
GenesisBoosterText:
text "Genesis"
done
Make the file and that’s it. You have now inserted a one booster pack into the game!!