Headshot trigger?

rotten

New Member
Reaction score
2
No, not like dota's sniper, what a lousy hero that is :thdown: :D

Anyway, how do I make a trigger that displays "Headshot!" and maybe a Headshot sound whenever a unit is killed from more than, say, 50% hp, or 500 hp, in one instance of damage?
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Anyway, how do I make a trigger that displays "Headshot!" and maybe a Headshot sound whenever a unit is killed from more than, say, 50% hp, or 500 hp, in one instance of damage?
Something like his ultimate "Assasinate" but to say and to display "Headshot" if the target dies?
 

X-maul

AKA: Demtrod
Reaction score
201
You might need to explain a bit further what you want to use it for and in what type of map you're using it.

You mean if a unit use an ability on another unit, and kills it from a certain distance there will pop up a line which says "HEADSHOT". or simply just by a normal attack?
 

Trollvottel

never aging title
Reaction score
262
Hes not asking about distance. He is asking for a trigger that displays HEADSHOT if a unit, which had like 50% of it's max hp, dies from one instance of damage.

The "Unit takes damage"-event triggers before a unit actually takes damage so you can exploit that by checking the damage delt and checking the unit's current hp. The rest shoult be trivial.
 

sentrywiz

New Member
Reaction score
25
So why hasn't anyone made the triggers yet?

Yeah, you need to say whether this is a spell or plain auto-attack. Or it doesn't matter?
 

Trollvottel

never aging title
Reaction score
262
So why hasn't anyone made the triggers yet?

Yeah, you need to say whether this is a spell or plain auto-attack. Or it doesn't matter?
because its quite simple...
Trigger:
  • Headshot
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • (Damage taken) greater than or equal to (Live of (Triggering unit))
          • (Life of (Triggering unit)) greater than or equal to 500.00
        • 'THEN'-Actions
          • Floating Text - Create floating text that reads HEADSHOT at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • 'ELSE'-Actions

of course you have to add the event "Unit takes damage" manually because its a specific unit event.
 

rotten

New Member
Reaction score
2
Add the event manually? What's that mean? Because if it's a line of custom script, I don't really know how to write one for this thing, or any other to be honest. And those seem to work only for Actions.

Yeah, that's exactly the part I can't get my head around - what event to use to be able to test for damage. A specific unit event won't cut it, there may be 200 units or even more in play on my map at any time.
 

Sirroelivan

Gunnerkrigg Court
Reaction score
95
You could use a trigger to add new events to the Headshot trigger. One to add all initial units and one to add every new unit that enters the map.

(Don't know if there's a limit on the number of events a certain trigger can have though.)

Trigger:
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Unit_Group = (Units in (Playable map area))
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • Trigger - Add to Headshot <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup(udg_Unit_Group)


Trigger:
  • New Unit
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Headshot <gen> the event (Unit - (Triggering unit) Takes damage)
 

rotten

New Member
Reaction score
2
Nice, but won't this cause obscene amounts of lag?

I already have more than a few triggers, and my computer is very outdated.

I can't play Caesar IV on it, that's how outdated it is.
 

rotten

New Member
Reaction score
2
Well, it works so far! Thanks Sirroelivan and Trollvottel.

Jedi: Nice link, but it looks frightfully complicated. BTW, my pc is an Athlon 1600+ at 1.4 GHZ (used to be 1.7) with 0.75 GB Ram, 128 MB Nvidia video card (dunno the exact model right now) and a 120 GB SATA-1 hard disk with 8 MB cache and an increasing number of bad sectors :D
 

Jedi

New Member
Reaction score
63
It looks like my pc with +40 gb hard disk :D

Using GDD should be easy, have you tried ? :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top