Ability/buff level detection

Moridin

Snow Leopard
Reaction score
144
Well...in a way, you could do this:

In the abilities object editor, set the buff for each seperate level as:
Level 1 - Buff 1
Level 2 - Buff 2
Level 3 - Buff 3
etc

And make identical buffs with corresponding names.

Then you can just have a buff check.
 

perkeyone

something clever
Reaction score
71
or maybe when the buffing spell is cast, do a check then, and put the buffed units in different unit groups
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
@moridin
that is what i am trying to avoid...i have around 100 levels of a spell....amking 100 buffs =blah

@perky
good idea, but i would need 100 unit groups than :S

I know that worl editor should be able to recognize the spell because on the buff there is a field LEVEL, so it must be somewhere in the data.

I know a way but dotn want to do it with dummy hidden spells
 

Moridin

Snow Leopard
Reaction score
144
Wait. I've actually got a better idea (in a way).....when the spell is cast, set the custom value of the unit to the spell's current level....that'll track the spell level accurately and along with it, the buff level.

Note: If you're already using custom value, then you could probably use an integer array / hashtable to achieve the same purpose.
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
with 1 simple exception, i cannot afford a Unit Custom value on a thing such as a spell. Each unit can have 1 custom value and it shouldnt be wasted on a thing such as buff detection

Edit: probably, but it would just take up time, i think i will go with a dummy ability in a spellbook
btw is there a limit to the number of abilities the unit has?

EDIT EDIT:
how would an integer array look for this certain problem, u mind posting it? I dont get how should that be made.
 

Moridin

Snow Leopard
Reaction score
144
You could use two arrays (one unit array and one integer array). The unit array stores the unit and the integer stores the corresponding level of buff/spell.
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
you can use that.
Trigger:
  • BuffSetup1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TmpGroup = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in TmpGroup and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to (Number of units in TmpGroup), do (Actions)
            • Loop - Actions
              • Set Instance = (Instance + 1)
              • Set VoodoUnit[Instance] = (Picked unit)
      • Custom script: call DestroyGroup(udg_TmpGroup)

Trigger:
  • BuffSetup2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
    • Actions
      • Set Instance = (Instance + 1)
      • Set VoodoUnit[Instance] = (Entering unit)

Trigger:
  • Buffcheck
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Instance, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to VoodoUnit[(Integer A)]
            • Then - Actions
              • Set Bufflevel[(Integer A)] = (Level of (Ability you want) for (Triggering unit))
            • Else - Actions
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
but how are they linked?

i store a unit into
targets [X]

and a buff level into
buffs [X]

and than how do i determin which is the X of the unit when i need to check what is the buff level?

Lets say i casted a spell, w8ed 3 seconds and casted again on same target, now the spell should have greater effect.

I need to check does my target have a buff on the cast, 1st time it wont, second time it will, than i need to run Integer A 0-XYZ and check is my target = to target [integer A] ??? that would cause MASSIVE flood of RAM in my oppinion. Imagine 50 heroes, 4 spells, god knows how many units in map, epicnesssss
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
@Noobimbapro

what is the number of MAXIMUM arrays that I am suppose to add to voodoo units than?
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
LAWL, it was from a copy of my triggers, I removed it now(the add unit in another trigger event)
maximum is 8190 (i think is enough)
the loop checks if the unit that the previous 2 triggers register/set is the one who cast the skill and then the bufflevel[X] is set.
X is the number of the unit registered in the previus 2 triggers.
Its completely lagless.
You can modify it how you want to.
Every action I think takes 0.0000000001 seconds to be executed.
 

SwedishChef

New Member
Reaction score
32
Never change the custom value if you use EGUI. Bad things happen...

Again I need to know why you need it. Maybe you can do it another way.
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
Okay here is a brief explenation.

I have an ability, an arrow of sorts. (ever played DotA? Mirana like arrow)
When it hits a target, it applies an armor bebuf that lasts for x seconds. Arrow has no cooldown and the debuff stacks 3 times. There are 4 levels of the ability and that makes me have to calculate which level the ability was that fired it before lvling up dummy unit's ability in order to apply stronger buff.

However,
if you mouseover a buff in the status there is a field that says Level: X
if i could somehow get that value it would be a peace of cake, but like this it took me all day to figgure a solid way to do it. However it is really "hard" on the system because of too much If/Then/Else checks.

So i need some good way to detect what level of ability is used on a unit in order to increase the dummy ability and apply a stronger debuf.

Also how do i preload soemthing in order to make it not have a screen freeze when it is used first time in a game?
 

LightChaosma

New Member
Reaction score
60
if you add a never used ability to a dummy, you get a about a second freeze.

the best method to fix this is to place all this loading on map init. create a trigger that creates a dummy, adds all custom skills to your dummy that are added via trigger by some other skills, and remove your dummy
 

vypur85

Hibernate
Reaction score
803
Just use the 100 different buffs method. There is no possible way to check the level of buff with triggers.

Another method is use damage detection event to detect the damage source (which is the caster), then check the level of the ability of the caster, and relate it to the buff level on the affected unit. This would require your spell to deal damage (but it doesn't really matter, any spell that deals 0 damage triggers the event). Acid Bomb is usually used.

Explain clearly what you want to do. Elune's Arrow? How do you trigger the spell? Is it just some missile ability spell (Storm Bolt, Acid Bomb) or you trigger the movement of the missile? When it hits, it apply what buff? Slow? Stun?
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
i want to throw an arrow at a targeted location if the arrow hits someone it applies a debuf to him (fearie Fire) and that debuf should stack.

for example
for ability level 1:
stack 1 = -2 armor 2 seconds
stack 2 = -4 armor 4 seconds
stack 3 = -6 armor 6 seconds

for ability level 2:
stack 1 = -3 armor 2 seconds
stack 2 = -6 armor 4 seconds
stack 3 = -9 armor 6 seconds

for ability level 2:
stack 1 = -4 armor 2 seconds
stack 2 = -8 armor 4 seconds
stack 3 = -12 armor 6 seconds

etc.

The dummy unit is suppose to cast a spell on the target, the spell level is determined by the stack number as well as with the level of ability the hero has.

I want to keep thigns MUI
Now i run into a problem when detecting which buff the unit has, because depending on the buff the unit should apply different level ability to a dummy. And since i cannot detect the level of the buff im left with no options but to make a different buff for every level of the dummy ability and than check which exact buff the unit has.

I managed to do it with a dummy sphere ability added to the target and it's level set to the number of stacks or to be more precise i checked wheather the unit has a sphere ability. If no than add it and set the sphere level to 1, if it has an ability, then check it's level and increase it by 1, limited to 3 and by this determined what level should the dummy unit ability have.

With some math i manage to make a pattern that wont override the ability levels and figgured the thing out, but than i ran into another problem.

The unit has it's sphere ability forever meaning that basically even when the buff expires he will still be detected as a unit with numebr of stacks equal to his sphere ability level. To prevent this I added the unit into the group and am removing the units that do not have a buff from the group, and removing their sphere abilities.

But this forces me to make a permanent group and that causes leaks no?
So how should i go around this?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top