[TUTORIAL] Display custom effects on items

DrejnDrejn Posts: 313
edited June 2016 in GUTS Community Help
Introduction

This tutorial is aimed to introduce Modders to the EFFECTLIST.

The EFFECTLIST file stores nothing more than the effects in the editor via Data Editor ---> Effects:
effectlist.png

Each Effect, as you may know already, represents an "action" that you can attach to an affix. The effects are in themself hardcoded but some of their proprieties can be modified to customize them in some ways. But let's give a look at the proprieties of an Effect, starting from the top:

Internal Name: it's the variable name that is used in the code. This variable it's hardcoded and anything different from those already listed (so from the Original Effects) won't be displayed when selecting the Effect for the affix. From testing, the Internal name seems to be related to the actual Effect Name (the name that gets Displayed) something like this:

KEFFECT_TYPE_DISPLAY_NAME

Where DISPLAY_NAME it's the name inputed in the Description section (see below). So if you were to create a new Effect, it will automatically acquire a custom string made up from its name, regardless of its actual Internal Name in the EFFECTLIST.DAT file

Description: here it's where the Display Name and Description that comes along with the effect takes place. This will be talked indepth in the tutorial section

Effects: Here is where some options are defined for the effect, mostly related to its value that can be put to a percentage or a Value (or none) other than some options related to Float values and Max Values

Graphs: here is where you can point a Graph to influence the value of this effect. Really useful if you want an effect to scale someway

Min and Max Values: Simply the Max and Minimum value that the stat can have

Proprieties: these are the attributes relative to the effect. When creating an affix it will use these tags to define some values (hardcoded). Don't know if the Tags can be used in other effects, personally i don't think so.

Tutorial

What we are going to do for this session is Modify an already existing Effect to grasp the concept of how the EFFECTLIST file can be edited to improve the quality of our mods. We will try to use an Effect and Display the value and the stat name into an item.

First step, let's locate the EFFECTLIST.DAT file in the MEDIA directory and copy it into our mod's media directory:
copyeffectlist.png

It's not possible to modify the Effects from the Editor itself so we will need to open the EFFECTFILE.DAT with a text editor. As always i will be using Block Note.

The first thing we want to do is search for the ADD STAT effect within the EFFECTFILE, so if you didn't already, open the EFFECTLIST file with a text editor and scroll down till you reach the ADD STAT string:
addstat.png

Usually the ADD STAT effect, doesn't display the added stat (the value added). We want to emulate the Effects like Strenght Bonus, Armor Bonus, that do display the Stat and the value to be added in the item description itself.

As said, we want to add a description to our item so let's get a view on Description section and how it works:

The description section has 2 type of Descriptions: Negative and Positive.

The sign (+ or -) it's related to the value (so positive or negative value). Each description type has an additional description for Over Time values. These are used when the affix has a fixed duration (like a buff duration for example).

So a Negative description will be used when the value in the affix is negative, and a positive description will be used if the value in the affix is positive. If the affix has a value in its duration, the proper Over Time description will be used.

The Description it's nothingelse than a string, so you could write anything, though we would like to have some "dynamism" for our text since our Values will not be fixed and our stat will not be always the same.

The Description fields use some Tags to define variables in the text. We'll give a look on those who are known (this will be updated if more will be reported):

[VALUE] = the value we put in our affix
[DURATION] = the duration value we put in our affix (often used in the Over Time descriptions)
[DMGTYPE] = the Damage Type selected in the affix.
[NAME] = the name of the effect, really useful tag
[VALUE_OT] = unknown: this tag is used in the Damage effect as negative and positive description. It's also used in the Damage Bonus Effect. OT may be related to Over Time
[VALUE5],[VALUE4],[VALUE3],etc = tags used to display a certain attribute value. The number near the VALUE tag is counted starting from the attribute near the ACTIVATION type.
[VALUE3AND4] = it's the same as the numbered VALUE above but it displays a range between them. AND is used to "connect" the 2 values. Usually used to show min and max values.
[VALUE1ASDURATION] = it displays the value as duration (example: if the Value is 3 the Displayed description will be "3 seconds")

|c00000000Text|u = a tag that is used to change the color of the Text inside the tag. The tag is enclosed between |c and |u. The number expresses a color in hexadecimal number (you can search on google to find hex numbers equivalent for the color you want to use for your text)

Since we are going to modify the file manually let's rapidly get what are the string we are gonna use for it:

This is used to insert a Description of positive type:
<TRANSLATE>GOODDES:
This is used to insert a Description of positive type Over Time:
<TRANSLATE>GOODDESOT:
This is used to insert a Description of negative type:
<TRANSLATE>BADDES:
This is used to insert a Description of negative type Over Time:
<TRANSLATE>BADDESOT:

Now that we have some knowledge, let's go back to our ADD STAT in our EFFECTLIST file and add this string:
addstatdescription.png

So what will be displayed is the Stat Value and its Name. Let's save the file and reload GUTS. After that Create a new custom Stat and apply an affix to an item pointing that stat.

In my case, i've created an Int type stat called Energy and applied an ADD STAT affix to a custom item of mine called Alluminium Legs. Let's save everything and test it in the Editor:
displaystat.jpg

Done! Well... even if actually the ADD STAT doesn't add a stat to the player but to the item itself, but you got the point :P

You can also copy effects to make new ones too but you will have to modify the affix via file in that case because GUTS will show you the Effect in the editor, but will not recognize it once you try to select the affix's effect. Pointing the effect will make the affix a bit buggy in GUTS but not ingame.

You can see in the image above, the ADD_MORE_STAT effect that i added, that is a copy of the ADD STAT effect. GUTS will simply give you an error when trying to select the Effect but it will give a proper result ingame.

Comments

  • epochedepoched Posts: 216
    Interesting find here. Have you tested creating a STAT to accompany it and then applying it to the UI STAT window and see if you can successfully make a new, independent, modifiable stat in game? This could be the key to doing a lot of new things.
    FAREASTLOGOSMALL.jpg
  • DrejnDrejn Posts: 313
    Well i didn't tried, but creating custom modifiable stats (like you would compare with a stat like strenght) that's something i'm trying to make work, but i don't think these effect changes can help since they are marginal changes (mostly description) and the effects mechanics are hardcoded.

    If i get something to work that way i will surely let you know

    PS: The stat i've used is a Created stat, so it is visible in the STAT widget. I didn't get what you wanted to achieve, i believe you were referring to the fact that you cannot actually increase Custom Stats with the ADD STAT effect from an item (that's the problem i have)
  • helacinhelacin Posts: 230
    Whoa. I'm not at the stage where I can use this yet, but I'm gonna keep it in mind for the future. Much thanks. :D
  • PhanjamPhanjam Posts: 3,297 ✭✭✭
    Thanks very much for sharing all this Drejn!
    Torchmodders
    Torchlight 1 Class Pack (TL1CP) Mod for TL2: Steam | RGF
  • Somehow I missed this post the first time around. Excellent write up and information. Thanks for sharing!
    theolbanner.png
  • PhanjamPhanjam Posts: 3,297 ✭✭✭
    Hello Drejn! May I re-post this tutorial of yours on the http://tl2modding.wikidot.com wiki?

    Would also be great if you could join so you can keep your work updated :mrgreen:
    Torchmodders
    Torchlight 1 Class Pack (TL1CP) Mod for TL2: Steam | RGF
  • JeppeJeppe Posts: 2
    Heya!

    Should this work in terms of debuffs creating new debuffs similar to poison, burn, freeze, stun etc.? I tried cloning the poison effect, but did not manage to get it working. I wonder if it's supported, or did I mess something up?
Sign In or Register to comment.