A Guide to Creating Tactical Spells for Elemental:
In this guide, we shall be outlining various generic spells and game modifiers to allow the average modder to easily put together interesting and appealing spells for the current system. This guide should be considered more of a reference guide than a tutorial, though we will be taking a deeper look at some of the components in order to give an explanation of how to put all the generic pieces together. The guide is broken down into 3 sections - Generic Spell Skeletons, Generic Spell Modifiers, Generic Spell Effects and Putting it All Together. Please feel free to leave comments below, though I ask that comments regarding spelling, grammar or typo graphical errors be sent through pm.
Generic Spell Skeletons:
All tactical spells can be defined as being in one of two classes. Offensive spells and Defensive spells. A third class of spell does exist (Movement) but we shall discuss this particular class at the end of this guide, as it is not as pliable as the other classes. This is denoted in the spell by the tag <spellclass>. The class of spell defines whether the target will be a friend or enemy. For example, a friendly unit can not be the direct target of an offensive spell. Now below I have outlined two generic spell skeletons, one for an offensive spell and one for a defensive spell. It is important to note here that these skeletons leave out the tags for the spell effects and game modifiers, as these will be discussed in the appropriate section. A third class of spell does exist (Movement) but we shall discuss this particular class at the end of this guide, as it is not as pliable as the other classes. Lets walk line by line through the generic code for any spell and we shall discuss the more specific lines in the appropriate subsection.
Code: xml
- <SpellDef InternalName="Some_Name">
This is beginning line of any spell definition. The InternalName here specifies a unique identifier for your new spell. If one uses a InternalName whichis already in use, then this spell modifies the predefined spell. In most cases, it is best to use a unique name, even when doing a modification as to ensure that only your version is used. In the case of modifying and existing spell, it is probably best to modify the spellbook, item, or unit which unlocks the spell to your internalname.
Code: xml
- <DisplayName>%s</DisplayName>
This tag defines the string, which represents the displayed name of your spell. The tag is fairly self explanatory. Here and in the skeletons, I have used the tag %s to denote the use of a plain ascii string. A quick note, be careful about the length of your strings as long strings may have odd consequences.
Code: xml
- <Description>%s</Description>
This tag defines the string, which represents the displayed description of your spell. The tag is fairly self explanatory. Here and in the skeletons, I have used the tag %s to denote the use of a plain ascii string. A quick note, be careful about the length of your strings as long strings may have odd and undesired consequences.
Code: xml
- <Image>%IMAGE</Image>
This tag denotes the image that will be shown in various places, where a larger size image is used. This particularly effects the spell book screen where a larger size image is used in the description box. Here and in the skeletons, I have used %IMAGE to denote an image file name to be used. This can be either a single file name or a relative path. Be careful when using a relative path, as the working directory will be the GFX directory in the elemental mods directory and not the elemental program directory.
Code: xml
- <IconFG>%IMAGE</IconFG>
- <IconBG>%IMAGE</IconBG>
These two tags denote the foreground and background images to be used for the spell icon. This particularly effects the icons shown in the spell book and on the bottom bar ( for abilities ). Here and in the skeletons, I have used %IMAGE to denote an image file name to be used. This can be either a single file name or a relative path. Be careful when using a relative path, as the working directory will be the GFX directory in the elemental mods directory and not the elemental program directory.
Code: xml
- <IconColor>%n255,%n255,%n255</IconColor>
This tag denotes the background color of the icon. This only effects Icons where the UI background is visible. Here and in the skeletons, I have used $n255 to denote an integer between 0 and 255.
Code: xml
- <Range>%n>-2</Range>
This tag denotes the range of the spell measured in tactical map tiles. For instance, a range of 0 is self cast only and a range of 10 is 10 tiles away from the caster. Since spells do not current allow for one to specify melee or ranged, use a range of 1 for melee spells and all other ranges for ranged spells. Here and in the skeleton, I have used %n>-1 to denote a integer greater than -2. An important note, specifying the range as -1 means that the spell has no range limitations. That is, this spell can be cast on any square in the tactical map.
Code: xml
- <Radius>%n>=0</Radius>
This tag denotes the radius around the target which is effected by the spell. A radius of zero denotes the spell effects only the target, whereas a radius of 1 denotes the spell will effect any targetable unit which is less than 2 tile distance away (ie the 8 tiles around the target tile). Here an in the skeletons, I have used %n>=0 to denote an integer greater than or equal to 0. It is important to note here, that this tag is actually unnecessary in general, as the engine will set any spell without this tag to have a radius of 0.
Code: xml
- <SoundFX>%SFX</SoundFX>
This tag denotes the sound fx that will be played the spell has been cast. Here and in the skeletons, I have used %SFX to denote the name of a particular sound fx to be played.
Code: xml
- <Cooldown>%n>=-1</Cooldown>
This tag denotes the amount of turns a spell must cool down before it can be cast again. This tag is unnecessary and defaults to 0 if it is left out. The value specified is the number of full turns required for the spell to be usable again. Here and in the skeletons, I have used %n>=-1 to denote the use of an integer which is greater than or equal to -1. It is important to not that a cooldown of -1 denotes one time cast per battle.
Code: xml
- <RequiredStat>%UNITSTAT, %n>-1</RequiredStat>
This tag denotes that some stat requirement is necessary for your spell. This tag should only be added if your spell has a specific stat requirement. Here and in the skeletons, I have used %UNITSTAT to denote the use of the InternalName of a unit stat found in CoreUnitStats.xml or added via a mod, and also %n>-1 to denote an integer greater than -1.
Code: xml
- <SpellLevel>%n>0</SpellLevel>
- <SpellType>Tactical</SpellType>
These tags denote the spell level and that the spell is a tactical spell. The spell level can be any spell level reachable in the game, though if one is making a special ability or a ranged attack, you should probably just use 1 (though it is not really necessary). Here and in the skeleton, I have used %n>0 to denote any integer greater than 0.
Code: xml
- <IsSpecialAbility>%b</IsSpecialAbility>
- <p>
This tag denotes that a spell is actually a special ability. This tag is for abilities which will be directly unlocked via items or units, and is unnecessary for spells based around spell books. Here and in the skeleton, I have used %b to denote a single binary number, 0 or 1. 0 denotes off and 1 denotes on. It is important to note that this tag can be omitted as the engine will assume a value of 0 if it is not specified.
Code: xml
- <IsResistable>%b</IsResistable>
This tag denotes whether or not the spell can be resisted. This tag uses a binary value, 0 or 1, to denote on or off. Here and in the skeleton I have used %b to denote a binary value. It is important to note that this tag is unnecessary and defaults to 0 when omitted.
Code: xml
- <SpellResourceCost>
- <Resource>%RESOURCE</Resource>
- <Amount>%n>=0</Amount>
- </SpellResourceCost>
This group of tags denotes the resource cost for a particular spell. In general, you probably want to specify the resource as MANA, as other resources have a tendency to not function properly. This set of tags can be omitted for spell that have no resource cost for casting, as it defaults to zero. Here and in the skeletons, I have used %RESOURCE to denote the use of an appropriate resource type and %n to denote the use of an integer which is greater than or equal to 0.
Code: xml
- <SpellTargetType></SpellTargetType>
This tag is discussed in detail in the below skeleton sections.
Generic Offensive Spell:
Code: xml
- <SpellDef InternalName="Generic_Offensive">
- <DisplayName>%s</DisplayName>
- <Description>%s</Description>
- <Image>%IMAGE</Image>
- <IconFG>%IMAGE</IconFG>
- <IconBG>%IMAGE</IconBG>
- <IconColor>%n255,%n255,%n255</IconColor>
- <Range>%n>-2</Range>
- <Radius>%n>=0</Radius>
- <SoundFX>%SFX</SoundFX>
- <Cooldown>%n>=-1</Cooldown>
- <SpellLevel>%n>0</SpellLevel>
- <RequiredStat>%UNITSTAT, %n>-1</RequiredStat>
- <SpellType>Tactical</SpellType>
- <SpellClass>Offensive</SpellClass>
- <SpellTargetType>%TARGETOFFENSIVE</SpellTargetType>
- <IsSpecialAbility>%b</IsSpecialAbility>
- <IsResistable>%b</IsResistable>
- <SpellResourceCost>
- <Resource>%RESOURCE</Resource>
- <Amount>%n</Amount>
- </SpellResourceCost>
- <GameModifier></GameModifier>
- </SpellDef>
- <p>
Above is a viable skeleton for an offensive tactical spell. While it currently lacks the defining variables needed to be functional, this skeleton can be used to create any offensive tactical spell by simply filling in the appropriate tags with your data. However, We have yet to discuss the one tag <SpellTargetType>, which specifies the target of the spell. Here we have used %TARGETOFFENSIVE to denote one of several possible string which can be added. Below you will find a near complete list of the possible string for defining the appropriate target for your tactical spell.
Target Variables:
EnemyUnit - This denotes an enemy unit as the target
EnemyUnitIgnoreFriendly - This is used for targeting only enemy units when the radius tag is used.
AllEnemyUnits - This targets all enemy units at once, without the need of a radius.
RandomEnemyUnit - A Random Enemy unit is targeted
Generic Defensive Spell:
Code: xml
- <SpellDef InternalName="Generic_Defensive">
- <DisplayName>%s</DisplayName>
- <Description>%s</Description>
- <Image>%IMAGE</Image>
- <IconFG>%FG</IconFG>
- <IconBG>%BG</IconBG>
- <IconColor>%n255,%n255,%n255</IconColor>
- <Range>%n</Range>
- <Radius>%n</Radius>
- <SoundFX>%SFX</SoundFX>
- <Cooldown>%n</Cooldown>
- <SpellLevel>1</SpellLevel>
- <SpellType>Tactical</SpellType>
- <SpellClass>DEFENSIVE</SpellClass>
- <SpellTargetType>%TARGETDEFENSIVE</SpellTargetType>
- <IsSpecialAbility>%b</IsSpecialAbility>
- <IsResistable>%b</IsResistable>
- <SpellResourceCost>
- <Resource>%RESOURCE</Resource>
- <Amount>%n</Amount>
- </SpellResourceCost>
- <GameModifier></GameModifier>
- </SpellDef>
Above is a viable skeleton for an defensive tactical spell. While it currently lacks the defining variables needed to be functional, this skeleton can be used to create any defensive tactical spell by simply filling in the appropriate tags with your data. However, We have yet to discuss the one tag <SpellTargetType>, which specifies the target of the spell. Here we have used %TARGETDEFENSIVE to denote one of several possible string which can be added. Below you will find a near complete list of the possible string for defining the appropriate target for your tactical spell.
Target Variables:
FriendlyUnit - Target Friendly unit
AllFriendlyUnits - Targets All Friendly units, without the need of a radius
AllFriendlySummonedUnits - Targets all your summoned units only
Self - Targets the caster ( DON'T USE THIS, the current tactical system does not really know how to handle this target and acts wacky when you use it).
Generic Spell Modifiers:
Every Spell in Elemental can be considered as having three specific parts, the control tags ( seen in the previous section ), the spell's particle effects ( discussed in the next section ), and the game modifiers. This section deals with the game modifiers, which define the particular effects of a spell. In general, a spell can support any number of game modifiers, and can support multiple modifiers of any given type. When utilizing game modfiers, there are several key limitations one must be aware of, which I shall outline:
1) Game Modifiers are for all intents and purposes, singular. That is, if you have a spell with two game modifiers, they will be applied individually.
2) Game Modifiers can not be linked directly or indirectly. That is, if you have two game modifiers, you can not specify that one happens only if the other happens.
3) Game Modifiers can not utilize some kind of if/switch statement. That is, if you specify two game modifiers, they will both activate with the spell.
4) All Game Modifiers have a specific form for the particular modifier. Some forms are similar to other, but not all are the same. Some Game Modifier have multiple forms, though each individual form must be completed for the modifier to work correctly
Below you will find a near complete list of all possible game modifiers, along with a skeleton and a small discussion about how to use them to the best effect. It should be noted that all of them work except where specified ( ie LifeSteal ).
Effect Type: Defendable Damage
Code: xml
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>DefendableDamage</Attribute>
- ?<Value>%n</Value>
- ?<MinValue>%n</MinValue>
- <MaxValue>%n</MaxValue>
- </GameModifier>
Effect Type: Target Does Not Counter
Code: xml
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>DoesNotCounterAttack</Attribute>
- <Duration>%n</Duration>
- </GameModifier>
Effect Type: Adjust Target's Stat
Code: xml
- <GameModifier InternalName="DefenseModifier">
- <ModType>Unit</ModType>
- <Attribute>AdjustUnitStat</Attribute>
- <StrVal>%stat</StrVal>
- ?<Value>%n<Value>
- ?<Multiplier>%n<Multiplier>
- <Duration>%n</Duration>
- </GameModifier></p><p>
Effect Type: Adjust Target's Current Health
Code: xml
-
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>CurHealth</Attribute>
- <Value>%n</Value>
- ?<PerTurn>%n</PerTurn>
- ?<Duration>%n</Duration>
- </GameModifier>
Effect Type: Target has a Chance to Lose Next Turn
Code: xml
-
- <GameModifier>
- <ModType>TacticalUnit</ModType>
- <Attribute>ChanceToLoseNextTurn</Attribute>
- <Value>%p</Value>
- <PerTurn>0</PerTurn>
- <Duration>%n</Duration>
- ?<PlayOnAllTargets>%b</PlayOnAllTargets>
- </GameModifier>
Effect Type: Target gets knocked Back
Code: xml
- <GameModifier>
- <ModType>TacticalUnit</ModType>
- <Attribute>TargetMovesBack</Attribute>
- <Value>%n</Value>
- <PerTurn>0</PerTurn>
- </GameModifier>
Effect Type: Target get Spell Immunity
Code: xml
- <GameModifier InternalName="ProtectUnit">
- <ModType>Unit</ModType>
- <Attribute>ProtectFromSpells</Attribute>
- <Duration>$n</Duration>
- </GameModifier>
Effect Type: Target tile is blocked
Code: xml
- <GameModifier InternalName="RockSlideImpassibleModifier">
- <ModType>Map</ModType>
- <Attribute>BlockTile</Attribute>
- <Duration>%n</Duration>
- </GameModifier>
Effect Type: Caster Steal's Target HP
Code: xml
-
- <GameModifier InternalName="DrainLifeModifier">
- <ModType>Unit</ModType>
- <Attribute>Lifesteal</Attribute>
- <Value>%n</Value>
- </GameModifier>
Effect Type: Target's Morale is changed
Code: xml
- <GameModifier InternalName="MoraleModifier">
- <ModType>TacticalUnit</ModType>
- <Attribute>AdjustMorale</Attribute>
- <Value>%n</Value>
- </GameModifier>
Effect Type: Caster is transported to target location
Code: xml
-
- <GameModifier InternalName="BlinkModifier">
- <ModType>Map</ModType>
- <Attribute>TransportUnit</Attribute>
- </GameModifier>
Effect Type: Target Unit flees the battle
Code: xml
- <GameModifier InternalName="EscapeGameMod">
- <ModType>TacticalUnit</ModType>
- <Attribute>EscapeFromBattle</Attribute>
- </GameModifier>
- <p>
Type:BSCDMG
<GameModifier>
<ModType>Unit</ModType>
<Attribute>DefendableDamage</Attribute>
?<Value>%n</Value>
?<MinValue>%n</MinValue>
<MaxValue>%n</MaxValue>
</GameModifier>
Type:DNTCNT
<GameModifier>
<ModType>Unit</ModType>
<Attribute>DoesNotCounterAttack</Attribute>
<Duration>%n</Duration>
</GameModifier>
Type:ADJSTAT
<GameModifier InternalName="DefenseModifier">
<ModType>Unit</ModType>
<Attribute>AdjustUnitStat</Attribute>
<StrVal>%stat</StrVal>
?<Value>%n<Value>
?<Multiplier>%n<Multiplier>
<Duration>%n</Duration>
</GameModifier>
Type:CURE
<GameModifier>
<ModType>Unit</ModType>
<Attribute>CurHealth</Attribute>
<Value>%n</Value>
?<PerTurn>%n</PerTurn>
?<Duration>%n</Duration>
</GameModifier>
Type:LSETRN
<GameModifier>
<ModType>TacticalUnit</ModType>
<Attribute>ChanceToLoseNextTurn</Attribute>
<Value>%p</Value>
<PerTurn>0</PerTurn>
<Duration>%n</Duration>
?<PlayOnAllTargets>%b</PlayOnAllTargets>
</GameModifier>
Type:KNCKBCK
<GameModifier>
<ModType>TacticalUnit</ModType>
<Attribute>TargetMovesBack</Attribute>
<Value>%n</Value>
<PerTurn>0</PerTurn>
</GameModifier>
Type:PRTMGC
<GameModifier InternalName="ProtectUnit">
<ModType>Unit</ModType>
<Attribute>ProtectFromSpells</Attribute>
<Duration>$n</Duration>
</GameModifier>
Type: BLKTILE
<GameModifier InternalName="RockSlideImpassibleModifier">
<ModType>Map</ModType>
<Attribute>BlockTile</Attribute>
<Duration>%n</Duration>
</GameModifier>
Type:LFESTL
<GameModifier InternalName="DrainLifeModifier">
<ModType>Unit</ModType>
<Attribute>Lifesteal</Attribute>
<Value>%n</Value>
</GameModifier>
Type:ADJMOR
<GameModifier InternalName="DrainLifeModifier">
<ModType>TacticalUnit</ModType>
<Attribute>AdjustMorale</Attribute>
<Value>%n</Value>
</GameModifier>
Type:BLNK
<GameModifier InternalName="BlinkModifier">
<ModType>Map</ModType>
<Attribute>TransportUnit</Attribute>
</GameModifier>
Type:ESCPE
<GameModifier InternalName="EscapeGameMod">
<ModType>TacticalUnit</ModType>
<Attribute>EscapeFromBattle</Attribute>
</GameModifier>