- Joined
- Jun 24, 2009
- Messages
- 1,409
I'm often attacked by the Spell moderators because of the system I made and I use. They say Hanky's method is better.(Just a little...) I still use this system because I know every single part of it and it's more suitable for me. But I want to make it a better system with no waste of memory or something else.
So the problem with the system is that it is possible that there will be empty, unused slots until the trigger turns off. That's not a really big problem because the system will jump this instance after a check anyway but I'm attacked because of that :/ I don't want to trash the system so please just make suggestions and not a full remake that throws out nearly anything.
-
Start
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Spell
-
Actions
- Comment - A part of the core of the system. It seeks for unused slots so the trigger will use this instead of creating a new maximum instance. If there is no unused slot out of the current maximum, the maximum will be increased by 1.
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Has[LastRecycled] Equal to True
-
Then - Actions
- Set Max = (Max + 1)
- Set Index = Max
-
Else - Actions
- Set Index = LastRecycled
- Set LastRecycled = RecycledList[LastRecycled]
-
If - Conditions
- Comment - Setting the values for the triggers, increasing the number of instances running and turning the checked boolean to true.
- Set Caster[Index] = (Triggering unit)
- ...
- Set Has[Index] = True
- Set Count = (Count + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Loop <gen> is on) Equal to False
-
Then - Actions
- Trigger - Turn on Loop <gen>
- Else - Actions
-
If - Conditions
-
Events
-
Loop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
For each (Integer Integer) from 0 to Max, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Comment - Checking the boolean if the instance is still used.
- Has[Integer] Equal to True
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Comment - Checking if the spell shall be turned off
- Time[Integer] Greater than 0.00
-
Then - Actions
- Comment - Actions if yes.
- Set Time[Integer] = Time[Integer] - 0.03
-
Else - Actions
- Comment - Actions if no, cleanup and instance disabler.
- Set Count = (Count - 1)
- Set Has[Integer] = False
- Comment - Other part of the core, storing the slot number that is just disabled.
- Set RecycledList[Integer] = LastRecycled
- Set LastRecycled = Integer
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Comment - Full cleanup if there is no running instance
- Count Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- For each (Integer A) from 0 to Max, do (Set RecycledList[(Integer A)] = 0)
- Set LastRecycled = 0
- Set Max = 0
- Else - Actions
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer Integer) from 0 to Max, do (Actions)
-
Events