A mod template for use by individuals who want to add new loadouts and tech cards to Planetary Annihilation: TITANS (PA) Galactic War. Requires Galactic War Overhaul to work.
You will be working with JSON and JavaScript files. I recommend the use of Visual Studio Code or similar IDE.
For testing you will need the Coherent UI Debugger. To allow it to connect to PA, add --coherent_port=9999
to your launch options.
Place the my_card_mod
folder within the client_mods
folder of your PA data directory. If this folder does not exist you should create it. You can rename my_card_mod
to something of your choice. This my_card_mod
folder is the root of your mod and all further instructions will proceed from there.
Update the following fields in modinfo.json
:
identifier
display_name
description
author
scene
- thegw_start
andgw_play
URLs should match youridentifier
.
Under /ui/mods/
change the folder found there to match your identifier
.
PA's cards can be found under {PA_INSTALL_DIRECTORY}/media/ui/main/game/galactic_war/cards
The cards which ship with Galactic War Overhaul, including the updated base game cards, can be found in the Galactic War Overhaul repository.
For your first card you should take a copy of a card which does something similar to what you want to achieve and use it as a base template. Place the card in your mod's /ui/main/game/galactic_war/cards
folder. Rename it using a unique name. A typical naming strategy is ACRONYM_EFFECT_UNITTYPE.js e.g. gwc_damage_bots.js
The mod start_card_id.js
and tech_card_id.js
files provide instructions on how to create your own loadouts and tech cards.
The deal
function is used for card distribution. The buff
function is the adding of units, unit mods, and AI mods. The dull
function is applied after all card buff
s and is for the removal of units.
Open the mod's start_cards.js
file. This file provides an example of how to load multiple start cards. Change the loadout IDs to match your card's file name, minus the file extension.
Set the LS_KEY
variable in bank.js
to something unique. This is where the locked status of your loadouts will be stored in the local storage database.
Open the mod's tech_cards.js
file. This file provides an example of how to load multiple tech cards and setup the tooltips for them.
Change the tech IDs to match your card's file name, minus the file extension. Change unit paths to the file path of the unit's JSON, using the structure /pa/units/SOME_LAYER/SOME_UNIT_NAME/SOME_UNIT_NAME.json
Open the mod's specs.js
file. This file provides an example of how to load unused files for modification.
- Add
--devmode
to your PA launch options. - Launch PA.
- Under Community Mods enable your mod in the INSTALLED list.
- Return to the Main Menu.
- Open the Coherent UI Debugger.
- Click GO.
- Click Start Page.
- Change to the Console tab.
During testing you will be checking the debugger for errors. Note that it is expected for PA to generate the following up to once per scene:
- ERROR: Uncaught TypeError: undefined is not a function
- WARN: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
- Start PA.
- Go to the Galactic War Loadout screen.
- Confirm that your loadout is listed, locked, and its hint displayed.
- Confirm that your card was dealt to your inventory and no errors show in the debugger.
- In the debugger switch to the Resources tab.
- Expand local storage.
- Click on
coui://
. - If the key
gwaio_bank
does not exist then right-click in the empty line at the bottom and create it. - Right-click
gwaio_bank
and choose to edit the value, adding your start card ID in the format{"id":"your_card_id"}
- the final result should look something like{"startCards":[{"id":"some_card_you_previously_unlocked"},{"id":"your_card_id"}]}
. - Press Enter to save your change.
- Press F5 to refresh the loadout screen.
- Confirm that your loadout is unlocked and selectable.
- Start PA.
- Start a new Galactic War.
- Click the X in the bottom left-hand corner.
- Enter your card ID into the panel.
- Click the + icon to the right of the text entry box.
- Confirm that your card was dealt to your inventory and no errors show in the debugger.
- In the debugger check the
Preserve log
box. - Begin a fight.
- Confirm that no unexpected errors show in the debugger.
- Use the sandbox to spawn your modified units and check that they operate correctly.
Update the following fields:
version
- consider semantic versioning.date
build
- match the contents of the version file at the root of PA.forum
- URL of the mod's forum thread.icon
- URL of a publicly accessible png file.