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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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