special effect when critical?

Dem0n_Hunter

Active Member
Reaction score
2
Hey I have a item that gives 15% chance to do x2.25 to buildings and I want when that happens it will be a text over the building also a special effect happen on the building or something. anyone have an idea for that?
 

Exide

I am amazingly focused right now!
Reaction score
448
There's no way of detect critical hits.

However, it is possible to trigger the ability from scratch. -It will not be perfect, but it will work.

I made a similar spell once, called 'Some Orbs' (bad name).
My spell made a dummy unit cast a random spell, out of three different spells, on the target unit.
I'm sure it can be be modified to create a special effect, play a special attack animation, deal more damage, and whatnot.
The only problem is that there's no good way (that I know of) of detecting a unit's damage. (So dealing 2.25x damage might be troublesome.)

Here's a demo map of my spell, if you want to see what I'm talking about:
http://www.thehelper.net/forums/showthread.php?t=132937
 

WilliamPa

Active Member
Reaction score
51
I made you a trigger........ WITH GUI!!!! My fingers hurt from all that clicking :<

Trigger:
  • EnterRect
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A structure) Equal to True
        • Then - Actions
          • Trigger - Add to Damage &lt;gen&gt; the event (Unit - (Triggering unit) Takes damage)
        • Else - Actions

Trigger:
  • Initializion
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Entire map)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to True
            • Then - Actions
              • Trigger - Add to Damage &lt;gen&gt; the event (Unit - (Picked unit) Takes damage)
            • Else - Actions

Trigger:
  • Damage
    • Events
    • Conditions
      • (Random integer number between 1 and 100) Less than or equal to 15
    • Actions
      • -------- Modify here --------
      • Floating Text - Create floating text that reads ((String(((Damage taken) x 2.25))) + !) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Unit - Cause (Attacking unit) to damage (Triggering unit), dealing (((Damage taken) x 2.25) - (Damage taken)) damage of attack type Normal and damage type Normal

Please don't tell me that all my effort went to waste...

E: Edited, sorry that i forgot the damaging action
 

Dem0n_Hunter

Active Member
Reaction score
2
Oh that's wonderfull. thx it takes me a while to understand what's happening there but i'll get into it right away. thx again +rep both
 

WilliamPa

Active Member
Reaction score
51
The two first triggers add event to the third trigger, which shows effects, damages and such. This must be done because there is no event that would handle all units in map taking damage. You just need to edit the third trigger.

E: And the initializion trigger leaks, i know that, but since it's just one unit group, it doesn't really matter.
 

Dem0n_Hunter

Active Member
Reaction score
2
I see. thx alot again.

Edit: ahh I see what you did there. but one thingy where does the 15% chance comes in?
Edit2: sry but I don't see why we need 2 intial triggers? can u enlighten me?
 

WilliamPa

Active Member
Reaction score
51
Ah... right... the chance... :p oopsie

Just one is initial, the middle one. First one reacts when anything enters the map, and third one triggers when something takes damage.

E: Now the chance is added

E2: Np, i helped you in just one question but had to fix it a few times ^^
 

vypur85

Hibernate
Reaction score
803
Code:
    Damage
          Events
          Conditions
                (Random integer number between 1 and 100) Less than or equal to 15
          Actions
                [B]Trigger - Turn off (This trigger)[/B]
                -------- Modify here --------
                Floating Text - Create floating text that reads ((String(((Damage taken) x 2.25))) + !) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
                Unit - Cause ([B]Damage source[/B]) to damage (Triggering unit), dealing (((Damage taken) x 2.25) - (Damage taken)) damage of attack type Normal and damage type Normal
                [B]Trigger - Turn on (This trigger)[/B]

The 'Attacking unit' should be 'Damage Source'. It's a good idea to turn off and on the trigger to prevent infinite loop. And, be aware that this trigger does not discriminate between spell damage or physical damage. You may get damage multiplier from spells too.

To me, this is not worth doing, if you're just doing it for the sake of effects. There's no easy way to immitate a real Critical Strike ability using triggers (I'd say impossible). Unless you don't mind it be Orb effect... but I do.
 

Dem0n_Hunter

Active Member
Reaction score
2
Well I want both the floating text and the special effect. btw are u sure that's "Trigger - Turn on (This trigger)" ? or is it turn off ?
 

vypur85

Hibernate
Reaction score
803
> btw are u sure that's...

Sure. :p

Just test it. You'll only know when you test it... Build up the trigger yourself. See the difference with/without the Turn off/on actions. (I know you haven't tested the triggers, because it definitely won't work with 'Attacking unit'. :p)


> Well I want both the floating text and the special effect

It's up to you whether to use the trigger or not. But I personally feel that it's not worth triggering.
 

Dem0n_Hunter

Active Member
Reaction score
2
> sure. :p

Well sry but to my logic at the end of a trigger u turn it off for next time but u turned it on instead which doesn't make sense to me. if u explain that to me i'll appriciate it
 

vypur85

Hibernate
Reaction score
803
If you look closely in the GUI window, when 'Trigger - Turn off trigger' is selected, you can see grey coloured words at the bottom of the window. Turning off trigger does not affect the subsequent actions.

Now, the logic.
The event for the trigger is 'X unit takes damage', even though there isn't an event in the trigger, but they will be added later when the game starts (thus needing the first and second triggers). The event causes the actions to take place. Now, in the actions, there is a 'Damage unit' function. This will trigger the event yet again, and in turn causing damage again, and trigger the event and..... so on. Infinite loop. So to prevent it, the trigger is turned off before the damage takes place and then turn on again for future usage.

Does that clear up your mind? Again, please try it first. You''ll see more clearer when you really try it...
 

Dem0n_Hunter

Active Member
Reaction score
2
Ohh, I see but I think I missed where u turned the trigger off back there. lol my bad. it prefectly makes sense now. thx
one more question if it's ok:
If I want this all be an item ability what do I exactly do?
Edit: Oh also is there a way for it to show less numbers? i mean like it shows 100.000 sry I don't remember what u call those but less 000 at the end lol
 

vypur85

Hibernate
Reaction score
803
Code:
    Damage
          Events
          Conditions
                [B](Damage source) has item-type YOURITEMTYPE Equal to True[/B] <-- [I]Boolean comparison[/I]
                (Random integer number between 1 and 100) Less than or equal to 15
          Actions
                Trigger - Turn off (This trigger)
                -------- Modify here --------
                [B]Set IntegerVariable = Int(Damage taken)[/B]
                Floating Text - Create floating text that reads ((String([B](Real(IntegerVariable)[/B]) x 2.25))) + !) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
                Unit - Cause (Damage source) to damage (Triggering unit), dealing (((Damage taken) x 2.25) - (Damage taken)) damage of attack type Normal and damage type Normal
                Trigger - Turn on (This trigger)

For item, just add in the condition.

For removal of decimals, you need to convert the 'Damage taken' into integer. I'm not really sure if I do it right or not. Basically, just convert into real and then to integer and then back to real... Something like that. Not sure. Just try out.
 

Ayanami

칼리
Reaction score
288
By using WilliamPa's trigger, it will detect any type of damage. Let's say maybe you have a spell that deals damage. This spell damage will also have a chance to critical. If you want your critical strike to occur only when attacking, I suggest do it this way. It's not that different from WilliamPa's method.

Firstly, instead of using Critical Strike as base ability, use "Envenomed Spears". Ensure that it can target structures.
Secondly, create a "Poison (Stacking)" buff in the buff editor. I will name this buff "Critical Buff Placer". Replace this buff with the original "Posion (Stacking) buff for the "Envenomed Spears".
Thirdly, implement the below triggers.

Trigger:
  • Critical Enter Init
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A structure) Equal to True
        • Then - Actions
          • Trigger - Add to Critical &lt;gen&gt; the event (Unit - (Triggering unit) Takes damage)
        • Else - Actions


Trigger:
  • Critical Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Entire map)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to True
            • Then - Actions
              • Trigger - Add to Critical &lt;gen&gt; the event (Unit - (Picked unit) Takes damage)
            • Else - Actions


Trigger:
  • Critical
    • Events
    • Conditions
      • (Random integer number between 1 and 100) Less than or equal to 15
      • (Triggering unit) has buff Critical Buff Placer Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Modify here --------
      • Floating Text - Create floating text that reads ((String((Integer((Damage taken) x 2.25))))) + !) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Unit - Cause (Damage Source) to damage (Triggering unit), dealing (((Damage taken) x 2.25) - (Damage taken)) damage of attack type Normal and damage type Normal
      • Unit - Remove Critical Buff Placer buff from (Triggering unit)
      • Trigger - Turn on (This trigger)


If you want to add the critical to an item, just add the "Envenomed Spears" in the Item ability.
 

Dem0n_Hunter

Active Member
Reaction score
2
Hmm that was kinda confusing but u know I don't use any critical ability btw where does the item comes in this trigger?
oh btw why no one uses Destroy last created special effect? doesn't it make it leak or something?
aslo one more thing, the floating text still shows .000 numbers
 

Ayanami

칼리
Reaction score
288
Destroy last created special effect? But there is no special effect created in the trigger 0.o

Ensure that you convert Integer to String first. Then you convert real to integer.

The item comes in this trigger by giving the item the ability your "Envenomed Spears" ability.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top