Basically, how would you do an attribute system? With the lack of a 'get attribute points' function, it seems the only way to create and refer to (through triggers) custom attributes would be through stackable buffs.
If an attribute system is done like so, how would you alter attributes through behaviors, then be able to refer to the amount of attribute points through the trigger editor? A behavior can alter attributes, yes, but it's the referring part that has problems.
The method I'm using now involves not using the attribute behavior type at all and instead using stackable, 0 duration (permanent) buffs which can be referred to through the stack count function. This feels really messy when I want to make a buff that alters these 'attributes' (which are not strictly attributes). You cannot use another buff behavior to alter the stack count of a behavior on a unit (can you..?), meaning it's very frustrating and convoluted when you want a buff effect to change a unit's custom attributes.
At the moment, my method of doing that is having a trigger that fires off when that buff behavior is placed on a unit. Through that trigger, I add to the stack a number 'attribute' behaviors, then run a while loop that removes that same number of 'attributes' when that buff disappears. It feels like there has to be a better way, so is there?
@dudeim: Go
I believe that get catalog function returns the value as set in the data editor, so it wouldn't help if I was looking for how much of a certain attribute the unit had.
@obliviron: Go
Yeah, that's essentially how I'm doing it. Attributes do alter the stats of the unit they're placed in proportional to how many attributes the unit has.
The problem is the way I'm working with attributes does not use those fields in the data editor, but instead they're used as values in triggers of the various systems in my map. This means I have to somehow refer to the current value of an attribute on a unit in a map with buffs that are supposed to alter attributes, the problems with which I've described in the opening post.
@dudeim: Go I believe that get catalog function returns the value as set in the data editor, so it wouldn't help if I was looking for how much of a certain attribute the unit had.
@obliviron: Go Yeah, that's essentially how I'm doing it. Attributes do alter the stats of the unit they're placed in proportional to how many attributes the unit has. The problem is the way I'm working with attributes does not use those fields in the data editor, but instead they're used as values in triggers of the various systems in my map. This means I have to somehow refer to the current value of an attribute on a unit in a map with buffs that are supposed to alter attributes, the problems with which I've described in the opening post.
Easy * peasy:
Do (Base value of unit's Str/Agi/Int attribute + # of stacked "Add Str/Agi/Int" Buffs".
That'll give you the exact amount of any attribute on a unit.
Now that I reread my posts, I think I was a little unclear. I didn't mean to make it seem like referring to the attribute values (through triggers) as my main problem; my main problem is the convoluted-ness of making a buff effect that alters attributes. For that kind of attribute system, you have a buff that gives +1 to the attribute. As I'd have to use the stack count function, that "+1 buff" must then essentially be treated as (a representative of) the attribute.
The thing is, what if I wanted a buff that granted +5 of an attribute? I can't just adjust the value to +5, because I can't directly refer to the attribute through triggers, nor can my new buff add 5 stacks of the +1 buff (they're both buffs, and last time I checked a buff behavior cannot add another buff behavior). Therein lies my problem. I can work around it by using the method I described in my opening post, but that method seems a little convoluted and could lead to more problems, so I want to know if there are better methods to doing this.
Thanks for replying, though.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Basically, how would you do an attribute system? With the lack of a 'get attribute points' function, it seems the only way to create and refer to (through triggers) custom attributes would be through stackable buffs.
If an attribute system is done like so, how would you alter attributes through behaviors, then be able to refer to the amount of attribute points through the trigger editor? A behavior can alter attributes, yes, but it's the referring part that has problems.
The method I'm using now involves not using the attribute behavior type at all and instead using stackable, 0 duration (permanent) buffs which can be referred to through the stack count function. This feels really messy when I want to make a buff that alters these 'attributes' (which are not strictly attributes). You cannot use another buff behavior to alter the stack count of a behavior on a unit (can you..?), meaning it's very frustrating and convoluted when you want a buff effect to change a unit's custom attributes.
At the moment, my method of doing that is having a trigger that fires off when that buff behavior is placed on a unit. Through that trigger, I add to the stack a number 'attribute' behaviors, then run a while loop that removes that same number of 'attributes' when that buff disappears. It feels like there has to be a better way, so is there?
You should be able to get the amount of points in your attribute using GetCatalog thingy function.
Here's how i made my system:
3 Attributes
Intel Str Agi
3 Buffs
Add Intel Add Str Add Agi
Those buffs add +1 to the behavior and do not show a buff status value in unit info.
Using triggers you can refrence and add attributes via:
Trigger - Add Behavior to Unit from Player
Event - Any dialog item is used by any player with the event clicked
Condition - X = X
Trigger - Add Add Str to Test Hero from Player(triggering player)
@dudeim: Go I believe that get catalog function returns the value as set in the data editor, so it wouldn't help if I was looking for how much of a certain attribute the unit had.
@obliviron: Go Yeah, that's essentially how I'm doing it. Attributes do alter the stats of the unit they're placed in proportional to how many attributes the unit has. The problem is the way I'm working with attributes does not use those fields in the data editor, but instead they're used as values in triggers of the various systems in my map. This means I have to somehow refer to the current value of an attribute on a unit in a map with buffs that are supposed to alter attributes, the problems with which I've described in the opening post.
Easy * peasy:
Do (Base value of unit's Str/Agi/Int attribute + # of stacked "Add Str/Agi/Int" Buffs". That'll give you the exact amount of any attribute on a unit.
@obliviron: Go
Now that I reread my posts, I think I was a little unclear. I didn't mean to make it seem like referring to the attribute values (through triggers) as my main problem; my main problem is the convoluted-ness of making a buff effect that alters attributes. For that kind of attribute system, you have a buff that gives +1 to the attribute. As I'd have to use the stack count function, that "+1 buff" must then essentially be treated as (a representative of) the attribute.
The thing is, what if I wanted a buff that granted +5 of an attribute? I can't just adjust the value to +5, because I can't directly refer to the attribute through triggers, nor can my new buff add 5 stacks of the +1 buff (they're both buffs, and last time I checked a buff behavior cannot add another buff behavior). Therein lies my problem. I can work around it by using the method I described in my opening post, but that method seems a little convoluted and could lead to more problems, so I want to know if there are better methods to doing this.
Thanks for replying, though.