Put this trnSpecUnitActions line into unit property sheet json with the desired specAcion flags.
Code: Select all
"trnSpecUnitActions":["IS_TERRAIN_ENTITY", "IS_GAIA_AI_ANIMAL_PEACEFUL", "IS_GAIA_ANIMAL"],
- it is usually positioned above the categories or races tags, like here
Code: Select all
...
"trnWeaponEffects":null,
"trnSpecUnitActions":["CAN_BE_FLOWN_TRU"],
"trnRaces":["RACE_ALLIES", "RACE_US"],
"trnCategories":["U_INFANTRY", "U_ANTI_INFANTRY", "DOC_INFANTRY"],
...
Code: Select all
//WHO am i
IS_FUN_UNIT, //if unit is a fun unit (replaces the obsolete boolean isFunModeBuildable)
TECH_IS_PROP_CHANGER, //if this tech is a property changer tech
TECH_AGE, // if this tech is an AGE tech
TECH_LEVEL_UP, // if this tech is a level up tech (alternative setting to the obsolete buildableSubType=TECH_LEVEL_UP)
TECH_STEALING, //Mark the Stealing tech with this (increases stealing possibility)
TECH_STEALING_DEFENSE, //Mark the Stealing Defense tech with this (decreases enemy stealing possibility)
TECH_LOYALTY, //Mark the Loyalty tech with this (on convert unit will got 1 hp instead)
TECH_SEE_ALLY_LOS, //Mark the Writing tech with this (lets u see your allies line of sight)
TECH_BONE_SIGHT, //Mark the Bone Sight tech with this (lets u see all corpses on map (for AOF))
TECH_NATURE_CALL, //Mark the Nature Call tech with this (lets u see all animals on map (for AOF))
IS_LEGENDARY, //on the game area only one can exists, the second will not be produced (stops production)
IS_UNIQUE, //for the player only one can exists, the second will not be produced (stops production)
IS_ALL_TECH_MEMBER, //if a tech that needs to be in "all techs" section - meaning the it is a DEFAULT tech (despite it is in upgrades section)
IS_NOT_ALL_TECH_MEMBER, //if a tech that needs NOT to be in "all techs" section - meaning the it is not a DEFAULT tech (despite it is NOT in upgrades section)
IS_REANIMATABLE, //is it a corpse to be reanimated
IS_TERRAIN_ENTITY, //considered as terrain entity (if the map has only these units than it is still only a terrain (random) map
IS_TC, //is it a TC itself
PROD_SPEEDUP, // if unit is in a TC than it will be used for any other unit production (!gives round(costTurn/2) turns to production)
IS_PASSIVE_UNIT, // if set, this unit is not required to be destroyed on a map game over check.
IS_TECH_DEFAULT_FOR_AI, // (works for non-AiProfiled AI-s only!) set this to any tech to give to all AI by default, eg. in AOF we needed wheel tech by deafult for ai to be able to move catapults
IS_EFFECT_AFFECT, //if it is an effect affect definition (that alters a unit properties initiated by a spell or ability)
//my properties
CAN_BE_FLOWN_TRU, // if this unit is so low on ground and has no armament to reach - so flyers van fly over it (like caltrops in AOW)
CAN_BE_PASSED_BY_ENEMY, //if a unit can not "block" enemy ever (like a plane should not block ground units and other planes in movement.
NO_WALKABLE_TROUGH, // same as "isWalkableThrough" that is obsolete, if set than the unit is not walkable tru even with allies (like a wall), default is taht all unit is walkable tru
IS_OCCUPIABLE, // - occupiable like the TC but means only occupiable and means internal units make damaged(nothing else that isoccupiablebuilding means like no pop limit, visible on exp?lored terrain and so on)
IS_STEALABLE, // - set it to an occupiable building/unit (that is not a TC) if you want to let the occupier player to try to steal a tech (like TC case do)
IS_CARRIED_DAMAGABLE, //if the carried units are receiving damage or not (like on TC-s) - combine lthis with IS_INATTACKABLE to work like a TC
IS_CARRIED_SURVIVES_INTACT, //if the carried unit survives the destruction of its carrier, than unit will not lose action and movement (as by default it would)
NO_CONSTRUCT, //if a mending unit can not build and can not construct under construction units/buildings (like mending ship should not)
NO_MEND_HIMSELF, //if a mending unit can not mend himself, only garrisoned units (eg. airport)
NO_MEND_HEAL_FROM_UNITS, // means worker and healer builtin logic will not affect it only if carried in a building (temple/shipyard)
CAN_MEND_IT_CAN_CONSTRUCT, // it ca only mend things that he was able to construct in the first place.
CAN_FLY, //in the new terrain era we lost the info that a unit can fly or not, so this spec action will indicate flying.
CAN_FLY_HIGH, //in the new terrain era we lost the info that a unit can fly or not, so this spec action will indicate flying high fly: flies tru enemies too.
CAN_HIT_FLYING, // if set the unit can attack and hit flying as it were "arrowed" in AOS/AOF, if not set it can hit only 1 hit.
CAN_NOT_LOAD_UNLOAD, //unit that has carry ability but still can not load unload units (eg. when submarine carrier is under water)
CAN_LOAD_UNLOAD, //Unit can now load / unload units (even if it has CAN_NOT_LOAD_UNLOAD spec already, this overrides that)
IS_LOAD_UNLOAD_COST_MOVEMENT, // when unit enters or leaves this carrier, that unit loses a movement
CAN_NOT_COUNTERATTACK, //the unit can not counterattack
NO_PLAYER_CONTROLLED, // such unit is not controllable by the player, only AI will control it in the name of the player.
IS_BUILD_IMMEDIATE, //this case the building (eg. palisade) will not have an 1hp construction site and you can build further, but it builds immediately to the hp where the builder can build it.
IS_EFFECT_NOT_FOR_UNDERCONSTR, // if the prop changetr or tech is not for under constuction things.
CAN_GO_TRU_ENEMY_OBJECTS, //a shade that can go tru even on enemy objects.
IS_STEPPABLE, //anyone can step on it (like it was terrain) but immediately vanishes
IS_INATTACKABLE, //can be targeted or not (not used yet)
IS_INCONVERTIBLE, //can not be converted, ever.
IS_FACTORY_NOT_COUNTED, //if a factory is not counted as normal or mega factory either.
IS_FACTORY_COUNTED_AS_MEGA, //increases the mega building counter (even if it is not a factory!)
IS_FACTORY_COUNTED_AS_NORMAL, //increases the normal building counter (even if it is not a factory!)
IS_DECREASE_COUNT_FACTORY, // (use only with DEV approval!) is this unit / building is decreasing the built factory count (simulates that you have 1 less factory built)
IS_DECREASE_COUNT_MEGA, // (use only with DEV approval!) is this unit / building is decreasing the MEGA building count (simulates that you have 1 less mega built)
IS_DIE_HARD, // its HP can not go under 1hp, unless it has 1hp, than it can die.
IS_MOVEMENT_COSTS_ACTION, // its movement will cost one action also (so eg. it can not shoot and move in one turn)
IS_MOVEMENT_COSTS_ALL_ACTION, // its movement will cost ALL action also, and will require all action to move (so eg. it can not shoot and move in one turn)
IS_BLOCKING_TERRAIN_AFFECTS, // this unit (a carrier) will not let units inside to get the terrain effect-affects from terrains (property changing effects except movement/steppability, that is still uses the isCarrierRemovesTerrainDrawbacks)
IS_INFINITE_TALL, // units that should not be shot over, "spell" over - so anything behind is protected (like a wall in a room), not set with IS_INFINITE_TALL_FOR_MOVE than it lets walk tru though
IS_INFINITE_TALL_FOR_MOVE, // units that should not be move tru/over, fly over even with high fly (like a wall in a room if set with IS_INFINITE_TALL)
IS_TELEPORT, // MUST not be buildable (until AI upgrade), so only NOT_OCCUPIABLE mapeditor unit. It will teleport just carried units to another IS_TELEPORT building of same player (if there is space to)
POP_NOT_CONSUMER, // by default isUnitPopConsuming() says consumer is Non-factory, walking unit. Using this spec it can be surely set to be NOT CONSUMER.
POP_CONSUMER, // by default isUnitPopConsuming() says consumer is Non-factory, walking unit. Using this spec it can be surely set to be CONSUMER.
//stealt/spy ptoperties
STEALTH_UNIT, //this is the new definition for stealth units (instead of isStealthUnit) means IS_STEPPABLE + STEALTH_ONLY_UNIT + STEALTH_CAN_SEE_STEALTH + CAN_STEAL_TECH_FROM_TC + CAN_SPY_ENEMY_CARRIER
STEALTH_ONLY_UNIT, //this is a indicator of a unit that is not an ASSASSIN but onlya stealth/invisible unit.
STEALTH_EXPLODES_ON_STEP, //ise this to make damaging units, that damages on step (like a trap, or landmine)
STEALTH_FORCES_STEP_ON, // (also mean IS_STEPPABLE) unit can not go tru it, it will stop on it, destroying stealth unit (for land/sea mines)
STEALTH_FORCES_STEP_BLOCKED, // unit can not go tru it, it will stop right before it, not destroying stealth unit (for submarines)
STEALTH_CAN_SEE_STEALTH, //this is the new definition for stealth units (instead of canSeeStealthUnits)
CAN_STEAL_TECH_FROM_TC, //this is a indicator of a unit that is not an ASSASSIN but only a stealth/invisible unit.
CAN_SPY_ENEMY_CARRIER, //can see the internals of enemy carriers
//Attack
BYPASS_ARMOR, //if the unit damage is reduced by the armor
BYPASS_PARMOR, //if the unit damage is reduced by the parmor
IS_EFFECT_REDUCED_BY_ARMOR, // if the prop changer effect (that is HP changing one!) will be reduced by NORMAL armor
IS_EFFECT_REDUCED_BY_PARMOR, // if the prop changer effect (that is HP changing one!) will be reduced by PIERCE armor
// counter attack
ATTACK_FIRST_STRIKE, // damaging unit deals counter attack first before attacker can damage, only if attacker has no first strike too.
ATTACK_FULL_COUNTER, // means the unit has a counter damage without penalty (without halving it)
ATTACK_FULL_COUNTER_IF_BONUS, //defender having it deals full damage on counter only if he has bonus against attacker.
ATTACK_COUNTER_DOUBLE, //if unit gets attacked it can double counter damage on attacker (defensive units like a ww2 bomber can counter well its attacking fighters)
ATTACK_COUNTER_QUARTERED, //unit counterattack has halved damage comparing to normal counterattack - meaning 1/4 of damage - it's perfect for some units previosly having no counter - flailman)
ATTACK_COUNTER_NO_BONUS_VS_BONUS, //e.g. Knight has this specAction and is attacked by Vouglier - Knight counter is without bonus (and that is halved). But when knight attacks, vouglier deals damage with bonus (and that is halved).
ATTACK_COUNTER_NO_BONUS, //No bonuses counter ( unit doesn't deal any bonus damage in counters - it's bonuses work only offensively - one of the options for various offensive oriented units)
ATTACK_NO_COUNTER_BONUS_AGAINST_ME, //E.g. Celt has this specAction and attacks Hoplite - hoplite deals counter damage without bonus (and that is halved). When celt is attacked by Hoplite he would (if he somehow survived) deal counter damage with bonus (and that is halved).
ATTACK_COUNTER_QUARTERED_AGAINST_ME , //counterattack against unit having this spec is additionally halved
ATTACK_NO_COUNTER_AGAINST_ME, //when unit has it there is no counterattack againt him
CAN_NOT_ATTACK_WHEN_GARRISONED, // if the attacking unit is garrisoned in a building that is not a bridge than it can not attack.
ATTACK_NEEDS_OPERATOR, // structures eg. towers, castles: if structure is not carrying any units than it can not attack with its default attack (same for counterattack)
ATTACK_ACCURACY_DECR_BY_SPEED, //The powerAccuracyPenalty will be multiplied with speed of TARGET unit (meaning bigger miss chance on speedy targets).
// AI/internal logics
ATTACK_NOT_RANGED, //eg. pierce melee weapons: if set than the attacktypearrow|attacktypeburningrock units will be considered close combat units that piercing or normal armor deflected.
NO_LOOK_FOR_HEAL, //means will not stop attacking when injured/damaged to look for heal/mend possiblity (like suicide units like demolition ship or petardier)
AI_NO_DEFEND_TC, // AI will not send this unit to defend TC-s (use it with NO_LOOK_FOR_HEAL if needed)
AI_FACTORY_SINGLE, //AI information: means only one factory must be built for an AI player from this in one game (eg. blacksmith)
AI_NOT_TO_BUILD_FACTORY, //AI will not use this unit (eg. riflemen in AOMW) to build factory (around TC-s)
AI_USE_AS_OCCUPIER, //use this unit as it would could be occupier - as it has some ability that will let this occupy. eg. paratrooper plane
IS_GAIA_ANIMAL, //the unit is a gaia animal (at least it was on game start)
IS_GAIA_AI_ANIMAL_PEACEFUL, //the unit is a gaia animal and its ai is peaceful like a deer
IS_GAIA_AI_ANIMAL_HOSTILE, //the unit is a gaia animal and its ai is hostile, attacks if you make in its sight range
IS_GAIA_AI_ANIMAL_HOSTILE_IF_WOUNDED, //the unit is a gaia animal and its ai is hostile, attacks if it is wounded and you make in its sight range
TRANSPORTING_VEIN, // if unit basic task is a transporter (not an attacker) than this is set.
SPAWNPOINT_2_PLAYER, //the 1st and 2nd player spawnpoints, will be replaced by a TC
SPAWNPOINT_4_PLAYER, //the 3rd and 4th player spawnpoints, will be replaced by a TC
SPAWNPOINT_6_PLAYER, //the 5th and 6th player spawnpoints, will be replaced by a TC
Counter attacks
(Endru collected it - thanks!)
How currently counter attack calculations work:
Counter is based around two parts - applying bonuses and counter damage divider.
Crucial part is boolean value (possible to be changed in initialization.json) IS_BONUS_NEGLECTS_EACH_OTHER
Normally it is false, but in older times game was working this way (and AoF still uses it at the time of writing).
Counter damage is normally calculated using 50% of normal attack and applies damage bonuses.
Damage bonuses are NOT applied on counter damage in four cases:
- IS_BONUS_NEGLECTS_EACH_OTHER=true AND attacker has any bonus damage against defender
- defender has ATTACK_COUNTER_NO_BONUS_VS_BONUS spec AND attacker has any bonus damage against defender
- defender has ATTACK_COUNTER_NO_BONUS spec
- attacker has ATTACK_NO_COUNTER_BONUS_AGAINST_ME spec
There is also a case of changing attack on counter damage calculation
- it is 50% (divided by 2, commonly rounded down) normally
- becomes 100% (no decrease) in 3 cases:
- defender has ATTACK_FULL_COUNTER spec
- defender has ATTACK_FULL_COUNTER_IF_BONUS spec AND any bonus damage against attacker
- IS_BONUS_NEGLECTS_EACH_OTHER=true AND defender has any bonus damage against attacker UNLESS
-defender has any bonus damage against attacker
-defender has ATTACK_COUNTER_NO_BONUS spec
-attacker has ATTACK_NO_COUNTER_BONUS_AGAINST_ME spec
-previous value is halved if attacker has ATTACK_COUNTER_QUARTERED_AGAINST_ME spec (divider is doubled)
-previous value is halved if defender has ATTACK_COUNTER_QUARTERED spec (divider is doubled)
-previous value is doubled if defender has ATTACK_COUNTER_DOUBLE spec (divider is halved)