Moderator
M
Moderator
12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.
20:40, 23rd Apr 2013
Magtheridon96: Tank-Commander's first comment sums most of it up.
Here are a couple of things:
- When you add and remove the crow form ability, you may be ruining units who already have that ability, because if a unit already has the crow form ability, adding it and removing it will end you up with a unit that has no crow form ability. The solution to this can be found in this short tutorial I wrote several months ago: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/how-give-unit-ability-fly-201936/
- You need to make the spells configurable from some Init trigger. The special effects should be configured via string variables set in such a trigger. Same goes for things like damage, area of effect, the number of special effects spawned per spell instance, etc...
The user should not be forced to go through all the spell triggers, potentially wreaking havoc, just to change a simple, aesthetic part of the spell like a special effect path or something.
- Half the leaks are cleared, but there are still parts of your code that leak locations as shown by Tank-Commander's post. Another example of the leaks is the group leak you have in the Storm spell's looping trigger:
You're leaking 2 groups here. The group representing the units within a 500 range of the point matching the given conditions, and the group representing the 1 randomly picked unit.
You can fix it like this:
I hope this brief review helps you beef up the code.
IcemanBo: Too long as NeedsFix. Rejected.
20:40, 23rd Apr 2013
Magtheridon96: Tank-Commander's first comment sums most of it up.
Here are a couple of things:
- When you add and remove the crow form ability, you may be ruining units who already have that ability, because if a unit already has the crow form ability, adding it and removing it will end you up with a unit that has no crow form ability. The solution to this can be found in this short tutorial I wrote several months ago: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/how-give-unit-ability-fly-201936/
- You need to make the spells configurable from some Init trigger. The special effects should be configured via string variables set in such a trigger. Same goes for things like damage, area of effect, the number of special effects spawned per spell instance, etc...
The user should not be forced to go through all the spell triggers, potentially wreaking havoc, just to change a simple, aesthetic part of the spell like a special effect path or something.
- Half the leaks are cleared, but there are still parts of your code that leak locations as shown by Tank-Commander's post. Another example of the leaks is the group leak you have in the Storm spell's looping trigger:
- Set S_RandomUnit = (Random 1 units from (Units within 500.00 of S_TempPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an en
-
Unit Group - Pick every unit in S_RandomUnit and do (Actions)
-
Loop - Actions
- Set S_Affected = (Picked unit)
-
Loop - Actions
You can fix it like this:
- Set TempGroup1 = (Units within 500.00 of ...)
- Set TempGroup2 = (Random 1 units from TempGroup1)
-
Unit Group - Pick every unit in TempGroup2 and do (Actions)
-
Loop - Actions
- Set S_Affected = (Picked unit)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_TempGroup1)
- Custom script: call DestroyGroup(udg_TempGroup2)