• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[vJASS] Efficient way to put abilities into items?

Status
Not open for further replies.
Level 6
Joined
Oct 23, 2011
Messages
182
I've been trying to put special abilties into items (mainly passives)
What would be efficient way to do it?

Checking if a unit has the item every time it gets damaged/healed/etc. looks pretty bad

I was going to try to use Nestharus' Event.. but I realized it has no unregister(the special ability should be gone once the item is dropped)

Maybe I have to create a linked list of events ?
Tips would be greatly appreciated =)
 
It depends on what you are trying to do, but in general you can always use damage events/heal events because it will make everything a lot simpler. (as long as you are using a system for it) You may be thinking that it is a process-intensive method of doing it, but it isn't very noticeable.

Basically: on damage -> check if unit has item -> do actions

Or on whatever event that you want the passive to activate/have a chance of activating. If the unit does not have the item, it won't do the actions so there is no need for an unregister or anything like that.

You are probably thinking of only registering for the units who pickup the item, but it is pretty efficient to use the other method, and it is a lot less work. =)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Well... the trigger would work only if someone has the items... Shouldn't be that "heavy" for the system to handle units that way.
 
Level 2
Joined
Feb 18, 2007
Messages
14
I use a damage detection system which allows me to create passive abilities that are instanciated (is that an english word?) per unit. So you can easily set up a trigger for item acquisition and one for dropping them and add/remove those abilities respectively.
(ADamage, IDS, grim001's DDstructs, etc have this functionality)
 
Level 6
Joined
Oct 23, 2011
Messages
182
I use a damage detection system which allows me to create passive abilities that are instanciated (is that an english word?) per unit. So you can easily set up a trigger for item acquisition and one for dropping them and add/remove those abilities respectively.
(ADamage, IDS, grim001's DDstructs, etc have this functionality)

Do you have 1 trigger per each item?
 
Status
Not open for further replies.
Top