Hi all,
I've been putting together a class mod on and off for a while, and I've done a few textures now and then, but the thing that puts me off every single time is the web of skills, affixes and effects in GUTS.
I've read as much as I can on how they work, but I still can't figure out how things fall in place to actually make other things happen.
Take the "Prismatic Rift" spell for embermage, which I'm trying to change and implement for my class.
[SKILL]
<STRING>NAME:Chaotic Rift Passive
<TRANSLATE>DISPLAYNAME:Prismatic Rift
<TRANSLATE>BASE_DESCRIPTION:Your chaotic energy teleports enemies away when they strike you, with a chance of random elemental effects.
<STRING>SKILL_ICON:skillicon_emberammo
<STRING>SKILL_ICON_INACTIVE:skillicon_emberammo_gray
<STRING>ACTIVATION_TYPE:PASSIVE
<STRING>TARGET_TYPE:SELF
<FLOAT>TURNRATEOVERRIDE:-1
<STRING>REQUIREMENT_GRAPH:SKILLTIER1_PASSIVE
<BOOL>SHOW_IN_BUFFLIST:false
<BOOL>CAN_BE_SILENCED:false
<INTEGER>LEVEL_REQUIRED:0
<INTEGER>MAX_INVEST_LEVEL:15
<INTEGER64>UNIQUE_GUID:7587342414418560749
[LEVEL2]
[EVENT_START]
<BOOL>ATTACHES:true
<BOOL>USEDPS:true
[AFFIXES]
<INTEGER>AFFIXLEVEL:1
<STRING>TARGET:SELF
<STRING>AFFIX:ARBITER_CHAOTIC_RIFT_PASSIVE
[/AFFIXES]
[/EVENT_START]
[EVENT_END]
<BOOL>NOSTEALEFFECTS:false
[AFFIXESREMOVE]
<INTEGER>AFFIXLEVEL:1
<STRING>TARGET:SELF
<STRING>AFFIX:ARBITER_CHAOTIC_RIFT_PASSIVE
[/AFFIXESREMOVE]
[/EVENT_END]
[/LEVEL2]
I've shown the level 2, because level 1 is marginally different from the others and 3-15 are the same as 2.
This refers to the affix ARBITER_CHAOTIC_RIFT_PASSIVE:
[AFFIX]
<STRING>NAME:ARBITER_CHAOTIC_RIFT_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:Chaotic Rift
<STRING>ACTIVATION:PASSIVE
<STRING>TYPE:CAST SKILL ON STRUCK
<STRING>STATMODIFYNAME:EFFECT LEVEL
<STRING>STATMODIFYPERCENT:33.33333
<BOOL>MODIFIERISBONUS:true
<FLOAT>MIN:15
<FLOAT>MAX:15
[/EFFECT]
[/AFFIX]
Now what does this affix do? It applies another affix, ARBITER_CHAOTIC_RIFT, to enemies with chance based on the effect level. I know it applies that affix, yet I can't for the life of me figure out how the game knows which to apply, as the CAST SKILL ON STRUCK doesn't reference any skill in particular.
If someone could point me in the right direction so I can actually start implementing the skill ideas I have, I would be Effect: GRATEFUL, Duration: ALWAYS.
Hi, Exodemus. Welcome to Torchmodders.
It's been a while since I played with GUTS and I don't have it available right now, but perhaps this post in the Runic forums will give you some clues. It's a walkthrough of the Wand Chaos skill.
http://forums.runicgames.com/viewtopic.php?f=57&t=57741Also, if
@gytfunke shows up, I'm sure he could provide some insight.
Hi Wolven, I've been lurking for a while and I always thought your pic was a lightning angel...
Anyway, from the link you provided, it looks like the
<STRING>NAME:Chaotic RiftIn the ARBITER_CHAOTIC_RIFT_PASSIVE affix code refers to the displayname of the skill, which is weird since its displayname is never mentioned in the skill's code:
[AFFIX]
<STRING>NAME:ARBITER_CHAOTIC_RIFT
<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:chaotic_teleport
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:TELEPORT RANDOM
<FLOAT>CHANCE:100
<FLOAT>MINRANGE:8
<FLOAT>MAXRANGE:13
<FLOAT>COOLDOWN:0.1
[/EFFECT]
[EFFECT]
<STRING>NAME:chaotic_effects_burn
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:7
<STRING>TYPE:BURN
<STRING>UNITTHEME:Burning
<FLOAT>MIN:15
<FLOAT>MAX:15
[/EFFECT]
[EFFECT]
<STRING>NAME:chaotic_effects_poison
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:7
<STRING>TYPE:POISON
<STRING>UNITTHEME:Poisoned
<FLOAT>MIN:15
<FLOAT>MAX:15
[/EFFECT]
[EFFECT]
<STRING>NAME:chaotic_effects_shock
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:7
<STRING>TYPE:SHOCK
<STRING>UNITTHEME:Electrified
<FLOAT>MIN:15
<FLOAT>MAX:15
[/EFFECT]
[EFFECT]
<STRING>NAME:chaotic_effects_freeze
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:7
<STRING>TYPE:FREEZE
<STRING>UNITTHEME:Frozen
<FLOAT>MIN:15
<FLOAT>MAX:15
[/EFFECT]
[EFFECT]
<STRING>NAME:chaotic_effects_stun
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:2
<STRING>TYPE:STUN
<FLOAT>MIN:100
<FLOAT>MAX:100
<FLOAT>IGNORE_RESISTANCE:0
[/EFFECT]
[/AFFIX]
I have to sleep soon, and I'll be in class tomorrow, but I'll report back tomorrow after playing around with it

Thanks for your help.
Hi Exodemus!
So... the "NAME:Chaotic Rift" string that you found (and is highlighted in orange below) is a reference to the NAME string on the skill to be cast. Not the Display Name, the Name.
[AFFIX]
<STRING>NAME:ARBITER_CHAOTIC_RIFT_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]
[color=orange][b] <STRING>NAME:Chaotic Rift[/b][/color]
<STRING>ACTIVATION:PASSIVE
<STRING>TYPE:CAST SKILL ON STRUCK
<STRING>STATMODIFYNAME:EFFECT LEVEL
<STRING>STATMODIFYPERCENT:33.33333
<BOOL>MODIFIERISBONUS:true
<FLOAT>MIN:15
<FLOAT>MAX:15
[/EFFECT]
[/AFFIX]
Still wishing this editor had complete documentation, but you can always see if anyone's figured out and documented the function of an Effect on this wiki page:
http://torchmodders.com/wiki/doku.php?id=effect_dictionary.
How To Make Things Actually Happen Through Skills
Here's an overview-level guide.
1. What Are "Things"?
I'm going to put the end goal at the beginning since I want to clarify it a bit. Since you want to make "things" actually happen through skills, it may help to clarify what "things" can be made to happen through skills in TL2. On the "big picture" level, there are only four. First, skills can be used to apply effects. (Take a good look at the list of effects -- this is 95% of "things.") Second, skills can apply weapon-based damage. Third, skills can summon something. Fourth, skills can make flashy lights appear on the screen.
(Side note about affixes: For the most part, affixes are just a convenient container for a bundle of effects. There's very little you can do with an affix that you can't do by simply applying the effects directly. The main advantage of affixes is that they can consolidate effects into one easy-to-edit place so that rebalancing the potency of your skill is easier.)
2. "Skills" Is a Bigger Category Than It First Appears
If you have the idea in your head that "skills" are just the 30 things in the skill tree in the UI, you need to get rid of that idea. Every time some kind of event happens in TL2, it's a skill. Many of the things that look like a single skill in the UI are in fact composed of multiple skills that work together to accomplish the intended result. The most common paradigm in the vanilla TL2 skills is having one skill to apply a triggerable or "cast skill on <condition>" effect and having a second skill actually do the work when the condition occurs. Two is by no means the limit. Depending on the complexity of what you want to do, more component skills may be in order. I think the most component skills I have ever used to make up one "skill" from the player's perspective is somewhere around a dozen. (Important note: Any skill that can be used by a player character that does not belong in the UI skill tree needs to have the HIDDEN flag set or it will mess up respecs.)
3. How Skills Get Cast
1. Passive activation. A skill marked as PASSIVE will be automatically (re)cast on its owner upon spawning, zoning, or changing any piece of equipment. Don't quote me on this, but I think making changes to stat and skill points causes passives to reset too.
2. "Normal" activation via the skillbar or mouse.
3. From an EXECUTE_SKILL block inside another skill.
4. From a "cast skill on <condition>" effect on a unit.
5. From a triggerable on a unit.
6. From a minion. (The usefulness of this is not immediately obvious, so let me explain. It's possible to create a minion unit that is invisible, invincible, untargetable, uncollidable, and that attaches to another unit and moves along with it. Sometimes the best way to get something to happen in looping or periodic manner is to have your main skill summon a "dummy" minion like this and give the dummy minion skills that actually do the thing you want done.)
Hint: Methods 4-6 are useful for making multi-part skills.
4. A Very Brief Guide to Event Blocks
Skills are organized into "blocks." Each block starts with a tag in [square brackets] and ends with a [/closing tag]. In between are properties or other blocks. The top-level block is [SKILL]. The second-level blocks are [LEVEL1], [LEVEL2], etc. (A few other things can also exist at this level, like statwatchers.) The only thing that should ever exist at the highest level within a LEVEL<X> block are the various species of "event blocks." I'm going to go over some of the most important important ones.
EVENT_START happens the moment the skill is activated. You can have more than one EVENT_START. They will be executed sequentially from top to bottom -- which is useful if you want to perform logic using stat operations.
EVENT_TRIGGER, EVENT_TRIGGER_TWO, etc happen at the moment that the animation reaches the time designated as HITONE, HITTWO, etc. in the .animation file. This is how you synchronize effects with the animation. If the corresponding "hit" isn't defined in the .animation file, the block will never be executed. In that case you can use it as a dummy block for making the tooltip display effects that are actually delivered by a different hidden skill. Many of the vanilla skills use EVENT_TRIGGER_FOUR for this purpose.
EVENT_UNITHIT happens when a damage shape hits a unit. Unless you set CAN_CLONE to false, multiple copies of the EVENT_UNITHIT block will execute if multiple units get hit.
EVENT_MISSILEHIT happens when a missile hits something. This is another event type that you may get multiple copies of unless you disallow clones.
EVENT_END happens when everything else pertaining to the skill is completely finished.
5. Making Event Blocks Do Things
First, in order for the event block to do something, it must have something to do. It needs to have an EFFECTS sub-block, or an AFFIXES sub-block, or a WEAPON DMG % value other than 0, or some combination thereof.
Second, in order to get the "something" from the skill onto the target unit(s), you need one of three things: (A) Give the event block a layout file that includes a damage shape (and a timeline to activate the damage shape). (B) Set the APPLY EFFECTS flag. (C) Give the event block a layout file that spawns a missile.
Special note about EVENT_UNITHIT and EVENT_MISSILEHIT: These are exceptions to the above. They "just work" without a damage shape or any of this. Also, these events are usually redundant since the event that includes the damage shape or missile can also convey effects and weapon damage.
6. A Note About Logic
If you want to build more complex logic for things to happen conditionally or in a step-by-step way, the stat system is the tool you need. This topic is way too big to fully explain here, so I'll just give the basics: You can create a custom stat in the stats editor. You can manipulate the value of a stat on a unit by applying the SET STAT and ADD STAT effects. You can create conditional behavior by adding a STATWATCHER sub-block to any block inside a skill.* That block will not execute unless the condition defined in the statwatcher is met. You can use multiple statwatchers; the block will only execute if all of the conditions are met. Stats and statwatchers, coupled with the fact that blocks of the same type will execute in order from top to bottom (and the ability to launch additional skills via EXECUTE_SKILL) basically gives you a very rudimentary programming language.
(* For some reason statwatchers are bugged when used with EFFECTS blocks. But they work fine with AFFIXES blocks, so just wrap your effects into an affix. Also on the topic of stats and bugs, SET STAT and ADD STAT do not work reliably in EVENT_END blocks.)
7. Summoning Stuff
All you need is to give the event block a layout file that includes a unit spawner (and a timeline to activate the unit spawner). You can define the minion or missile to be spawned (along with how many, where, pointed which way, etc.) in the unit spawner.
8. Making Flashy Lights Happen
Three ways: (A) Give the event block a layout file that includes one on more link layout particles, and maybe some sounds to go with them (and a timeline to activate them). (B) Apply an effect to a unit that has a unit theme. (Unit themes are built out of link layout particles.) (C) You can add particle effects directly into the .animation file for the animation. (This is really awkward and cumbersome and not recommended unless you cannot get the visual effect you want any other way.)
Thanks Gtyfunke, after another search in GUTS, I can see that the "real" skill acts as a trigger for a secondary skill which redirects to a third skill. It seems simple now that I think about it.
And

Chthon, for me?
I don't know if you just came up with that or copied it from elsewhere, but it's greatly appreciated eitherway. It really shows the weird nuances you need to understand to get things to work, and kind of makes me amazed that TL2 works as intended

Thanks for your help guys
Back for round two, is there an easy way to implement "cast skill on dodge" effects?
Edit: Another effect conspicuous in its absence, "cast skill on melee critical strike"?
To use 'dodge' as a trigger you need....
Triggerables.
And Chthon, that's a great little write-up! Just one note:
(Side note about affixes: For the most part, affixes are just a convenient container for a bundle of effects. There's very little you can do with an affix that you can't do by simply applying the effects directly. The main advantage of affixes is that they can consolidate effects into one easy-to-edit place so that rebalancing the potency of your skill is easier.)
Affixes are treated differently than Effects in a few subtle ways. Importantly, an Effect is applied, performs its function and can no longer be easily modified with GUTS once it is instantiated in the game world. An Affix will read future updates to any of the Effects it contains and update them accordingly. This is most important for Effects on Units and Items.
Example: You create a Sword of Fire with an Effect that adds fire damage. You roll a character and collect the Sword of Fire. Sweet, it does +1 fire damage. But... then you think maybe the sword isn't all that balanced and you'd like to update Swords of Fire in your mod to deal +10 fire damage. So, you make the change in the editor, update your mod and declare proudly that Swords of Fire are no longer underpowered. However, any players who use your mod who have already found the Sword of Fire will not see any difference in their existing copies. Future copies they find will have the +10 fire damage, but not the ones they already own. Had you used an Affix, it should have updated all existing Swords of Fire as well.
In making a custom class you'll notice this quirk when you start to deal with the charge bar mechanics which, in the Vanilla implementation use effects or affixes applied to a class on rolling a character. Once the character is created, these modifiers can't really be changed very well. So, once you get to working on your charge bar, I suggest looking at
this.
Gyt, that's really interesting. I was not thinking at all about how effects and affixes might differ in terms of updates to a mod changing existing units. (I was thinking about how some effects use different math for over time effects depending on whether their duration is set to ALWAYS, and how you can use a limited duration affix to use the ALWAYS-type math for a limited time period. Something which is waaaay too niche and way too confusing to belong in a general overview.) I'm curious and would like to know whether no effects ever update, or perhaps its only effects that do not have anything in the name field that don't update.
Speaking of the charge bar, I've already seen that guide, and it inspired me (who was a crazy love for procs) to make upgradeable charge bonuses, sort of like a talent tree.
The idea is that I have a separate skill tab for "The Path" (Cheekily subtitled "all roads lead to doom"), where you can choose to put points in to add extra effects to the charge passives. Since I'm doing the main charge bar based off of the outlander, I'm thinking of starting with +run speed, +atk speed and maybe +interrupt chance (although I may replace that with a stun "focus hit" like vanilla outlander), and having the speccable bonuses be things like +hp regen per monster within range, +crit chance, +dodge chance, etc.
Is there anything tricky about doing that, or can I simply follow the guide and change how it's implemented? And on a personal note, how do you think it could be balanced? Having you pick one and lock the others on the same tier, pick as many as you like since they're not helping you that much, cost 1 skill point, 2? All suggestions welcome.
@Chthon I'm not sure. I never fully tested it.
@Exodemus If you can conceive it you can do it. The how is the tricky part. And the balance should probably be considered before you sink hours into building a complex system like that.
As for the balance, I like to keep my classes somewhat in tune with the Vanilla design concept. In the case of passives, that means no locking other passives out or providing more expensive passives. Plus, they'd have to scale to 15 levels. So, how does one do this?
Pretty easily. To modify your charge bar's effect by adding passive bonuses a la Outlander you only need to have the passive skill apply an Affix to the player that scales with charge. Look at the Outlander in the Unit Editor to see the Vanilla bonuses they get from their charge bar. In the Effect's "Stat Name" field, you'll see something like "Charge Percent". You copy and paste that into your Effect, give it a "Stat Percent" value and now your bonus effect scales with charge. Note that if you make it scale with 100% of charge, I believe it will multiply your bonus by 100 at full charge. 1% would multiply it by 1.
Capice?
Now, keeping them from being overpowered (by just allowing a player to invest in one active skill and boost its effectiveness with lots of these passive boosts to their charge bar) just takes some consideration. There are lots of ways to do it.
You could design these passives to only work with a certain weapon setup, making them exclusive (eg you can't have both the bow and the sword passive boost). You can make the bonuses useful only to certain builds (eg execute only really benefits auto-attack builds and bonus weapon damage effects don't do anything for spellcasters using abilities that only deal non-weapon based damage). You could also have the passives give penalties to that would prevent them from being useful to another build (taking this passive gives bonuses to fire damage, but reduces physical, ice, lightning and poison).
Or you could follow the Berzerker's design and make the passives all relatively beneficial to most builds, but make them interact with your active skills in such a way that makes taking only 20%-30% of the passives the optimal build choice. The Berzerker's Shatterstorm skill is an example of this. It's useful for any build, but the Berzerker can be built to be an immobilization tank who just freezes all the enemies all day long with Frost Breath and Shatterstorm. Shatterstorm won't work optimally for, say, a zerker focusing on Raze.
Thanks for all your help Gtyfunke, it feels great to see this community is as welcoming as ever
Back again for round three, any tips on showing the dynamic charge bonuses on the tooltip? The vanilla tooltips seems to be linked to a stat which is influenced by the triggerables added at the start of the game.
Yup, you'll need to modify the Charge Bar UI file for that. I'm not sure if the stats that are displayed are somehow linked to the Player Unit file... there's a field there under the Charge tab, something like 'watch affixes' which might indicate which affixes are displayed in the Charge Bar UI. If that's how it's linked, I think you can just add any affixes from the passive skills to that list and they should show up if they have non-0 values. If it's not the 'watch affixes' list, then just copying and pasting the widget in the UI file which references the stats to display should do the trick. Then just change the reference to your stats or affixes (I can't really remember).
The part of the layout that interests us is:
[BASEOBJECT]
[PROPERTIES]
<STRING>DESCRIPTOR:Stat
<STRING>NAME:Effects
<INTEGER64>PARENTID:-1173937812624378016
<INTEGER64>ID:3949511958388465771
<FLOAT>OFFSET X:24
<FLOAT>OFFSET Y:108.061
<FLOAT>WIDTH:66.5
<FLOAT>HEIGHT:16.8912
<INTEGER>LIST INDEX:3
<STRING>STAT STATIC ONE:PLAYER CHARGEBAR EFFECTS
<STRING>FONT:ArialSmallBold
<STRING>TEXT:|cFF1596EF<STAT1>|u
<BOOL>QUALITY COLORS:false
<BOOL>WORD WRAP:true
<BOOL>FIT TO TEXT:true
[/PROPERTIES]
[/BASEOBJECT]
If I can only make it show a stat, I guess I'll need to create a stat linked to the passive skills?
If I can make it show affixes, I don't know how I would do that. I tried changing the layout to reference an affix, but it didn't do anything.
Edit: And I looked for the PLAYER CHARGEBAR EFFECTS stat, couldn't see it in the stats editor.
Edit 2: I added the passive to the relevant skilltab, and the tooltip on that updates dynamically. I should be able to scav that.
Edit 3: I've been tinkering with it for a while, I can get the "currentEffects" widget and put it into the tooltip, but it's not working, so I'm assuming it doesn't know which skill to refer to. I tried stuff like adding the skill in the frame's widget, since that's how you assign them in the skill up menu, but nothing's worked so far...
Edit 4: I'm also trying to add another stat bar like the engineer's bar (only values for mine are 1,2,3,4), but the evaluators I can use for logic to display and hide the images are all tied to <STAT1> as well, which means I can't make it monitor my custom stat. The evaluators have a STAT 1 DYNAMIC for custom stats. The charge bar alpha changer still doesn't.
Edit 5: It's come to my attention that you can't use the ADD STAT effect on custom stats. How do you modify them?