• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] GDD Problem

Status
Not open for further replies.
Level 13
Joined
Oct 25, 2009
Messages
995
I have a problem with GDD(I copied and pasted to my map)
Why this trigger doesn't work?
  • HA Attack
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Haunting Assault for GDD_DamagedUnit) Greater than or equal to 1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GDD_Damage Greater than or equal to 250.00
        • Then - Actions
          • Set HA_Point = (Position of GDD_DamagedUnit)
          • Unit - Create 1 Dummies for (Owner of GDD_DamagedUnit) at HA_Point facing Default building facing degrees
          • Set HA_Dummy = (Last created unit)
          • Unit - Add BloodLust to (Last created unit)
          • Unit - Add Critical to GDD_DamagedUnit
          • Unit - Set level of BloodLust for (Last created unit) to (Level of Haunting Assault for GDD_DamagedUnit)
          • Unit - Set level of Critical for GDD_DamagedUnit to (Level of Haunting Assault for GDD_DamagedUnit)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust GDD_DamagedUnit
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_HA_Point)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (HA_Dummy is dead) Equal to True
            • Then - Actions
              • Unit - Remove Critical from GDD_DamagedUnit
            • Else - Actions
It just like DotA - Abaddon's Atotic Shield,after taken 250 damage then release somethings,but this is passive skill,after create the dummy then set the GDD_Damage into 0?

Status: Unsolved
 
Last edited:
Level 13
Joined
Oct 25, 2009
Messages
995
It no more error now,last time i think is me add 1 more words but i forget lol.
Ok,i changed it into this,i copied your unit indexer and damage event.
But it isn't work also,what the...
  • HA Attack
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Haunting Assault for DamageEventTarget) Greater than or equal to 1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventAmount Greater than or equal to 250.00
        • Then - Actions
          • Set HA_Point = (Position of DamageEventTarget)
          • Unit - Create 1 Dummies for (Owner of DamageEventTarget) at HA_Point facing Default building facing degrees
          • Set HA_Dummy = (Last created unit)
          • Unit - Add BloodLust to (Last created unit)
          • Unit - Add Critical to DamageEventTarget
          • Unit - Set level of BloodLust for (Last created unit) to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Set level of Critical for DamageEventTarget to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust DamageEventTarget
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_HA_Point)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (HA_Dummy is dead) Equal to True
            • Then - Actions
              • Unit - Remove Critical from DamageEventTarget
            • Else - Actions
How to do MUI O.O
 
Trigger is good untill it comes to 'Else' then it completely.. yeah ;P

So you want to time the critical strike yes?
In this situation you can either use locals or loop combined with unit group.
>> Level of ability > 0 is enough ;d

Egzample:
  • HA Attack
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Haunting Assault for DamageEventTarget) Greater than 0
    • Actions
      • Custom script: local unit u = udg_DamageEventTarget
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventAmount Greater than or equal to 250.00
        • Then - Actions
          • Set HA_Point = (Position of DamageEventTarget)
          • Unit - Create 1 Dummies for (Owner of DamageEventTarget) at HA_Point facing Default building facing degrees
          • Unit - Add BloodLust to (Last created unit)
          • Unit - Add Critical to DamageEventTarget
          • Unit - Set level of BloodLust for (Last created unit) to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Set level of Critical for DamageEventTarget to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust DamageEventTarget
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_HA_Point)
          • Wait 2.00 seconds
          • Custom script: call UnitRemoveAbility(u, 'rawdata')
      • Custom script: set u = null
Where 'rawdata' is the id of your critical strike.
 
Last edited:
HA_Dummy should be an array and indexed.

I advise rather than removing the dummy when HA_Dummy is dead,
just use a periodic trigger that removes the dummy unit/the buff when
the remaining time reaches 0 (to see how this method works in real
time, see the Unit Indexer demo how I use a constantly decreasing
remaining time in the loop trigger and then remove the dummy when
the time is less than or equal to 0: http://www.hiveworkshop.com/forums/spells-569/unit-indexer-spell-template-202003/)

Edit:

Custom script: local unit u = udg_DamageEventTarget

Spinnaker, that's a syntax error, you need to declare locals at the very
top.
 
Level 13
Joined
Oct 25, 2009
Messages
995
Trigger is good untill it comes to 'Else' then it completely.. yeah ;P

So you want to time the critical strike yes?
In this situation you can either use locals or loop combined with unit group.
>> Level of ability > 0 is enough ;d

Egzample:
  • HA Attack
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Haunting Assault for DamageEventTarget) Greater than 0
    • Actions
      • Custom script: local unit u = udg_DamageEventTarget
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventAmount Greater than or equal to 250.00
        • Then - Actions
          • Set HA_Point = (Position of DamageEventTarget)
          • Unit - Create 1 Dummies for (Owner of DamageEventTarget) at HA_Point facing Default building facing degrees
          • Unit - Add BloodLust to (Last created unit)
          • Unit - Add Critical to DamageEventTarget
          • Unit - Set level of BloodLust for (Last created unit) to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Set level of Critical for DamageEventTarget to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust DamageEventTarget
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_HA_Point)
          • Wait 2.00 seconds
          • Custom script: call UnitRemoveAbility(u, 'rawdata')
          • Custom script: set u = null
Where 'rawdata' is the id of your critical strike.

Thanks,is that MUI?
and
u = null what is the meaning of it?
EDIT: It still doesn't work.
It doesn't work again wtf?
  • HA Attack
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Haunting Assault for DamageEventTarget) Greater than 0
    • Actions
      • Custom script: local unit u = udg_DamageEventTarget
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventAmount Greater than or equal to 250.00
        • Then - Actions
          • Set HA_Point = (Position of DamageEventTarget)
          • Unit - Create 1 Dummies for (Owner of DamageEventTarget) at HA_Point facing Default building facing degrees
          • Unit - Add BloodLust to (Last created unit)
          • Unit - Add Critical to DamageEventTarget
          • Unit - Set level of BloodLust for (Last created unit) to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Set level of Critical for DamageEventTarget to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust DamageEventTarget
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_HA_Point)
          • Wait 2.00 seconds
          • Custom script: call UnitRemoveAbility(u,'AOcr')
          • Custom script: set u = null
        • Else - Actions
 
You have to learn which data is needed to properly manipulate custom spells.

  • Custom script: call UnitRemoveAbility(u,'A002')
As you can see I wrote 'A002' instead of 'AOcr'.

Custom ability rawdata usually sticks to same model:
<custom ability id> : <the id of base ability>

Now just note that performing actions with your custom spell is done only if you're refering to the <custom ability id> - the first number.
 
Level 13
Joined
Oct 25, 2009
Messages
995
This is how the trigger look like...
  • HA Attack
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Haunting Assault for DamageEventTarget) Greater than 0
    • Actions
      • Custom script: local unit u = udg_DamageEventTarget
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventAmount Greater than or equal to 25.00
        • Then - Actions
          • Set HA_Point = (Position of DamageEventTarget)
          • Unit - Create 1 Dummies for (Owner of DamageEventTarget) at HA_Point facing Default building facing degrees
          • Unit - Add BloodLust to (Last created unit)
          • Unit - Add Critical to DamageEventTarget
          • Unit - Set level of BloodLust for (Last created unit) to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Set level of Critical for DamageEventTarget to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust DamageEventTarget
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_HA_Point)
          • Wait 2.00 seconds
          • Custom script: call UnitRemoveAbility(u,'A002')
          • Custom script: set u = null
        • Else - Actions
 
Level 13
Joined
Oct 25, 2009
Messages
995
Ok,i add some integer into it,this is the trigger,but it won't remove the critical.
Also,if the DamageEventAmount Greater than or equal to 100.00++,it won't work.
Because it need somethings that just 1 hit can deals 100++ damage then it will work...
  • HA Attack
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Custom script: local unit u = udg_DamageEventTarget
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageEventAmount Greater than or equal to 20.00
          • (Level of Haunting Assault for DamageEventTarget) Greater than 0
        • Then - Actions
          • Set HA_Integer = (HA_Integer + 1)
          • Set HA_Time[HA_Integer] = 0.00
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HA_Integer Equal to 0
            • Then - Actions
              • Trigger - Turn on HA Time <gen>
            • Else - Actions
          • Set HA_Point = (Position of DamageEventTarget)
          • Unit - Create 1 Dummies for (Owner of DamageEventTarget) at HA_Point facing Default building facing degrees
          • Unit - Add BloodLust to (Last created unit)
          • Unit - Add Critical to DamageEventTarget
          • Unit - Set level of BloodLust for (Last created unit) to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Set level of Critical for DamageEventTarget to (Level of Haunting Assault for DamageEventTarget)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust DamageEventTarget
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_HA_Point)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HA_Time[HA_Integer] Greater than or equal to 2.00
            • Then - Actions
              • Set HA_Integer = (HA_Integer - 1)
              • Custom script: call UnitRemoveAbility(u,'A002')
              • Custom script: set u = null
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HA_Integer Equal to 0
                • Then - Actions
                  • Trigger - Turn off HA Time <gen>
                • Else - Actions
            • Else - Actions
        • Else - Actions
  • HA Time
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set HA_Time[HA_Integer] = (HA_Time[HA_Integer] + 1.00)
 
NOOOO, you dont it the other way.... I said remove the if then and just put the conditions on the conditions tab of the trigger...

and put set u = null at the end of the trigger and not inside any if-then...

I still don't understand what part doesn't work... Please specify which part... if you cannot, I suggest putting debug messages to pinpoint the problematic part... If you don't know how to do that, learn...

For the 100++ damage part, if you want it to take effect once the total damage for the last few seconds becomes 100, you need to store the damage already taken by the unit then use the condition

LoadTheSavedDamageAlreadyTakenForTheUnit + DamageEventAmount Greater than or equal to 100.00

Also, your trigger is still not MUI because of that shitty 1 second loop... y? because you only iterate the latest HA_INTEGER on the 1 second loop and not all of them... Also it won't work correctly as it will only remove the ability if ever the unit takes damage because that's the only way that the trigger would fire... so you should put the ability removal into the 1 second timed loop....

Also, you can remove the variable u, its pointless now...
 
Status
Not open for further replies.
Top