Damage reciving moment

Gev

Well-Known Member
Reaction score
25
Ok im stucked with this. Im using GUI and need to get the moment of dameg recive from normal attack. When im creating scripts with unit is attacked it geaves me not the moment of damage recive. Its works when unit starts to attack. Help me pleaes.
 

Ashlebede

New Member
Reaction score
43
Indeed, the event "A unit is attacked" happens at the beginning of the swing, before the damage is dealt.

The event "{My Unit} takes damage", which can only be registered for a specific unit, detects any damage taken. Using a simple system you can register a new event for your trigger whenever a unit is created.
 

Ashlebede

New Member
Reaction score
43
Trigger:
  • //Handwritten Trigger
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to {Other Trigger} the event (Unit - (Triggering unit) Dies)


Trigger:
  • //Other handwritten Trigger
    • Events
    • Conditions
      • {Whatever}
    • Actions
      • {Whatever}
 

Gev

Well-Known Member
Reaction score
25
Trigger:
  • //Handwritten Trigger
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to {Other Trigger} the event (Unit - (Triggering unit) Dies)


Trigger:
  • //Other handwritten Trigger
    • Events
    • Conditions
      • {Whatever}
    • Actions
      • {Whatever}

your trigger makeing my game to crush. Anywey im trying to create life steel of 10% current hp. Trigger based on unit attacks is working but i dont need heal before damage dealed.
And what about tommerbob please show what i need to read in there. Sorry bad english.
 

Ashlebede

New Member
Reaction score
43
-- How To Implement --
Be sure "Automatically create unknown variables while pasting trigger data" is enabled in the World Editor general preferences.
Copy the trigger category "GDD" from the demo map and paste it into your map. (Alternately: create the variables listed in the globals block below, create a trigger named GUI Friendly Damage Detection", and paste in this entire text.)
Create your damage triggers using Game - Value Of Real Variable, select GDD_Event as the variable, and leave the rest of the settings to the default "becomes Equal to 0.00".
The event responses are the following variables:
GDD_Damage is the amount of damage, replacing Event Response - Damage Taken.
GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit.
However, Triggering Unit can still be used, if you need to use waits. Read the Notes section below for more info.
GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.

That should show you how to implement.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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