• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Need help with trigger

Status
Not open for further replies.
Level 2
Joined
Apr 7, 2016
Messages
15
I tried to make an ability, which the next effect "Unit's attacks echo, dealing 35% of damage dealt after a small delay. This ability can only occur once in 2.5 seconds". But something seems to slip from my hands and it doesn't work anyway I try it. Can you please show how to make it right

  • Divine Weapon Turn On
    • События
      • Боевая единица - A unit Атакован
    • Условия
      • (Level of Divine Weapon for (Attacking unit)) больше 0
    • Действия
      • Set Valkyrie = (Attacking unit)
      • Set DivineWeaponTarget = (Attacked unit)
      • Триггер - Turn on Divine Weapon Damage Check <gen>
      • Триггер - Turn off (This trigger)
      • Wait 2.50 game-time seconds
      • Триггер - Turn on (This trigger)
  • Divine Weapon Damage Check
    • События
    • Условия
      • (Damage source) равно Valkyrie
    • Действия
      • Триггер - Turn off (This trigger)
      • Set DivineWeaponDamage = (Damage taken)
      • Триггер - Run Divine Weapon Proc <gen> (ignoring conditions)
There's event a Divine Weapon Target is damaged, which is added by another trigger, when hero is bought

  • Divine Weapon Proc
    • События
    • Условия
    • Действия
      • Триггер - Turn off (This trigger)
      • Спецэффект - Create a special effect attached to the chest of DivineWeaponTarget using Abilities\Spells\Human\ManaFlare\ManaFlareTarget.mdl
      • Set DivineWeaponEffect = (Last created special effect)
      • Wait 0.75 game-time seconds
      • Боевая единица - Cause Valkyrie to damage DivineWeaponTarget, dealing (0.35 x DivineWeaponDamage) damage of attack type Герой and damage type Обычный
      • Спецэффект - Destroy DivineWeaponEffect
Dunno if you can understand it, cause it seems scary after being copied from Rus WE
 
Last edited:
Level 12
Joined
Jun 12, 2010
Messages
413
Are you using the Event "A unit is attacked"?

(Damage source) does not respond to that event. Instead, you should use attacking unit. However, you will be unable to find out how much damage was dealt. Also, this ability is not MUI, it will only work if there is one unit in your map. Is this the behaviour you want, or do you want it to work for any unit?

Meanwhile, you should look into: Bribe's Damage Engine
 

ISL

ISL

Level 13
Joined
Nov 7, 2014
Messages
238
There you go

Write me in case you need any help.
Did it in like ~30 minutes so there's no documentation.
Installation:
1. Install this awesome Damage Engine made by @Bribe
2. Copy the custom spell from the map below
3. Copy the triggers too (Damage After Delay folder)
4. Paste it all into your map
Done.

Notes:
-The delay before the damage is dealt is .5 seconds
-There are no special effects nor floating text to view when and how much damage is dealt
-A peasant with 200 Health should die to 4 attacks from the hero, but with this spell, he dies to 3.

EDIT:
Completely forgot about the last bit :D
This ability can only occur once in 2.5 seconds
 

Attachments

  • DamageAfterDelay.w3x
    32.2 KB · Views: 38

ISL

ISL

Level 13
Joined
Nov 7, 2014
Messages
238
Added the 2.5 cooldown to the ability without creating any more stuff to import. Just change the existing two triggers to the new ones.
 

Attachments

  • DamageAfterDelay_v2.w3x
    32.4 KB · Views: 32

ISL

ISL

Level 13
Joined
Nov 7, 2014
Messages
238
When you wanna create an ability with the effect that is not instant(i.e effect over time, after delay, etc), you gotta do it in MUI.

so
1. You should learn how to MUI first.
Tutorial - 1; Tutorial - 2.

Basically it's all about using array variables (i.e using a variable such as Caster[Index] instead of the usual Caster)
So if two or more units will happen to use the exact same ability, their effects will function separately from each other, without any intersections, interrupting, or data overriding.

Their effects won't screw each other simply because each ability Instance will be using its own set of variables, determined by its own specific Index.

For example - Unit who casts the ability first will have the Index of 1, therefore, the ability effect will only use variables like Caster[1], Point[1], Damage[1], Target[1], etc.
If a unit will cast the same ability while previous one is still active - his Index will be increased by +1, resulting in Second unit using the Index of 2. (Caster[2], Point[2], Damage[2], Target[2], etc)

If there are no active instances of a spell left in the game - the index is set back to it's initial value - 0. So you won't end up crashing after 15 minutes of playing.

Notes:
-You cannot use the Wait function in MUI, but instead you can create a Timer variable that ticks every 0.01/0.10/1.00 seconds and fires when it has reached a certain point (2.5 seconds for example)
-There's some advanced Indexing stuff happening in the map I sent to you. Before allocating a new set of variables and increasing the total Index by 1, it actually checks all previous instances of the spell to see if they are still active or not. In case they are not used anymore - it overwrites their previous values and sets them to ones of the new instance. The TempInt variable makes sure to register a new instance only once per cast.

after that
2. Take a moment to learn the Damage engine.

It allows you to get the moment when a unit is damaged, the amount of damage dealt, as well as the damage source and damage target.
All of those are used in the spell I sent you.




P.S.
I'm kinda not in the mood for writing documentary for an ability, but I'll try to add some to the map and make it slightly less complicated. Perhaps, tomorrow.
 
Level 2
Joined
Apr 7, 2016
Messages
15
Thx a lot, I was most confused by the ability's trigger itself (Now I am even deeper in the darkness of WC modding, cause of MUI), damage engine had everything more or less explained. So once again thank you for your help
 
  • Like
Reactions: ISL
Level 10
Joined
Mar 17, 2012
Messages
579
А вообще брось эту затею пользоваться русским эдитором и поставь оригинальный. Иначе никто тебе не поможет :)
 
Status
Not open for further replies.
Top