Damage Buff, each time unit attacks, issues

Kelv

TH.net Regular
Reaction score
7
When the trigger goes off for the first time, it freezes the game for a half a second or something. Also, I have some floating text, it is always showing the damage doing 10 less then what I wanted it to do.

The abilities are based off of Beserk for buff, and the item ability damage bonus.

Code:
Sharpen Blades
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Savage
        (Level of Berserk for (Attacking unit)) Greater than 0
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Attacking unit) has buff Barbarian ) Equal to True
            Then - Actions
                Set SW_Lvl = (Level of Berserk for (Attacking unit))
                Set SW_DB_Lvl = (Level of Barbarian Damage Bonus  for (Attacking unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Barbarian Damage Bonus  for (Attacking unit)) Greater than 0
                    Then - Actions
                        Wait 0.25 seconds
                        Unit - Set level of Barbarian Damage Bonus  for (Attacking unit) to (SW_DB_Lvl + SW_Lvl)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Level of Barbarian Damage Bonus  for (Attacking unit)) Equal to 0
                            Then - Actions
                                Wait 0.25 seconds
                                Unit - Add Barbarian Damage Bonus  to (Attacking unit)
                                Set SW_DB_Lvl = (Level of Barbarian Damage Bonus  for (Attacking unit))
                                Unit - Set level of Barbarian Damage Bonus  for (Attacking unit) to SW_Lvl
                            Else - Actions
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Barbarian Damage Bonus  for (Attacking unit)) Greater than 0
                    Then - Actions
                        Unit - Cause (Attacking unit) to damage (Attacked unit), dealing ((Real(SW_DB_Lvl)) x 10.00) damage of attack type Spells and damage type Normal
                        Floating Text - Create floating text that reads (+ + (String((SW_DB_Lvl x 10)))) above (Attacked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
                        Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
                        Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
                        Unit - Remove Barbarian Damage Bonus  from (Attacking unit)
                    Else - Actions

Can someone help me with what is wrong, and also, how to fix the lag problem?

It should be adding (whatever the level of the spell is) damage to the hero everytime he attacks a unit, and once he looses the buff, which is after 30 seconds, the next unit he attacks, he will do bonus damage of 10 x however much damage he added.

So if his ability level is 2, and he attacks a unit 5 times, the next unit he hits should do his normal damage, plus 100. My spell makes him do 80 damage, I could try and counter the problem but I'd rather just eliminate it. What I mean by that is that I could just add 1 to SW_DB_Level, at the end, but id rather just figure out why its not working from the start.
 
O

OneEight7eve

Guest
Conditions
(Level of Berserk for (Attacking unit)) Greater than 0

maybe that messes it up , if the unit attacks and has no beserk.
 

Kelv

TH.net Regular
Reaction score
7
no, beserk is the hero ability, if the hero hasn't learned the ability (beserk) I don't want the spell to go off.
 

vypur85

Hibernate
Reaction score
803
I'm not sure if there is anything wrong or not. The trigger seems ok except this (i think):
Code:
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Barbarian Damage Bonus  for (Attacking unit)) Greater than 0
                    Then - Actions
                        Wait 0.25 seconds
                        [B]Unit - Set level of Barbarian Damage Bonus  for (Attacking unit) to (SW_DB_Lvl + SW_Lvl)[/B]
                    Else - Actions
To set ability level, i think you'd need to remove it first then add it again. But im not sure whether if that is the cause of the problem. And have you checked that your Attack Damage Bonus has increased properly? What is the indicator that shows you that it indeed leveled up? And why the waits? Just remove them and see whether it works or not.
 

Kelv

TH.net Regular
Reaction score
7
I can tell what lvl the damage bonus is at because my stats will say something like 33-55 + 11 (that means its at lvl 11) I have 30 levels, each adds the damage up from one, starting with 1. The waits are because attacks seem to register about .25 seconds (im not sure what the exact time is, im sure someone has measured it) otherwise, the hero will actually get the damage bonus before the damage is done, and the attack-animation is finished.
 

vypur85

Hibernate
Reaction score
803
Sorry. Misunderstood your question. I didn't realised that you only want to reduce the lag. To reduce it, add this:

Code:
Untitled Trigger 002
    Events
        Map initialization
    Conditions
    Actions
        Set Temp_Point = (Random point in (Playable map area))
        Unit - Create 1 Footman for Neutral Passive at Temp_Point facing Default building facing degrees
        Unit - Add Barbarian Damage Bonus  to (Last created unit)
        Unit - Remove (Last created unit) from the game
        Custom script:   call RemoveLocation (udg_Temp_Point)

This will take off the lag. Actually the lag occur because the ability (Barb Damage Bonus) is first loaded to the unit. By adding this trigger, the ability is preloaded before the game starts.
 

Metov

New Member
Reaction score
4
if i understand this correctly, i think it could be done easier with 2 triggers. first one being the attack buff, second one for casting the final attack buff.

second one is quickest...
Unit uses ability
Ability equal to Berserk

Wait 1 seconds
Wait for condition (Casting unit has Buff Barbarian = False)
Create Unit dummy at position of Casting unit
Order Last Created Unit to Human Priest - Inner Fire Casting unit

(Inner Fire is the base for a dummy ability that adds the second buff)


now the first (main) one

Unit is Attacked

(no condition) or use attacking unit = savage

If (attacking unit has buff Berserk)
Order Attacking Unit to Damage Attacked Unit for (SW_DB_Lvl + (Level of Berserk for attacking Unit), damage type normal.. (not sure of the exact arguments here)
set SW_DB_Lvl = Sw_DB_Lvl +(Level of berserk for attacking unit)

If (attacking unit has buff inner fire)
order attacking unit to damage attacked unit for (sw_db_lvl *10)
(floating text here)
set dw_db_lvl = 0

that should work, unless i missed something


EDIT: i didnt see you wanted only to reduce the lag, but this shouldnt lag it at all.
 

Somatic

You can change this now in User CP.
Reaction score
84
Can i ask how many levels is that Damage bonus ability?
And yes, vypur85 has answered the problem for the lag.
Another idea of not removing the ability from the unit is by "player - Disable Spell for player" and the "Player - Enable Spell for Player" That works too and does not need any waits
 

The Undaddy

Creating with the power of rage
Reaction score
55
I'm not 100% sure,but I think it's impossible to level an item ability,like with Item life bonus,level one gives 50,level two gives 100.*If you level the ability it will still add 50.But when you remove the ability it will remove 100,leaving the unit with 50 hitpoints less than it had initially.Weird :nuts:

*Not rly,just an ex.
 

vypur85

Hibernate
Reaction score
803
>Can i ask how many levels is that Damage bonus ability?
I can tell what lvl the damage bonus is at because my stats will say something like 33-55 + 11 (that means its at lvl 11) I have 30 levels, each adds the damage up from one, starting with 1.

I'm not 100% sure,but I think it's impossible to level an item ability,like with Item life bonus,level one gives 50,level two gives 100.*If you level the ability it will still add 50.But when you remove the ability it will remove 100,leaving the unit with 50 hitpoints less than it had initially.Weird
Happened to me before as well :p. But in this case, the ability worked fine. I've tested it :). The ability leveled up according to trigger. (But i'm not sure what will happen if the attack proceeds to more than 30 times as there is no level 31. Maybe should add another condition in the trigger).

Edit:
Actually the problem is still not really solved:
Also, I have some floating text, it is always showing the damage doing 10 less then what I wanted it to do.

So if his ability level is 2, and he attacks a unit 5 times, the next unit he hits should do his normal damage, plus 100. My spell makes him do 80 damage, I could try and counter the problem but I'd rather just eliminate it. What I mean by that is that I could just add 1 to SW_DB_Level, at the end, but id rather just figure out why its not working from the start.

Actually i'm still confused with the question :p. Maybe just add the 1 and let that be? As far as i know, the trigger runs right after the hero starts swinging its weapon (not after the weapon hits the target). So, maybe you've miscalculated the amount of attacks it made? It should be correct i guess.
 

vypur85

Hibernate
Reaction score
803
Err... Up to you? If you want to avoid that 0.5 second lag on first cast? (The lag only occurs with abilities which are added through triggers. Existing abilities on units don't lag it).
 
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