• 🏆 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] Multishot system

Status
Not open for further replies.
There's massive memory leaks, and some operations which can be simplified.
For example, in this For, at every loop it computes again.
1673704724463.png

Here, the trigger will process in average half of the group to verify if the unit is in this group, so it destroys the performance.
And when you pick a group, just select the units in range then filter it in a function.
Never, and NEVER use single line functions because they are so hard to read and to edit.
1673704978815.png

And then, roughly the same.
1673705056636.png

When i'll get the time, i'll show you a better version by editing this reply.
========== PART 2 - EDIT
Well, I managed to clean up your triggers and simplify a lot of things. There's still some leaks but you will lag in 20 hours instead of 2 minutes.
1) The unit indexation is gone, you just need a unit group
2) I added secondary variables (u, ug, p, r, x, y, etc) but you can rename them as you see fit. However for ug you have to also change the group destruction call.
3) I added a Limit system with a boolean to enable/disable. When enabled the projectile won't hit more than Limit targets at the same time, for example in case of a very tightly packed enemy group.
4) The speed is a speed per second (like regular Warcraft 3 projectile speed).
5) I added Loop_Per_Second in the setup, so you can change how many loops are done per second without having to change the speed (it is automatically computed)
6) You have still room to expand the spell, for example :
☼ adding multiple spells with their own data
☼ deleting an arrow when out of the terrain
☼ changing dynamically the loop per second depending on the number of active arrows
☼ Put an arrow size setup variable as well as a range/lifespan
☼ Put boolean variables to filter any kind of targets crossing your mind

The map is attached to this reply. No need to credit me but you can if you want.
 

Attachments

  • Multi Shot Spell v0.2 - FlameofChange Edit.w3x
    25.6 KB · Views: 7
Last edited:
Status
Not open for further replies.
Top