Moderator
M
Moderator
12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.
14:05, 17th Nov 2012
Magtheridon96: Currently, this spell is not MUI.
You don't really need to use timers here, a periodic trigger that gets turned on and off will do.
In order to make this spell MUI (Meaning that it can be cast by multiple units at the same time and work), you need to use indexing or hashtables.
Dynamic indexing is a method that's used to create an index (a number) so you can use it store the spell data inside an array and the index would be different each time you cast the spell, but the system would have to recycle the indexes so the numbers stay as low as possible. Here's a template for it: Click here.
If you don't want to use indexing to make this spell MUI, you can use hashtables. A hashtable is like an array that takes 2 indexes, but unlike the regular arrays, a hashtable's indexes can be less than 0 and up to 2.1 billion (An array is limited to [0 ... 8191])
This tutorial shows you how to use hashtables in case you are not familiar with them.
Efficiency tip:
- Whenever you find something like (Owner of (Triggering unit)) or (Triggering unit), if you're going to repeat it more than once inside a trigger, store it into a variable. It's more efficient to lookup a value from a variable than to call a function to get it. (Anything inside parentheses is actually a function call, unless it's arithmetic)
Finally, in terms of configuration, the spells aren't very flexible.
It would be best to have a trigger that runs on map initialization allowing the user to modify whatever spell constants he wants to modify, like damage, radius, special effects, duration, etc... (But be sure to make it support multiple levels. You can do this either by making use of arrays, or by using formulas, and letting the user configure things like DamagePerLevel, DamageBase, etc...)
IcemanBo: Too long as NeedsFix. Rejected.
14:05, 17th Nov 2012
Magtheridon96: Currently, this spell is not MUI.
You don't really need to use timers here, a periodic trigger that gets turned on and off will do.
In order to make this spell MUI (Meaning that it can be cast by multiple units at the same time and work), you need to use indexing or hashtables.
Dynamic indexing is a method that's used to create an index (a number) so you can use it store the spell data inside an array and the index would be different each time you cast the spell, but the system would have to recycle the indexes so the numbers stay as low as possible. Here's a template for it: Click here.
If you don't want to use indexing to make this spell MUI, you can use hashtables. A hashtable is like an array that takes 2 indexes, but unlike the regular arrays, a hashtable's indexes can be less than 0 and up to 2.1 billion (An array is limited to [0 ... 8191])
This tutorial shows you how to use hashtables in case you are not familiar with them.
Efficiency tip:
- Whenever you find something like (Owner of (Triggering unit)) or (Triggering unit), if you're going to repeat it more than once inside a trigger, store it into a variable. It's more efficient to lookup a value from a variable than to call a function to get it. (Anything inside parentheses is actually a function call, unless it's arithmetic)
Finally, in terms of configuration, the spells aren't very flexible.
It would be best to have a trigger that runs on map initialization allowing the user to modify whatever spell constants he wants to modify, like damage, radius, special effects, duration, etc... (But be sure to make it support multiple levels. You can do this either by making use of arrays, or by using formulas, and letting the user configure things like DamagePerLevel, DamageBase, etc...)