• 🏆 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] Easier way to create multiple effects?

Status
Not open for further replies.
Level 7
Joined
Oct 13, 2008
Messages
300
So, Is there any way to create multiple special effects without creating 5,000 special effect actions for each degree and offset, So how to create multiple effects more effectively, possibly with loops or something?
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
  • For each (Integer A) from 1 to 5000, do (Actions)
    • Loop - Actions
      • Set TempPoint = ((Position of (Triggering unit)) offset by (1.00 x (Real((Integer A)))) towards (0.10 x (Real((Integer A)))) degrees)
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Custom script: call RemoveLocation(udg_TempPoint)
This will create a special effect at 1 towards 0.1, at 2 toward 0.2, at 3 towards 0.3, etc. for 5000 times. It's over the top, but you get the picture. This ofcourse only works if both the range and the angle change with constant amounts or don't change at all.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Both of you are right,,
But dont forget to clear the leaks they make!
Either you destroy them immediately (if they have no animation)
Or you put them in a variable (special effect array)
( set SpEff[Integer A] = last created special effect) )
and destroy AFTER,,

Understand?
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
  • For each integer A from 1 to 5000 do Actions
    • set Point = (Position of Unit)
    • create special effect at Point using 'some special effect'
    • set SpecialEffect[(Integer A)] = last created special effect
    • Custom script: call RemoveLocation(udg_Point)
  • wait 5 seconds
  • For each Integer A from 1 to 5000
    • destroy SpecialEffect[(Integer A)]
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
  • For each (Integer A) from 1 to 5000, do (Actions)
    • Loop - Actions
      • Set TempPoint = ((Position of (Triggering unit)) offset by (1.00 x (Real((Integer A)))) towards (0.10 x (Real((Integer A)))) degrees)
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Custom script: call RemoveLocation(udg_TempPoint)
This will create a special effect at 1 towards 0.1, at 2 toward 0.2, at 3 towards 0.3, etc. for 5000 times. It's over the top, but you get the picture. This ofcourse only works if both the range and the angle change with constant amounts or don't change at all.

That will also give 5000 leaks. Store the position of the triggering unit before you run the loop, and then
  • Set TempPoint = TempPointOnUnit offset by (1.00 x (Real((Integer A)))) towards (0.10 x (Real((Integer A)))) degrees)
Also, destroy the TempPointOnUnit at the end of the trigger.

Furthermore, it will probably never create 5000 special effects, since loops in wc3 has a threshold of amount of loops at the same time. You could add a wait after each lap, but it is not suggested since it would create the effects at ~0.27second's intervals.
But well, I forgot where the threshold is, so maybe it wont be any problem if you're lucky.
 
Level 7
Joined
Oct 13, 2008
Messages
300
Okay, Second question... How to create the effects so that they would create ''Circle'' around the caster like in some of the nova spells, Because if you add like 50x degrees and 75 offset to the Loop, it will just create them in like... Line. Not in circles around the caster... Hard to explain. :s
 
Status
Not open for further replies.
Top