Units are damaged too soon

Solu9

You can change this now in User CP.
Reaction score
216
The trigger:

Trigger:
  • Frag Grenade
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frag Nade
    • Actions
      • Unit Group - Pick every unit in (Units within 200.00 of (Position of (Target unit of ability being cast))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to Neutral Hostile
            • Then - Actions
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing 80.00 damage of attack type Magic and damage type Fire
            • Else - Actions


The Frag Nade ability is based on Storm Bolt.
Missile Arc: 0.50
Missile Art: Custom Grenade Model (A simple nade)
Homing Enabled: True
Missile Speed: 500

Damage: 80
AoE: 0
Buffs: Stunned (pause)
Cast Range: 600
Casting Time: 0
Cooldown: 5
Duration Unit: 1
Duration Hero: 1

The ability kinda works as it should. But the picked units are damaged when the target is selected, and thats before the missile even is "thrown". So the grenade lands when all of the units already have been damaged.
 

Sayiain

You can change this now in User CP.
Reaction score
0
I don't know how to do it, but I suggest to add WAIT action until the missile reaches the target.
You can get the moment by adding:
<time from start ability casting to sending the missile> + <distance from hero to target unit / missile speed>
 

Solu9

You can change this now in User CP.
Reaction score
216
Good suggestion.
The problem with wait is that the Frag Grenade is an item, thus more than one unit can cast at the same time, which will mess the wait up.

Edit: Oh, and I know the unit group is leaking.
 

Enki

New Member
Reaction score
0
Create a dummy at target location and check if that dummy is damaged with your storm bolt then trigger the aoe damage.
 

luorax

Invasion in Duskwood
Reaction score
67
Start a timer at the map init with something like 0.1 sec expiration time and create a unit group (well, the less the expiration time, the faster it detects the buff, but the higher the chance to cause lag on spamming the item; but 0.1 is fine IMO). Each time it expires enum all units in the group and check if they have your Storm Bolt stun buff. If they have then do the AoE damage.
Each time a unit uses your Frag Grenade item add the target unit to the group.

It's so simple. (Well, it took me a while to figure out a way in GUI - in vJASS with a custom projectile system it's like 1,2,3 DONE!)
 

Solu9

You can change this now in User CP.
Reaction score
216
Start a timer at the map init with something like 0.1 sec expiration time and create a unit group (well, the less the expiration time, the faster it detects the buff, but the higher the chance to cause lag on spamming the item; but 0.1 is fine IMO). Each time it expires enum all units in the group and check if they have your Storm Bolt stun buff. If they have then do the AoE damage.
Each time a unit uses your Frag Grenade item add the target unit to the group.

It's so simple. (Well, it took me a while to figure out a way in GUI - in vJASS with a custom projectile system it's like 1,2,3 DONE!)

Unit group = units within the 200 of the targeting unit right?

Because enemy units will not be in the map from the beginning but spawn as the story unfolds.
And is it a standard timer or a periodic timer we are talking here?

Uhm, if you could give an example that would be great. I'm one of those people who learn better from seeing it done on beforehand rather than getting the theory explained :)
 

luorax

Invasion in Duskwood
Reaction score
67
Well, something like this:

Trigger:
  • Frag Grenade Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Frag_Grenade_Hashtable = (Last created hashtable)


Trigger:
  • Frag Grenade Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to Frag_Grenade_CheckGroup
      • Hashtable - Save Handle Of(Triggering unit) as (Key of (Target unit of ability being cast)) of 0 in Frag_Grenade_Hashtable


Trigger:
  • Frag Grenade Periodic
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Frag_Grenade_CheckGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Stunned (Pause)) Equal to True
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Frag_Grenade_CheckGroup
              • Set Frag_Grenade_EnumPoint = (Position of (Picked unit))
              • Set Frag_Grenade_EnumGroup = (Units within 200.00 of Frag_Grenade_EnumPoint matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
              • Unit Group - Pick every unit in Frag_Grenade_EnumGroup and do (Actions)
                • Loop - Actions
                  • Unit - Cause (Load (Key of Picked unit) of 0 in Frag_Grenade_Hashtable) to damage (Picked unit), dealing 80.00 damage of attack type Magic and damage type Fire
              • Custom script: call DestroyGroup(udg_Frag_Grenade_EnumGroup)
              • Custom script: call RemoveLocation(udg_Frag_Grenade_EnumPoint)
            • Else - Actions


However I've not written anything in GUI for a while...
 

Solu9

You can change this now in User CP.
Reaction score
216
Wow... I think I'm going to use that trigger. However it seems awful complicated considering what it does.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
I would have thought that modifying Acid Bomb to damage in a micro-interval would have done the trick.
 

inevit4ble

Well-Known Member
Reaction score
38
With spells similar to this I use "Create x Unit" and order it to attack the target (and make it unable to be selected etc) and detect when it attacks then do the damage effect
 

Solu9

You can change this now in User CP.
Reaction score
216
I would have thought that modifying Acid Bomb to damage in a micro-interval would have done the trick.

I've tried with Acid Bomb but for some reason it lagged when it was thrown. It is the ideal spell to make this from.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Well, I tried it myself, and strangely the damage dealt is variable. Damage was set to 150, Damage Interval at 0.01 and Duration - Hero/Normal were both 0.02. Sometimes it did 150 damage, other times it did 300. So I guess triggering it is necessary.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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