Effect definition json

Here you may find answers to your questions.

Effect definition json

Postby Stratego (dev) » Sun Dec 18, 2016 8:02 am

Here is how to create effect definitions (that can be used in "spell" or ability section of a unit json)

effect behaviours:
INSTANT, //SPELL immediate and permanent kind and no long lasting effects
ENCHANTMENT, //EFFECT long lasting modifier, but activates only on the first turn, when removed the modifications are undoed (need to save or something), should not be special ability like convert
ENCHANTMENT_VANISHING, //EFFECT long lasting modifier, but activates only on the first turn, when wears off or removed the modifications are undoed (need to save or something), should not be special ability like convert
INSTANT_REPETITIVE_VANISHING, //EFFECT on impact, and each turn it executes (eg. poisoning), when vanished unit remains as it is (no regaining abilities).
REPETITIVE_VANISHING, //EFFECT on impact does nothing, but each turn it executes (eg. poisoning), when vanished unit remains as it is (no regaining abilities).
REPETITIVE_VANISHING_ENCHANTMENT, //EFFECT on impact does nothing, but each turn it executes (eg. slowing), when vanished unit regains its old abilities
SUSPENDED, //EFFECT does nothing on impact and nothing on countdown, but at the end it executes the effect (eg. delayed conversion), permanent
TRIGGERED_EFFECT, //EFFECT says : no execute, only on trigger.
EFFECT_SPELL, // only places an effect of a different effectID (giving lifelink)
AURA_EFFECT //EFFECT says : no execute, only on AURA TRIGGERS. (an aura)


possible target types:
HIMSELF,
FRIENDLY,
FRIENDLY_BUT_NOT_ME,
ENEMY,
ENEMY_OR_FRIENDLY,
ENEMY_OR_FRIENDLY_BUT_NOT_ME,


special cost options:
SACRIFICE_UNIT, // spell that requires specCostNr number of nearby corpse (consumes it) to be casted
SACRIFICE_HP_AMOUNT,
SACRIFICE_POWER_AMOUNT,
NEARBY_CORPSE, // spell that requires specCostNr number of nearby corpse (consumes it) to be casted


system special effects
public static final int SYSTEM_SPECIAL_EFFECT_CONVERT = 100;
public static final int SYSTEM_SPECIAL_EFFECT_HEAL = 101;
public static final int SYSTEM_SPECIAL_EFFECT_DISENCHANT = 102;
public static final int SYSTEM_SPECIAL_EFFECT_SUMMON = 103;
public static final int SYSTEM_SPECIAL_EFFECT_REGENERATION = 104;



public static final int SYSTEM_SPECIAL_EFFECT_FORESTWALK = 108;
public static final int SYSTEM_SPECIAL_EFFECT_MOUNTAINWALK = 109;
public static final int SYSTEM_SPECIAL_EFFECT_WATERWALK = 110;
public static final int SYSTEM_SPECIAL_EFFECT_AIRWALK = 111;

public static final int SYSTEM_SPECIAL_EFFECT_TRANSFORM1 = 112;
public static final int SYSTEM_SPECIAL_EFFECT_ANIMATE_DEAD = 113;

public static final int SYSTEM_SPECIAL_EFFECT_ENVIRONMENTAL = 114; //An instant spell that casts a lightning storm, or fireball storm or ice storm - effects in a radius with a special randomization
public static final int SYSTEM_SPECIAL_EFFECT_DISABLE = 115;

public static final int SYSTEM_SPECIAL_EFFECT_LASTSTURN_MODIFIER = 116; // a spell that will modify the lasts turn nr of a running effect on target unit


Other special settings in a list called "specs":
"specs":["BYPASS_SPELL_RESISTANCE"] -- if this is set then the spell is not affected by spell resistance



Summon or Place effect

Here the effect will spawn an other "unit" on pressing the effect button of the "caster" unit, it will start floating like the elf wolf does.
living samples:
- aof: elf wolf, skeleton dragon + orc dragon etc.
- aow: sea mines

{
"effectNameString":"EFFECT_INSTANT_SUMMON_WOLF", ---------------------- effect name
"effectDefID":126,------------------------------------------------------------------effect id
"trnActionUnitID":"UNIT_GER_BLD_WATER_MINES",---------------------which unit to summon ("NO_UNIT" means "unset" value)
"trnActionUnitIDForCaster":"NO_UNIT",--------------------------------------------which effect to apply on caster after casting (ef. losing health) ("NO_UNIT" means "unset" value)

"buttonTextureID":0,----------------------------------------------------------------for unique button (if the deafult the summoned unit image is not good enough)
"actionTextureID":0,-----------------------------------------------------------------not used here

"chancePercent":1.0,----------------------------------------------------------------chance of casting the spell, here use 1=100% if you want to be always
"lastsTurnNr":0,-----------------------------------------------------------------------not used here

"effectBehaviour":"INSTANT",--------------------------------------------------------effect behaviour (see above)
"effectTargets":"HIMSELF",-----------------------------------------------------------tagert types (see above)
"trnSystemSpecialEffectID":"SYSTEM_SPECIAL_EFFECT_SUMMON ",-----------Special effects (see above), here this is the summon unit

"isOneTimeSpell":false,---------------------------------------------------------------If canster can cast it on only once in his lifetime
"castRangeModifier":0,---------------------------------------------------------------- it can modify the spell range relative to caster default spellrange (eg +3)
"cooldownTurnNr":0,------------------------------------------------------------------If you want the spell has cooldown (caster needs to wait X turns before casting it again.)

"specCost":null,-------------------------------------------------------------------------special cost type (see above)
"specCostNr":1,--------------------------------------------------------------------------special cost amount (eg. 3 nearby corpses)

"priority":0-------------------------------------------------------------------------------The priority the AI should use when selecting weapons against targets: 0 for irrelevant ones, about 900 on strongest effects, 100-800 the average effects

}



just a full template ------

{
"effectNameString":"EFFECT_INSTANT_SUMMON_WOLF", ---------------------- effect name
"effectDefID":126,------------------------------------------------------------------effect id
"effectDefIDRelated":0,------------------------------------------------------------ not used here
"propertyChangerUnitID":308,-----------------------------------------------------which unit to summon (with id)
"propertyChangerUnitIDForCaster":-1,--------------------------------------------which effect to apply on caster after casting (ef. losing health) (-1 means nothing)

"trnIndicatorTextureID":"SOME_TEXTURE_ID",-------------------------------------------------------------use the texture "idString" here to reference
"trnButtonTextureID":null,----------------------------------------------------------------use the texture "idString" here to reference - for unique button (if the deafult the summoned unit image is not good enough)
"trnProjectileSpriteID":null,---------------------------------------------------------------use the sprite "idString" here to reference
"trnActionTextureID":null,-----------------------------------------------------------------use the texture "idString" here to reference
"trnSpotAnimationSpriteID":null,----------------------------------------------------------use the sprite "idString" here to reference

"chancePercent":1.0,----------------------------------------------------------------chance of casting the spell, here use 1=100% if you want to be always
"lastsTurnNr":0,-----------------------------------------------------------------------not used here

"effectBehaviour":"INSTANT",--------------------------------------------------------effect behaviour (see above)
"effectTargets":"HIMSELF",-----------------------------------------------------------tagert types (see above)
"systemSpecialEffectID":103,--------------------------------------------------------Special effects (see above), here this is the summon unit

"isOneTimeSpell":false,---------------------------------------------------------------If canster can cast it on only once in his lifetime
"castRangeModifier":0,---------------------------------------------------------------- it can modify the spell range relative to caster default spellrange (eg +3)
"cooldownTurnNr":0,------------------------------------------------------------------If you want the spell has cooldown (caster needs to wait X turns before casting it again.)

"specCost":null,-------------------------------------------------------------------------special cost type (see above)
"specCostNr":1,--------------------------------------------------------------------------special cost amount (eg. 3 nearby corpses)

"priority":0-------------------------------------------------------------------------------The priority the AI should use when selecting weapons against targets: 0 for irrelevant ones, about 900 on strongest effects, 100-800 the average effects

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

Re: Effect definition json

Postby Sunrise Samurai » Sat Sep 23, 2017 11:19 am

Can you compile a zip of a bunch of AoF abilities? Please include at least raise dead, fireball, convert, one aura, and one enchantment​ for us to study.
The Tournament of Dragons has begun
viewtopic.php?f=73&t=4516&p=44652&sid=7430fb9fba1d158e718711599ac4e38e#p44652
Follow the progress on the link. Be sure to root for your favorite player
User avatar
Sunrise Samurai
 
Posts: 1895
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Effect definition json

Postby Stratego (dev) » Sat Sep 23, 2017 2:57 pm

Not all AOF and AOS units/effects and other things are defined in jsons *, but here what are in AOF currently (effects, units, and so on - everything in AOF)
AOFJsons.zip
(306.56 KiB) Downloaded 26 times



* : AOW will be the first that is only JSON definition based.
Stratego (dev)
Site Admin
 
Posts: 6026
Joined: Fri Apr 25, 2014 9:28 pm


Return to FAQ

Who is online

Users browsing this forum: No registered users and 2 guests