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: 14774
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
// TO_EFFECT_CASTER_PLAYER -> the new unit after transform will be owned by the player that the original caster was of the executing effect (eg. zombi infection)
// RESET_ACTION_MOVEMENT reinitialize Action And Movement (sets to max)
// RESET_MOVEMENT reinitialize the movement (sets to max)
// RESET_ACTION reinitialize the action movement (sets to max)
// CLEAR_ACTION, clears action (set to no actions left)
// CLEAR_MOVEMENT, clears movement (set to no movement left)
// CLEAR_ACTION_MOVEMENT clears action and 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)!


3 ways of using a transformation
You have 3 option to use a transformation definition (in transforms.json)
1. You can set it in the unit definition
2. you can set it in the transformation effect itself
3. you can set it in the transformation effect itself but overwriting the target unit form (you can use generalized transformation definition)


1. setting in unit definition
The classic way
- you set the "trnTransformTo1" field in the unit defintion
- you give an ability to unit that is SYSTEM_SPECIAL_EFFECT_TRANSFORM1 type

the logic will find the target transformation definition from the unit.

2. setting in transformation effect
This case
- you leave empty the "trnTransformTo1" field in the unit defintion
- but you set the "trnTransformTo" field in the transformation effect itself

this is also written in effects:
"trnTransformTo" ----------------------------------------------------------------------transformation ID, used for case of SYSTEM_SPECIAL_EFFECT_TRANSFORM1, if null than the Unit.transformTo1 value will be used
viewtopic.php?f=215&t=3565#p34393


3. Generalized tranformations:
This case you
- you leave empty the "trnTransformTo1" field in the unit defintion
- you set the "trnTransformTo" field in the transformation effect itself - here you can use a general transformation see below:

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: 14774
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: 14774
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: 14774
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: 14774
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: 14774
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: 2349
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: 14774
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

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

Re: Game definition jsons - Transformation definitions

Post by Stratego (dev) » Mon May 09, 2022 5:48 am

new option

// TO_EFFECT_CASTER_PLAYER -> the new unit after transform will be owned by the player that the original caster was of the executing effect (eg. zombi infection)

User avatar
makazuwr32
Posts: 7700
Joined: Tue Oct 17, 2017 9:29 am
Location: Moscow, Russia

Re: Game definition jsons - Transformation definitions

Post by makazuwr32 » Mon May 09, 2022 1:22 pm

Good.
This will come in handy for various parasite-based spells.
makazuwr32 wrote:
Mon Sep 16, 2019 7:54 am
When you ask to change something argument why...
Put some numbers, compare to what other races have and so on...
© by Makazuwr32™.
AoF Dev Co-Leader
Image

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

Re: Game definition jsons - Transformation definitions

Post by Stratego (dev) » Thu May 12, 2022 6:54 am

new options
// CLEAR_ACTION, clears action (set to no actions left)
// CLEAR_MOVEMENT, clears movement (set to no movement left)
// CLEAR_ACTION_MOVEMENT clears action and movement

Post Reply

Return to “Game Definition .JSON”