Trigger problem

Exide

I am amazingly focused right now!
Reaction score
448
Hi.
I couldn't find a better name for the thread title.

Anyway.. I have a trigger that:
1. A unit destroys an explosive barrel near the boss.
2. The boss takes additional damage, depending on how close he is to the barrel.
3. The barrels are standing four-by-four so the trigger fires four times each time a barrel dies.

Here is my trigger:

Code:
Sector3_ExplosiveBarrels
    Events
        Unit - Any Unit dies
    Local Variables
        dist = 0.0 <Real>
        r = 0.0 <Real>
    Conditions
        (Unit type of (Triggering unit)) == Explosives
    Actions
        Variable - Set dist = (Distance between (Position of (Triggering unit)) and (Position of Odin))
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                dist < 351.0
            Then
                Environment - Create a Small Terran explosion at (Position of (Triggering unit))
                Environment - Create a Small Terran explosion at (Odin attachment point ("head"))
                Variable - Set r = (350.0 - dist)
                Unit - Set Odin Life to ((Odin Life (Current)) - r)
                Debug - Display ("Damage Dealt: " + (Text(r) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window
            Else


What happens is: the trigger seems to ignore my If/Then/Else -condition.
It also seems to deal about 320-340 damage to the boss (Odin), no matter how close or far away he is from the barrels.

The idea is to deal maximum 350 damage to Odin (if he's standing on top of the barrel), and deal less damage the further away he is.


Bonus question: is "head" a valid attachment for my explosion?
 

Frozenwind

System maker
Reaction score
99
Regular question:
I guess you need to wake up from the evil wc3 dream and come to sc2.

"351.0" distance is about the entire map in sc2, whereas it's really small in wc3.
A small unit has a collision size of 0.6, whereas in wc3 we reach values like 80.
So I don't know how big you want it, but I mostly have about 1.0 for a small explosion (as the barell has 0.6 collision size I suppose) and then up to 2 for average damage and up to 2.5 for low damage. Yet you have to decide the radius by yourself.

Check out your terrain editor and watch to the x-coordinate if you slowly move over the terrain. Like that you can determine the AoE you want.

(Small edit: A distance of "0" will cause max damage, but take the collision size into count. Dealing 350 damage is impossible right now.)


Bonus:
Go to the previewer, you know how to, and go to the specific unit's model. Now in the mid right you see a lot of stuff including his attachment points (I suppose they're called "bones"). If head is there, it is an attachment point. If not, it's not.
 

Exide

I am amazingly focused right now!
Reaction score
448
Oh. I did not know that.
Now that ruins my whole idea of having a simple "deal damage according to have close you are to the explosion" idea. :thdown:
I'll see if I can work something out around the silly new range system. =/


As usual I don't understand this. :p
I opened the previewer and found a list of all the attachment points.
They're all called stupid things like "Ref_Target 01 [e_attach_target 02] Bone = 91"

Dunno which one is the head.
 

Frozenwind

System maker
Reaction score
99
Regular:
It's rather simple, your new formula:

350 = max damage? So 350 damage is dealt on a distance of 0.6 (the collision size of barrel)

  • MaxDmg(350)
  • MinDist(0.6) = Collision of barrel
  • MinDmg(0)
  • MaxDist(2.5 for example)
  • RealDist = distance between unit and barrel

Damage Dealt = MaxDmg - (MaxDmg/(MaxDist-MinDist)) * (RealDist-MinDist)

MaxDmg minus "rest", is just because the damage slowly decreases (-) if you get farther away (+)
MaxDmg/(MaxDist-MinDist) spreads the MaxDamage over the DamageDealingRadius (which is 2.5-0.6=1.9 for this example) multiplied with (RealDist-MinDist), which is the distance between the unit and the MaxDmgPoint.

You'll need a condition though, if it can hit air units which are nearer as MinDist, as it'll deal more as 350 dmg then.


Bonus:
About the attachments... I haven't studied them yet either, so all I know is that you can see them there xD Maybe someone else knows it.
 

Exide

I am amazingly focused right now!
Reaction score
448
Thanks, but I did this instead:

Code:
Sector3_ExplosiveBarrels
    Events
        Unit - Any Unit dies
    Local Variables
        dist = 0.0 <Real>
        r = 0.0 <Real>
    Conditions
        (Unit type of (Triggering unit)) == Explosives
    Actions
        Variable - Set dist = (Distance between (Position of (Triggering unit)) and (Position of Odin))
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                dist < 6.0
            Then
                Environment - Create a Small Terran explosion at (Position of (Triggering unit))
                Environment - Create a Small Terran explosion at (Odin attachment point ("head"))
                Variable - Set r = (350.0 - (58.0 * dist))
                Unit - Set Odin Life to ((Odin Life (Current)) - r)
                Debug - Display ("Damage Dealt: " + (Text(r) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window
            Else

It works properly now. :thup:


If anyone figures out an attachment point I can use on my model I'd love to hear how to do it. :)
 

Galdiuz

Creator of Photon Command
Reaction score
98
You know that you can check attachment points in the Previewer? Just press A to show/hide them.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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!
  • 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

      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