• 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.

Buff system

Status
Not open for further replies.
Level 21
Joined
Mar 27, 2012
Messages
3,232
I've been thinking a lot about doing my own way of applying buffs and their effects.
Why?
*Greater control over how the buffs work
*Custom stats
*The possibility to make each spell have different "strength". Imagine a slow that slows the target by a squareroot of your intelligence*5%
*Making the strength of buffs relative to some custom stats you have(slow resistance, etc)

However, I'm not entirely sure how to do it all.

Basically the functionality that I'm having trouble with is attaching effects to buffs.
I wish I could do something like:
JASS:
call AddBuffEffect(u,SLOW,30,'B000')
call AddBuffEffect(unit,type,amount,buff)
30 meaning 30 points. Which on normal units would give a 30% slow.
The effect would also have to disable once the buff disappears for ANY reason.

How should I store the buff effects? I think I pretty much need a "buff indexer" for that, which is definitely NOT what I want to make. That would be a huge pain.
How do I check if a buff has worn off, when there can be hundreds of buffed units? Do I have to constantly loop through them all? If I loop fast, then it can cause lag. If I loop slow, then it will be, well, slow.
 
Last edited:
Level 19
Joined
Aug 8, 2007
Messages
2,765
Theres no "simple" way to do this. You have to break it into two triggers

1) A system to register all of the buffs and a corresponding ability that applies the buff
2) A system to register all of the affix types and a corresponding ability to apply the affix

Than you just need to add both of them, after a timer of x remove both of them.

I think there was a bonus mod that supported affixes like that, might have been BonusMod
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Theres no "simple" way to do this. You have to break it into two triggers

1) A system to register all of the buffs and a corresponding ability that applies the buff
2) A system to register all of the affix types and a corresponding ability to apply the affix

Than you just need to add both of them, after a timer of x remove both of them.

I think there was a bonus mod that supported affixes like that, might have been BonusMod

I think I could add some dummy abilities into my bonusmod and act, like they were usual stats. Minimal amounts of code needed(except for applying stats) and should be a bit simpler than coding everything.
 
Status
Not open for further replies.
Top