Welcome to the Triggerables for Playerskills tutorial. This is intended for those who have read OedipusTex' introduction to passive and active skills, as I'm going to skip over most of the content he covered so as to save space, time and sanity. Those walkthroughs can be found here:
Let's start with two fairly important questions.
Q: What's a Triggerable?
A: A Triggerable is a set of conditions that, when met, will either execute a skill (a proc) or apply an affix. These conditions can be things like getting a critical hit against an enemy, blocking an attack, dying, etc, and replace the need for a mouseclick to activate the associated skill. A triggerable must first be applied to a character or monster before it can be activated.
Q: Why use a Triggerable?
A: Well, let me first say when you DON'T want to use a Triggerable. If the effect you want to apply just works like a weapon proc, i.e. you hit an enemy and an effect happens, you DON'T want to use Triggerables (95% of the time, anyway). You can achieve this with Cast on Strike or one of the similar effects available. Here's a list of effects that could be a lot easier to implement than a triggerable, all the ones that say CAST SKILL…
Now here's when you DO want to use a Triggerable:
1) You want to make use of the Triggerable's robust condition criteria. These can allow you to do a few things that the Cast On… effects can't. For example, with a triggerable you can set criteria that the triggerable will activate when an enemy attacks you, but you block. This could allow you to reward the player with a bonus to attack power, or rebuke the enemy with a magic blast from the player's shield. Cast On… effects don't cover such an event. This is the biggest reason why you'd want to use a Triggerable. If you think this is what you're looking for, but aren't quite sure, I suggest you peruse the Subtype field of the Triggerable window, which is discussed down below. It'll give you an idea of what sorts of conditions you can set with a Triggerable.
2) You want to avoid skill conveyance and have the effects of your proc apply whenever your conditions are met. Cast Skill on Strike effects require that the player be swinging their weapon or casting a skill that specifically allows for such effects to be conveyed. Triggerables can be used to override that setting and cast your triggered skill under a broader or narrower range of circumstances.
3) (Though this one is less important) You want to include a cooldown on a procced effect that is independent of the skill's cooldown. For Cast on Strike, you probably want a cooldown on your skill. This can be achieved by adding a cooldown to the skill itself. However, if your proc effect fires an existing class skill like the Embermage's 'Fire Bomb', you probably don't want to change the cooldown on the skill or you might anger some Embermage players. Adding a cooldown to a triggerable would be easier.
On With The Walkthrough
I'm going to use the Ember Mage's Fire Brand skill as an example.
This is a passive ability that applies a Triggerable to the player. It is activated when you hit an enemy and deals extra fire damage to that enemy if it is burning.
The skill can be broken down into 3 parts: the passive skill, the triggerable and the executed skill (the proc). Let's look for the passive skill first, since this is what we can see in our Skill Tree and is the root of the skill.
1. The Passive (The Application)
Scan the Arbiter's skills until you find Fire Brand. The NAME of the one we want here is Fire Brand Passive. The display name is, of course, just Fire Brand because it's got more panache than Fire Brand Passive. Nobody's excited to see the word Passive on a skill in-game. Let's look at the scripts.
[SKILL] <STRING>NAME:Fire Brand Passive <TRANSLATE>DISPLAYNAME:Fire Brand <TRANSLATE>BASE_DESCRIPTION:When you hit a burning enemy, you do an additional burst of fire damage. <STRING>SKILL_ICON:skillicon_firebreath <STRING>SKILL_ICON_INACTIVE:skillicon_firebreath_gray <STRING>ACTIVATION_TYPE:PASSIVE <STRING>TARGET_ALIGNMENT:EVIL <STRING>TARGET_TYPE:SELF <FLOAT>RANDOMRANGE:0 <FLOAT>TURNRATEOVERRIDE:-1 <STRING>REQUIREMENT_GRAPH:SKILLTIER3_PASSIVE <BOOL>SHOW_IN_BUFFLIST:0 <BOOL>CAN_BE_SILENCED:0 <INTEGER>LEVEL_REQUIRED:0 <INTEGER64>UNIQUE_GUID:-6928693190644960730 [LEVEL1] <FLOAT>RANDOMRANGE:0 [EVENT_START] <BOOL>NOSTEALEFFECTS:0 [AFFIXES] <INTEGER>AFFIXLEVEL:1 <STRING>TARGET:SELF <STRING>AFFIX:ARBITER_FIRE_BRAND_PASSIVE [/AFFIXES] [/EVENT_START] [EVENT_END] [AFFIXES] <INTEGER>AFFIXLEVEL:1 <STRING>TARGET:SELF <STRING>AFFIX:ARBITER_FIRE_BRAND_PASSIVE_CLEAR [/AFFIXES] [/EVENT_END] [EVENT_TRIGGER] [AFFIXES] <INTEGER>AFFIXLEVEL:-1 <STRING>AFFIX:ARBITER_FIRE_BRAND [/AFFIXES] [/EVENT_TRIGGER] [/LEVEL1]
It has all the elements you would expect of a passive skill, but it's a little different than a passive that just gives you a buff via an Affix. As you can see in the image below, it actually executes a skill when you hit a burning enemy. This is where we find our triggerable.
[EVENT_START] <BOOL>NOSTEALEFFECTS:0 [AFFIXES] <INTEGER>AFFIXLEVEL:1 <STRING>TARGET:SELF <STRING>AFFIX:ARBITER_FIRE_BRAND_PASSIVE [/AFFIXES] [/EVENT_START]
This segment right here applies an affix. Let's find that affix. Look, there it is.
[AFFIX] <STRING>NAME:ARBITER_FIRE_BRAND_PASSIVE <INTEGER>RANK:0 <INTEGER>MIN_SPAWN_RANGE:0 <INTEGER>MAX_SPAWN_RANGE:999 <FLOAT>DURATION:0 <INTEGER>WEIGHT:0 <INTEGER>SLOTS_OCCUPY:0 [EFFECT] <STRING>NAME:ARBITER_FIRE_BRAND <STRING>ACTIVATION:DYNAMIC <STRING>DURATION:INSTANT <INTEGER>LEVEL:1 <STRING>TYPE:ADD TRIGGERABLE <FLOAT>CHANCE:100 [/EFFECT] [/AFFIX]
The affix adds a triggerable to the player. The duration, you'll note, does not need to be ALWAYS. Once a triggerable is applied, it resides on its new owner until forcefully removed. This is what necessitates the second part of the skill, the EVENT_END.
[EVENT_END] [AFFIXES] <INTEGER>AFFIXLEVEL:1 <STRING>TARGET:SELF <STRING>AFFIX:ARBITER_FIRE_BRAND_PASSIVE_CLEAR [/AFFIXES] [/EVENT_END]
The EVENT_END applies a second affix to the player. If you open this up, you'll find the following.
[AFFIX] <STRING>NAME:ARBITER_FIRE_BRAND_PASSIVE_CLEAR <INTEGER>RANK:0 <INTEGER>MIN_SPAWN_RANGE:0 <INTEGER>MAX_SPAWN_RANGE:999 <FLOAT>DURATION:0 <INTEGER>WEIGHT:0 <INTEGER>SLOTS_OCCUPY:0 [EFFECT] <STRING>NAME:ARBITER_FIRE_BRAND <STRING>ACTIVATION:DYNAMIC <STRING>DURATION:INSTANT <STRING>TYPE:REMOVE TRIGGERABLE <FLOAT>MIN:100 <FLOAT>MAX:100 [/EFFECT] [/AFFIX]
This affix removes the triggerable. It has to be done this way because there's no inherent 'remove triggerable' event the way there is a remove affix event.
The last segment of the skill is the dummy. If you've been following OedipusTex's guides, you'll already know what this does. For the rest of you, the dummy portion of the skill lets you modify the tooltip to give the player more information about the skill.
[EVENT_TRIGGER] [AFFIXES] <INTEGER>AFFIXLEVEL:-1 <STRING>AFFIX:ARBITER_FIRE_BRAND [/AFFIXES] [/EVENT_TRIGGER]
Because this is a passive skill, there are no triggers during the event, so this EVENT_TRIGGER is never going to happen. However, it will still display the affix in the skill's tooltip. The affix ARBITER_FIRE_BRAND is the same affix that will be used later to apply damage to the enemy. If you can, reuse your affixes like this to save yourself time and to ensure accuracy of your tooltips.
Perfect. Now, let's look at the triggerable that this passive gives to our player.
2. The Triggerable (the condition)
Let's find the triggerable we saw in the affix, ARBITER_FIRE_BRAND. You'll find Triggerables listed as 'Triggerable Actions' in the Data Editors drop-down menu. Go ahead and open that up. Fire Brand will be the second Triggerable from the top.
Looking at the script info for the Fire Brand triggerable you should see some recognizable fields.
[TRIGGERABLEACTION] <STRING>NAME:ARBITER_FIRE_BRAND <TRANSLATE>DESCRIPTION:Life steals when hitting enemies on fire <STRING>GAMEEVENTTYPE:CHARACTER <STRING>EVENTCREATOR:ENEMY <STRING>SUBTYPE:GOTHIT <INTEGER>LEVEL:0 <FLOAT>FLOATCONDITION:0 <INTEGER>COOLDOWN:950 <BOOL>USEOWNERLEVEL:0 <BOOL>FILTERSELF:1 <BOOL>SAVES:0 [TRIGGERSKILL] <STRING>SKILL:FIRE BRAND [/TRIGGERSKILL] [/TRIGGERABLEACTION]
It's pretty obvious that the triggerable casts Fire Brand when an Enemy gets hit, up to once every 950 milliseconds. It's also pretty obvious that the description is a bit out-of-date, but since it never appears anywhere in the game, it's of no importance. If you want a more in-depth look at the fields, you will find that at the end of this document.
A few things here bear explaining. Filterself ensures that the triggerable only fires if the player is involved in the condition. In this case, that means he or she has to be the one hitting the enemy for Fire Brand to happen. You'll also notice that there's nowhere that indicates the enemy must be burning. That sort of condition requires a Stat Watcher or Unit Theme requirement at the skill level.
This is all the triggerable does. It simply defines what sort of event condition must be met for the triggered action to occur. They're pretty simple. Now, let's go to the skill Fire Brand that gets cast when our triggerable occurs.
3. The Proc
You'll find it back in the skill window right next to Fire Brand Passive.
[SKILL] <STRING>NAME:Fire Brand <TRANSLATE>DISPLAYNAME:Fire Brand Proc <STRING>ACTIVATION_TYPE:NORMAL <STRING>TARGET_ALIGNMENT:EVIL <STRING>TARGET_TYPE:TARGET <FLOAT>RANDOMRANGE:0 <FLOAT>TURNRATEOVERRIDE:-1 <BOOL>HIDDEN:1 <BOOL>DONT_STOP_ON_DEATH:1 <BOOL>CAN_BE_SILENCED:0 <INTEGER64>UNIQUE_GUID:-2062926497824096352 [LEVEL1] <FLOAT>RANDOMRANGE:0 <INTEGER>LEVEL_REQUIRED:0 <STRING>REQUIREMENT_GRAPH:SKILLTIER5_PASSIVE [EVENT_START] <STRING>FILE:media/skills/arbiter/passives/firebrand.layout <BOOL>NOSTRIKEEFFECTS:1 <BOOL>PLACEONTARGET:1 <BOOL>DAMAGESHAPES_HIT_ONCE:1 [AFFIXES] <INTEGER>AFFIXLEVEL:-1 <STRING>TARGET:ENEMY <STRING>AFFIX:ARBITER_FIRE_BRAND [/AFFIXES] [/EVENT_START] [/LEVEL1]
There are a few important items in the proc skill's scripts. First, it's activation type is normal, but there aren't going to be any EVENT_TRIGGERS since the skill is being cast without any mouse input. Thus, the skill only has an EVENT_START.
Target alignment is set to EVIL because the skill is being cast from the owner of the triggerable, not the event creator that we set in the triggerable. The event creator is set by the triggerable as the target of the skill. This is important to understand and means a few things. First is that you have to situate your layout appropriately. To this end, Fire Brand uses PLACEONTARGET to place the damage shape on the enemy target. The rest of the targeting significance of triggerables will be discussed at the end of the document.
Target type is set to target, ensuring that the skill will be oriented to the target of the triggerable, the event creator.
Hidden is true for a good reason. Like OedipusTex mentioned in his earlier guides, any skill that you don't directly put points into should be set to hidden, otherwise it will behave oddly- it will be available to set to your skill bar and will provide extra skill points on respec. We don't want that here because this skill is a proc that we don't really have total control over. More importantly, it's not a skill we directly put points into and shouldn't be showing up in our UI.
No Strike Effects is set to true so that this skill can't convey weapon effects or the benefits of other passives that require strikes. It would be somewhat nonsensical if this burst of fire damage could silence or blind targets because our weapon had that property.
ARBITER_FIRE_BRAND is exactly the same as the affix we used as a dummy affix in our passive. This time, though, it will indeed apply its damage to anything in the damage shape.
Now, look down at the very bottom of the skill's list of events. You'll see a pink box that says STATREQ. Yup, there's our statwatcher.
[STATWATCHER] <STRING>STAT:BURNING <STRING>PRIMARY_TARGET_TYPE:ENEMY <STRING>SECONDARY_TARGET_TYPE:VALUE <STRING>WATCH_TYPE:EQUAL TO <FLOAT>SECONDARY_VALUE:1 [/STATWATCHER]
And guess what, it watches for whether or not the enemy is burning. The Statwatcher is at the bottom of the skill event list so that it applies to the entire skill, regardless of level. If an enemy isn't burning, it won't even bother to fire.
Now, this is an interesting thing with the brand skills. The triggerable has a cooldown of 950ms on Fire Brand. I believe what this means is that the triggerable is only going to attempt to cast the skill every 950ms, whether or not the target is burning. If the target isn't burning, the proc won't cast, but you'll still have to wait the 950ms for another chance for the triggerable to activate. It's not a huge issue, but certainly bears consideration for your own skills.
Alright, that's all there is to Fire Brand. Following is a more in-depth discussion of the options available for Triggerables. But first, a quick rundown of the steps we just looked at.
3-Step Guide for Making a Triggerable
Make a passive or active skill that applies your Triggerable Make your Triggerable Make your procced skill
4. Triggerable Options (the fields)
This seems to be used exclusively for Monster Slayer item affixes, at least in the vanilla TL2 files. When the conditions occur this number of times (in the case of the Monster Slayer items, the player kills this many enemies), the weapon gets the proper bonuses. It's possible this could work with other types of Triggerables (perhaps- if you die 3 times, you get a cupcake or something).
Is self explanatory. It is calculated in milliseconds, so 1000 for every second.
Is only displayed in the editor, which is useful for keeping track of what your triggerables are supposed to do, especially the spells they are destined to cast.
This is who or what the Triggerable 'watches' to see if it should fire. In the case of Fire Brand, it watches enemies. This is subjective, so if the Triggerable were attached to a monster the players would be the enemies.
GAME EVENT TYPE
Game Event Type has three options- 'Character', 'Level', and 'Stat'. Level means on level-up. Stat events occur when a stat is modified on the event creator. Character events are things like blocks, dodges, hits, deaths, etc- the fun stuff. Depending on which of these you select, your options under Sub Type will change.
I don't know. I've never used this and haven't seen it used elsewhere.
This is the unique internal name of your Triggerable. It'll never show up anywhere in-game.
This is another field I only see set when it relates to weapon affixes of the Monster Slayer variety. It seems to permanently track the state of the Triggerable and the number of conditions that have occurred.
Oh yeah, I have something important to add about the “Saves” field on a Triggerable. From what I can tell you should never use it for Triggerables applied via a skill, affix, or effect. Doing so will cause a nasty crash every time the player attempts to zone. You can/must use it for triggerables applied directly to Units with the Unit Editor, but doing so with skills, effects, or affixes will make the game unplayable in a way that is very hard to debug (since it waits to crash until you zone). I ran into this face first with the Theolentist and it took a week or so to fix just because I had to track down what was happening.
Subtype is the fun stuff, especially if this is a CHARACTER event type. This will determine the condition, in relation to the Event Creator, that will cause the Triggerable to fire. In the case of Fire Brand, this is set to GOTHIT, meaning that when the Event Creator (ENEMY), gets hit, Fire Brand will proc.
I'm assuming this indicates whether or not to scale the executed skills and affixes by the player's level. However, this seems not to be necessary as we can see in the case of Fire Brand. It's not selected, which you would normally expect for a skill such as Fire Brand which scales on player level. The number of unused fields makes Triggerables kinda easy to set up.
USEOWNERLEVEL causes a [TRIGGERSKILL] to cast with a skill rank equal to the owner's level (or the highest defined rank if owner's level exceeds the number of defined ranks) instead of inheriting the rank from the triggerable's level.
Generally, this is not what you want; you want inheritance because that allows you to call the [TRIGGERSKILL] at the parent skill's rank.
CAST FROM BEARER
Not sure what this does because, again, I've never seen this field set to TRUE. Skill targeting works just fine for skills executed from Triggerables.
This is the internal name of the skill to execute when the conditions of the Triggerable are met.
the mechanic seams to stop reading after a skill has triggered → I was not able to trigger 2 skills → each skill needs it's own triggerable.
Hello useful field. Filterself, if set to true, requires that the owner of the triggerable, the player in Fire Brand's case, be involved in the condition that causes the Triggerable to happen. So, ENEMY GOTHIT becomes ENEMY GOTHIT BY OWNER in this case. If Filterself were set to false, Fire Brand would proc any time an enemy was hit by ANYONE. That could have practical application in another skill, but here would be nonsensical.
This seems like another field that is never used in the vanilla files. I've never found a use for it.
MESSAGE ON TRIGGER
Probably unique to Monster Slayer items. Not exactly necessary for player skills.
ON BEARER EVENTS
Again, I've never seen this set to True.
Here is where you can get really nitpicky and pick and choose which units will act as the event creator. This could be useful for party buffs, but not so much triggerables that affect enemies. However, it could be useful to give a boss fight more dynamism.
See Watch Units.
This is always set to true, though I have no idea what it does.
–EVENT LEVEL ACTIONS Right click on TRIGGERABLE ACTION in the Triggerable Events list (the blue column in the middle of the window) and hover your mouse over ADD. You'll see the option to add Affixes or Effects, or remove those two and triggerables. These work just like their counterparts in the Event level of skills. An example of a skill that uses this method is the Berzerker's Blood Hunger skill. The triggerable is called BERZERKER_LIFE_LEECH.
5. Targeting (a few ideas)
So, like I mentioned before, the proc is cast from the owner of the triggerable and the target is typically the event creator. This allows us some of the most interesting flexibility available in a skill system. Below are some ideas of how to apply this.
This is simple. Apply the triggerable to an enemy via an active skill's affix. Set Event Creator to Self and the subtype to GOTHIT or one of the other subtypes that indicate receiving some kind of hit (GOTCRIT, GOTBLOCKED, DIE, etc). Have the proc skill target self and apply your desired debuff! Using a triggerable affix instead of an execute skill might be easier in this instance, but not as pretty (no layout, but you could use unit themes).
Apply a triggerable to an enemy via an active skill like with the debuff. Set Event Creator to Enemy this time (which will indicate the players since the triggerable is owned by a monster). Set subtype to HIT or one of the hit delivery type conditions (CRIT, WEAPONHIT, etc). Have the activated proc apply a bonus to the player by setting the target type to TARGET and the affix apply a bonus of some sort (health recovery, bonus to attack speed, gold!)
This is like the Pinata, but in reverse. Apply the triggerable to yourself or allies via an active skill. Set Event Creator to Enemy and subtype to one of the receiving types. Set the proc to target TARGET so it will hit enemies and have the proc apply a baneful affix. This is how the berzerker skill Retaliation works.
There's really a lot of different ways to use Triggerables.
Another useful note about triggerables:
Triggerables don't overwrite the way affixes do. If you want to add a level X triggerable when you already have the same triggerable at level Y, then you MUST explicitly remove the level Y triggerable before adding the level X one. Otherwise the level Y triggerable will stay put and the level X triggerable will not be added.[/quote]