• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Critical Strike in GUI

Status
Not open for further replies.
Level 2
Joined
Aug 22, 2009
Messages
19
Lets say you want a classic passive Critical Strike ability from wc3, but you wannit in GUI/Trigger form. How do you make it? Can anyone post map with it or screenshot of the trigger? Thanks in advance..
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
First you need to create a damage detection system (at map init, add the event "Unit takes damage" in the critical strike-trigger).
In the Critical Strike trigger, set the condition to Order equal to "attack", "smart" or "" (empty string).

Then deal damage according to the damage dealt.

Edit: No screenshots are neccesary, trigger-tags are way better and faster.


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

  • Damage Detection
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Check Damage <gen> the event (Unit - (Entering unit) Takes damage)

  • Check Damage
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Current order of (Damage source)) Equal to (Order(attack))
              • (Current order of (Damage source)) Equal to (Order(smart))
              • (Current order of (Damage source)) Equal to (Order(<Empty String>))
        • Then - Actions
          • Deal damage
        • Else - Actions
 
Level 13
Joined
Mar 6, 2008
Messages
525
First you need to create a damage detection system (at map init, add the event "Unit takes damage" in the critical strike-trigger).
In the Critical Strike trigger, set the condition to Order equal to "attack", "smart" or "" (empty string).

Then deal damage according to the damage dealt.

Edit: No screenshots are neccesary, trigger-tags are way better and faster.


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

  • Damage Detection
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Check Damage <gen> the event (Unit - (Entering unit) Takes damage)

  • Check Damage
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Current order of (Damage source)) Equal to (Order(attack))
              • (Current order of (Damage source)) Equal to (Order(smart))
              • (Current order of (Damage source)) Equal to (Order(<Empty String>))
        • Then - Actions
          • Deal damage
        • Else - Actions

Better (Entire map), I think...
 
Level 2
Joined
Aug 22, 2009
Messages
19
First you need to create a damage detection system (at map init, add the event "Unit takes damage" in the critical strike-trigger).
In the Critical Strike trigger, set the condition to Order equal to "attack", "smart" or "" (empty string).

Then deal damage according to the damage dealt.

Edit: No screenshots are neccesary, trigger-tags are way better and faster.


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

  • Damage Detection
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Check Damage <gen> the event (Unit - (Entering unit) Takes damage)

  • Check Damage
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Current order of (Damage source)) Equal to (Order(attack))
              • (Current order of (Damage source)) Equal to (Order(smart))
              • (Current order of (Damage source)) Equal to (Order(<Empty String>))
        • Then - Actions
          • Deal damage
        • Else - Actions
Thx alot ap0calypse :) just 2 more questions:
What is Order(smart) in game?
Why did you leave the third Condition in Damage Check Order(<Empty String>)?
 
Level 2
Joined
Aug 22, 2009
Messages
19
Well you could store a units damage in a variable...and add chances that he deals his damage by 1.5 times...

Too simple.
I think that in classic editor there is no ''Unit's Damage'' data that you could store as variable, there's only ''Event Response - Damage Taken'', but i dont know wheather that is attacking units damage or damage that has passed through damage reduction of attacked unit armor or any other unit's reductions (hp lost)? And besides that you said in post you need to make a Condition which will check if the damage taken is normal units damage or its a spell or something else,like ap0calypse showed me, cause we need it to work on regular attacks only :) Thx for replying anyway
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Thx alot ap0calypse :) just 2 more questions:
What is Order(smart) in game?
Why did you leave the third Condition in Damage Check Order(<Empty String>)?

The order "smart" is basically the same as the attack-function, when a unit is attack-moving, I believe it is set to "smart", but I'm not sure there...
The empty string is because when a unit is auto-attacking (you didn't order him to attack, a unit just came in range), his order will neither be "attack" or "smart", but just an empty string...

Well, I've tested it with a damage-detection system and it seemed to work just fine :)
 
Level 13
Joined
Mar 16, 2008
Messages
941
This will only work with meele units... ranged units deal damage after having the order, a missle while casting won't be able to procc crit like this. You'll need to check if it's a physical attack via orbs or remove the possibility of spells with a system like "Intuitive Damage Detection System" from Wc3c.net. By the way, are you sure that auto attack is an empty string? I thought that it has one too, if not even smart.
 
Level 2
Joined
Aug 22, 2009
Messages
19
The order "smart" is basically the same as the attack-function, when a unit is attack-moving, I believe it is set to "smart", but I'm not sure there...
The empty string is because when a unit is auto-attacking (you didn't order him to attack, a unit just came in range), his order will neither be "attack" or "smart", but just an empty string...

Well, I've tested it with a damage-detection system and it seemed to work just fine :)
Ive just tested it, its fine but it still works on spells, for example if i cast some DoT spell on unit every time it deals dot damage to the unit its a ''DoT's critical strike''.. Any advise?
 
Level 2
Joined
Aug 22, 2009
Messages
19
This will only work with meele units... ranged units deal damage after having the order, a missle while casting won't be able to procc crit like this. You'll need to check if it's a physical attack via orbs or remove the possibility of spells with a system like "Intuitive Damage Detection System" from Wc3c.net. By the way, are you sure that auto attack is an empty string? I thought that it has one too, if not even smart.
Actually it works on ranged units too, but it works on spell also and thats what im trying to avoid..
If its not a great loss of time, can you explain to me how to check ''if it's a physical attack via orbs''? I'll check out the "Intuitive Damage Detection System"..
 
Level 13
Joined
Mar 16, 2008
Messages
941
So, these are the two possibilities I know:
1) Orb System. You use an "Orb of Frost" ability with a 0.01 duration, slow of 0% and a black icon. This is completly invisible for the user and won't change anything.
The advantage of this short buff is, that only attacks (and not spells) will apply the buff. In the damage event you can check for the buff.
2) Intuitive Damage Detection System. It is somewhere on Wc3c.net. This system is very complex and requires all spell damage to be dealt via triggers. Even the most simple shockwave needs to be triggerd and deals damage with a special function.
All damage not from this function is then physical.
Solution 1) has the problem that most orbs don't stack, so you can't use them anymore.
 
Level 2
Joined
Aug 22, 2009
Messages
19
Actually Justify is right about melee/range units thing. The problem is in ''Damage Check Order(<Empty String>)'' cause it is, in my opinion, a condition that's always fulfilled!
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Actually Justify is right about melee/range units thing. The problem is in ''Damage Check Order(<Empty String>)'' cause it is, in my opinion, a condition that's always fulfilled!

I don't think that's true, for this reason:
The trigger only activates when a unit receives damage, so the unit must be
1) damaging a unit (be it through attacking or spells)
2) must have no order.

When a unit casts a spell, he usually has an order like "stormbolt", or "flamestrike".
 
Level 2
Joined
Aug 22, 2009
Messages
19
So, these are the two possibilities I know:
1) Orb System. You use an "Orb of Frost" ability with a 0.01 duration, slow of 0% and a black icon. This is completly invisible for the user and won't change anything.
The advantage of this short buff is, that only attacks (and not spells) will apply the buff. In the damage event you can check for the buff.
2) Intuitive Damage Detection System. It is somewhere on Wc3c.net. This system is very complex and requires all spell damage to be dealt via triggers. Even the most simple shockwave needs to be triggerd and deals damage with a special function.
All damage not from this function is then physical.
Solution 1) has the problem that most orbs don't stack, so you can't use them anymore.
I checked out Intuitive Damage Detection System. Its in Jass and I'm avoiding it, mainly cause I don't know how to work in it. That orb thing is ok but you already explained its disadvantages :) Thanks a lot for your time, will try to find some system in GUI
 
Level 2
Joined
Aug 22, 2009
Messages
19
I don't think that's true, for this reason:
The trigger only activates when a unit receives damage, so the unit must be
1) damaging a unit (be it through attacking or spells)
2) must have no order.

When a unit casts a spell, he usually has an order like "stormbolt", or "flamestrike".
Here's the deal, lets say my hero is ranged attacker and has Immolation:
1)When I test the map with The Condition in Damage Check Order(<Empty String>): When I attack enemies it deals Critical Strikes fine and when I just pass by enemy units with immolation on it deals Critical Strike of Immolation DoT.
And
2)When I test map without Condition in Damage Check Order(<Empty String>): When I attack enemies it DONT deal Critical Strikes and when I just pass by enemy units with immolation on it DONT deal Critical Strike of Immolation DoT.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Here's the deal, lets say my hero is ranged attacker and has Immolation:
1)When I test the map with The Condition in Damage Check Order(<Empty String>): When I attack enemies it deals Critical Strikes fine and when I just pass by enemy units with immolation on it deals Critical Strike of Immolation DoT.
And
2)When I test map without Condition in Damage Check Order(<Empty String>): When I attack enemies it DONT deal Critical Strikes and when I just pass by enemy units with immolation on it DONT deal Critical Strike of Immolation DoT.

Ohh, right... I completely forgot about those passive skills such as immolation.
Well, you could remove the empty string, but I'm not 100% sure whether it'll work or not...
With my test-map it didn't, but perhaps the reason is that player 2 was unused, so he never had any orders?
 
Level 2
Joined
Aug 22, 2009
Messages
19
Thank you for replaying in such a short notice. I will get to the bottom of this ;D If someone finds anything useful about this thread feel free to leave a comment :]
 
Level 5
Joined
May 24, 2009
Messages
55
Just to give you a simple, less flexible alternative.

1. Create a x2 Critical strike ability with (2) levels:
Level 1 - 0% chance critical strike
Level 2 - 100% chance critical strike
Equip the unit you want to have the critical ability. (This means the critical damage isn't flexible, you'll have a fixed x2 critical strike)

2. Determine the amount of chance you want for the critical.
(I'm going for a 30 out of a 100, probably 30%)

3. Now the Critical Strike trigger.
  • Critical
  • Events
    • Unit - A unit is attacked
  • Conditions
    • ((Attacking unit) is a Hero) equal to True
  • Actions
    • Set RANDOM = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • 30 Greater than or equal to RANDOM
      • Then - Actions
        • Unit - Set level of Critical Strike for attacking unit to 2
      • Else - Actions
        • Unit - Set level of Critical Strike for attacking unit to 1
What this trigger does is whenever a hero unit attacks,
it will set RANDOM as an integer between 1 and 100, and whenever RANDOM
is equal to 30 or lower, Critical ability will be increased to 2,
which is 100% chance to score a critical.

Don't worry about resetting the Critical back to 0% as when the hero makes
the next attack, if it doesn't get RANDOM to 30 or less,
the Critical ability will be automatically set at level 1,
which is 0% to score critical.
 
Level 10
Joined
Feb 20, 2008
Messages
448
I checked out Intuitive Damage Detection System. Its in Jass and I'm avoiding it, mainly cause I don't know how to work in it. That orb thing is ok but you already explained its disadvantages :) Thanks a lot for your time, will try to find some system in GUI

i doubt you will find a system such like this in gui, i also tryed i didnt found it i had to make my own in jass!!

btw jass is very e-z if you know pseudo-code and vbs its same!!!

i think tis possible to see wich type of damage are made within condition but im not sure ill try to find the line!!

im thinking is there any condition to compare typed of damage deal ?


btw u should not avoid jass, some jass spell or system are system are made to be able to be used in GUI and not only jass
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
i think adding so much events could be bad

you trigger will have 1000 events (to big list i think)

....
if you guys think this could be a good idea i will make the whole trigger

make dummy unit (no model)
attack none
collusion size 0
armor 0
(must take 100% of damage)
make spell for him

chain
range 0.01
casting time 1800 or more ( i think 300 would be enough)

store DUMMY UNITS in a variable
(i hope you have one hero for every player and so you need one dummy unti for every player)


when hero is ordered to attack
move DUMMY UNIT [player number of owner of unit attacking unit]
....
order attacking unit to attack DUMMY UNIT [player number of owner of unit attacking unit]



TRIGGER
DUMMY UNIT... takes damage
............
 
Status
Not open for further replies.
Top