Attribute Increasing

Status
Not open for further replies.
Level 3
Joined
Aug 11, 2012
Messages
54
I'm trying to make a "wisp" that uses lumber or skill points to increase player attributes on their heroes. After a while of struggling to find a way to add the ability via the object editor I resorted to adding the ability via a trigger on map initialization. There are ten wisps, one for each player and I'm not sure if I'm missing a more efficient way to add three abilities to each wisp.

I could do this with JASS but I'm not very proficient at it.

 

Attachments

  • addingAbility.png
    addingAbility.png
    26.2 KB · Views: 47
Level 3
Joined
Aug 11, 2012
Messages
54
What ability did you base it on? Charge Gold & Lumber should work on units just fine.

That might be the problem, I based it on the item ability but I turned the boolean for it being an item ability false.

EDIT: Forgot to mention, the three abilities are based off of the item books that give their respective stats.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,272
Firstly your trigger does not work. There is no "Triggering Unit". Secondly you can make it a lot more easily and maintainable by adding all the "wisps" to a group, picking all units in the group and then adding each of the abilities to the picked unit. You could even make it with a single add ability action by using a integer loop to loop through an ability type array from 0 to 2 and then add the abilities.

You could also add the abilities to the "wisps" in the object editor. No triggers needed that way.
 
Level 3
Joined
Aug 11, 2012
Messages
54
Adding via object editor didn't work for me, not sure why. I wanted to do the group thing, but I couldn't find anything that would add abilities to the wisps much like the for function in C#.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,272
Adding via object editor didn't work for me, not sure why.
Well it should work so instead of hacking a solution with triggers try to get the object editor one to work.

I wanted to do the group thing, but I couldn't find anything that would add abilities to the wisps much like the for function in C#.
Use ForGroup, or in GUI Pick every unit in unit group and do actions. Then in the loop you add the add ability code, either in the form of 3 calls to add to picked unit or a loop to add an array of abilities to the unit.

Be aware unit groups do leak if created and not explicitly destroyed before losing all reference to it.
 
Status
Not open for further replies.
Top