Game definition jsons - Transformation definitions

Learn the .json format
used to define characteristics of units and other game elements
Post Reply
Stratego (dev)
Site Admin
Posts: 10669
Joined: Fri Apr 25, 2014 9:28 pm

Game definition jsons - Transformation definitions

Post by Stratego (dev) » Wed Sep 13, 2017 8:31 pm

in tarnsforms.json you can define how transformations should behave (eg. centaur ranged/melee form transition)

Options

also there are options how the transformed units should keep the enchants it had prior, or keep the hp - or starting as new unit and so on, here are the options:
// KEEP_HP = needHPTransfer (as a percentage of max hp);
// KEEP_HP_VALUE (the plain hp value)
// KEEP_NAME = needNameTransfer
// KEEP_ENCHANTS = needEnchantTransfer
// TO_GAIA = needChangePlayerToGaia
// RESET_ACTION_MOVEMENT reinitialize Action And Movement
// RESET_MOVEMENT reinitialize the movement
// RESET_ACTION reinitialize the action movement
// DROP_ID = needDropID
// TO_LATEST_TYPE = means if knight to be spawned and player has heavy knight than spawn heavy instead.

Tech dependency:
trnTechDepTrn; //techDependentTransform from json format: TECH_XXX:TRN_YYY meaning on given tech use that transform instead, order of rows matters (the latest definition will be used first)!

Generalized tranformations:
you dont need to make new transformations for each unit type, only one general for most unit transformations like "TO_ANYTHING"
as from now you can set the target unit type in the Effect definition trnActionUnitID field.

i made it in AOS like this to test

Code: Select all

{"name": "TO_SPECIFIED_UNIT_FORM", "units": ["UNIT_NEUTRAL_STONE_STATUE"], "needs": ["KEEP_HP", "KEEP_NAME", "KEEP_ENCHANTS"]}
and in the trebuchet transform effect

Code: Select all

         "trnActionUnitID":"UNIT_TREBUCHET_STAND",
         ...
         "trnTransformTo":"TO_SPECIFIED_UNIT_FORM",

Sample json content:

Code: Select all

[
{"name": "TO_TREASURE_SHIP",     "units": ["UNIT_UND_TREASURE_SHIP"],              "needs": []},
{"name": "SPECTRAL_REAPER",      "units": ["UNIT_UND_SPECTRAL_RIDER_UNM"],         "needs": ["KEEP_ENCHANTS"]},
{"name": "TO_UNDEAD_ARCHER",     "units": ["UNIT_UND_SKELETON_ARCHER"],            "needs": ["KEEP_ENCHANTS"]},
{"name": "TO_UNDEAD_SPEARMAN",   "units": ["UNIT_UND_SKELETON_SPEARMAN"],          "needs": ["KEEP_ENCHANTS"]},
{"name": "TO_UNDEAD_SWORDMAN",   "units": ["UNIT_UND_SKELETON"],                   "needs": ["KEEP_ENCHANTS"],   "trnTechDepTrn": ["TECH_UND_UPGRADE_UNIT_SKELETON_ARMORED:TO_UNDEAD_ARCHER", "TECH_UND_UPGRADE_UNIT_SKELETON_GOLDEN:TO_UNDEAD_MAGE"]},
{"name": "TO_CORPSE_HUMAN",      "units": ["UNIT_DEAD_HUMAN1"],                    "needs": ["TO_GAIA", "DROP_ID"]},
{"name": "TO_CORPSE_MOUNTED",    "units": ["UNIT_DEAD_MOUNTED1"],                  "needs": ["TO_GAIA", "DROP_ID"]},
{"name": "TO_CORPSE_SPEARMAN",   "units": ["UNIT_DEAD_SPEARMAN1"],                 "needs": ["TO_GAIA", "DROP_ID"]},
{"name": "TO_CORPSE_ARCHER",     "units": ["UNIT_DEAD_ARCHER1"],                   "needs": ["TO_GAIA", "DROP_ID"]},
{"name": "TO_CORPSE_SHIP",       "units": ["UNIT_DEAD_SHIP"],                      "needs": ["TO_GAIA", "DROP_ID"]},
{"name": "TO_CENTAUR_MELEE",     "units": ["UNIT_ELF_CENTAUR_MELEE"],              "needs": ["KEEP_HP", "KEEP_NAME", "KEEP_ENCHANTS"]},
{"name": "TO_CENTAUR_RANGER",    "units": ["UNIT_ELF_CENTAUR_RANGED"],             "needs": ["KEEP_HP", "KEEP_NAME", "KEEP_ENCHANTS"]},
{"name": "TO_FRODO",             "units": ["UNIT_HOBBIT_FRODO"],                   "needs": ["KEEP_HP", "KEEP_NAME", "KEEP_ENCHANTS"]},
{"name": "TO_FRODO_RINGED",      "units": ["UNIT_FARAMIR_RANGED"],                 "needs": ["KEEP_HP", "KEEP_NAME", "KEEP_ENCHANTS"]},
{"name": "TO_FARAMIR_RANGED",    "units": ["UNIT_UND_TREASURE_SHIP"],              "needs": ["KEEP_HP", "KEEP_NAME", "KEEP_ENCHANTS"]},
{"name": "TO_FARAMIR_MELEE",     "units": ["UNIT_FARAMIR"],                        "needs": ["KEEP_HP", "KEEP_NAME", "KEEP_ENCHANTS"]},
{"name": "VAMPIRE_BAT",          "units": ["UNIT_UND_VAMPIRE_BAT_FORM"],           "needs": ["KEEP_HP", "KEEP_NAME", "KEEP_ENCHANTS"]}
]

Stratego (dev)
Site Admin
Posts: 10669
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Transformation definitions

Post by Stratego (dev) » Mon Nov 27, 2017 8:57 pm

new transformations in aof for the dying units turning to corpse
{"name": "TO_CORPSE_HUMAN", "units": ["UNIT_DEAD_HUMAN1"], "needs": ["TO_GAIA", "DROP_ID"]},
{"name": "TO_CORPSE_MOUNTED", "units": ["UNIT_DEAD_MOUNTED1"], "needs": ["TO_GAIA", "DROP_ID"]},
{"name": "TO_CORPSE_SPEARMAN", "units": ["UNIT_DEAD_SPEARMAN1"], "needs": ["TO_GAIA", "DROP_ID"]},
{"name": "TO_CORPSE_ARCHER", "units": ["UNIT_DEAD_ARCHER1"], "needs": ["TO_GAIA", "DROP_ID"]},
{"name": "TO_CORPSE_SHIP", "units": ["UNIT_DEAD_SHIP"], "needs": ["TO_GAIA", "DROP_ID"]},

Stratego (dev)
Site Admin
Posts: 10669
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Transformation definitions

Post by Stratego (dev) » Fri Feb 14, 2020 8:11 am

trnTechDepTrn
trnTechDepTrn; //techDependentTransform from json format: TECH_XXX:TRN_YYY meaning on given tech use that transform instead, order of rows matters (the latest definition will be used first)!

Stratego (dev)
Site Admin
Posts: 10669
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Transformation definitions

Post by Stratego (dev) » Tue May 12, 2020 1:42 pm

new option
// TO_LATEST_TYPE = means if knight to be spawned and player has heavy knight than spawn heavy instead.

Stratego (dev)
Site Admin
Posts: 10669
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Transformation definitions

Post by Stratego (dev) » Fri Jun 05, 2020 5:31 pm

// KEEP_HP = needHPTransfer (as a percentage of max hp);
// KEEP_HP_VALUE (the plain hp value)

change in usage of keep hp, and a new keep_hp_vaule

Stratego (dev)
Site Admin
Posts: 10669
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Transformation definitions

Post by Stratego (dev) » Sun Jul 26, 2020 6:51 am

Generalized tranformations:
you dont need to make new transformations for each unit type, only one general for most unit transformations like "TO_ANYTHING"
as from now you can set the target unit type in the trnActionUnitID field.

i made it in AOS like this to test

Code: Select all

{"name": "TO_SPECIFIED_UNIT_FORM", "units": ["UNIT_NEUTRAL_STONE_STATUE"], "needs": ["KEEP_HP", "KEEP_NAME", "KEEP_ENCHANTS"]}
and in the trebuchet transform effect

Code: Select all

         "trnActionUnitID":"UNIT_TREBUCHET_STAND",
         ...
         "trnTransformTo":"TO_SPECIFIED_UNIT_FORM",

User avatar
L4cus
Posts: 1162
Joined: Fri Jan 31, 2020 7:51 pm
Location: Perú

Re: Game definition jsons - Transformation definitions

Post by L4cus » Thu Jul 30, 2020 2:09 am

okok, i need a tutorial about this!
Extra ecclesiam nulla salus...
AOD, a new variant...
viewforum.php?f=230

Stratego (dev)
Site Admin
Posts: 10669
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Transformation definitions

Post by Stratego (dev) » Wed Aug 05, 2020 4:02 pm

new options
// RESET_MOVEMENT reinitialize the movement
// RESET_ACTION reinitialize the action movement

Post Reply

Return to “Game Definition .JSON”