- Joined
- Jun 24, 2009
- Messages
- 1,409
I'm making a spell that should heal the caster and it's minions and damage enemies in it's area. Also when it kills an enemy unit it turns the corpse into a skeleton. But sometimes it just stops doing these things. I can't really find the problem and I'm afraid I have to rewrite the whole spell.
For the ones who want to say these things:
-Bad index recycling system. Learn to trigger MUI.
L_Learn to shut the fuck up if you know shit. The system is okay. It works. But explain me why shouldn't it work with that spell when there are already more than 130 spells in the map using that system
-You're not calling the spells.
L_I do call the spells with a special system that reduces the number of codes triggered when a spell is called. And yes, it works perfectly too.
-
Field of Fallen Souls
- Events
- Conditions
-
Actions
- Set TempInt = (Player number of (Triggering player))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- KFFHas[KFFLastRecycled] Equal to True
-
Then - Actions
- Set KFFMax = (KFFMax + 1)
- Set KFFIndex = KFFMax
-
Else - Actions
- Set KFFIndex = KFFLastRecycled
- Set KFFLastRecycled = KFFRecycledList[KFFLastRecycled]
-
If - Conditions
- Set KFFCaster[KFFIndex] = (Triggering unit)
- Set KFFHas[KFFIndex] = True
- Set KFFCount = (KFFCount + 1)
- Set KFFTargetPoint[KFFIndex] = (Target point of ability being cast)
- Set KFFTimer[KFFIndex] = (15.00 + (2.00 x (Real((Level of Field of Fallen Souls for KFFCaster[KFFIndex])))))
- Set KFFDelay[KFFIndex] = 0
- Set KFFHealDamage[KFFIndex] = (0.10 x (Real(Spellpower[TempInt])))
- Unit - Create 1 Field Void for Neutral Passive at KFFTargetPoint[KFFIndex] facing Default building facing degrees
- Set KFFDummy[KFFIndex] = (Last created unit)
- Animation - Change KFFDummy[KFFIndex]'s animation speed to 20.00% of its original speed
- Animation - Change KFFDummy[KFFIndex]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Field of Fallen Souls Loop <gen> is on) Equal to False
-
Then - Actions
- Trigger - Turn on Field of Fallen Souls Loop <gen>
- Else - Actions
-
If - Conditions
-
Field of Fallen Souls Loop
-
Events
- Time - Every 0.10 seconds of game time
- Conditions
-
Actions
-
For each (Integer KFFInteger) from 0 to KFFMax, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- KFFHas[KFFInteger] Equal to True
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- KFFTimer[KFFInteger] Greater than 0.00
-
Then - Actions
- Set KFFDelay[KFFInteger] = (KFFDelay[KFFInteger] + 1)
- Set KFFTimer[KFFInteger] = (KFFTimer[KFFInteger] - 0.10)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (KFFDelay[KFFInteger] mod 10) Equal to 0
-
Then - Actions
- Set TempLoc = (KFFTargetPoint[KFFInteger] offset by (Random real number between 0.00 and 350.00) towards (Random angle) degrees)
- Special Effect - Create a special effect at TempLoc using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation (udg_TempLoc)
- Else - Actions
-
If - Conditions
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 400.00 of KFFTargetPoint[KFFInteger] 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 enemy of and do (Actions)
-
Loop - Actions
- Unit - Cause KFFCaster[KFFInteger] to damage (Picked unit), dealing KFFHealDamage[KFFInteger] damage of attack type Spells and damage type Normal
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is dead) Equal to True
-
Then - Actions
- Set TempLoc2 = (Position of (Picked unit))
- Unit - Create 1 Minor Skeleton Warrior for (Owner of KFFCaster[KFFInteger]) at TempLoc2 facing Default building facing degrees
- Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
- Animation - Play (Last created unit)'s birth animation
- Special Effect - Create a special effect at TempLoc2 using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation (udg_TempLoc2)
- Unit - Remove (Picked unit) from the game
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 400.00 of KFFTargetPoint[KFFInteger] 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 ((Owner of (Matching unit)) Equal to (Pl and do (Actions)
-
Loop - Actions
- Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + KFFHealDamage[KFFInteger])
-
Loop - Actions
-
Else - Actions
- Unit - Explode KFFDummy[KFFInteger]
- Set KFFCount = (KFFCount - 1)
- Set KFFHas[KFFInteger] = False
- Custom script: call RemoveLocation (udg_KFFTargetPoint[udg_KFFInteger])
- Set KFFRecycledList[KFFInteger] = KFFLastRecycled
- Set KFFLastRecycled = KFFInteger
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- KFFCount Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- For each (Integer A) from 0 to KFFMax, do (Set KFFRecycledList[(Integer A)] = 0)
- Set KFFLastRecycled = 0
- Set KFFMax = 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 KFFInteger) from 0 to KFFMax, do (Actions)
-
Events
-Bad index recycling system. Learn to trigger MUI.
L_Learn to shut the fuck up if you know shit. The system is okay. It works. But explain me why shouldn't it work with that spell when there are already more than 130 spells in the map using that system
-You're not calling the spells.
L_I do call the spells with a special system that reduces the number of codes triggered when a spell is called. And yes, it works perfectly too.