- Joined
- Feb 4, 2009
- Messages
- 1,314
How it should work:
everytime a slot becomes empty the last value of the array will be copyed to it
I made and uploaded some system using this way of indexing:
http://www.hiveworkshop.com/forums/spells-569/lightning-system-by-d4rk_g4nd4lf-version-0-1d-142234/
I didn't find any bugs while testing but I did not test all cases...
however people told me about fatal errors and I was like:
DAMN IT! I FAILED!!!!111
after thinking about everything I decided to recode the problem at its simplest form and here it is:
it should work but it does not
must be some extreme case I think because it only happenes sporadically
I'm looking for either a way to fix this or an even better indexing system
don't think anything can beat this by its simplicity and efficiency though
Code:
edit: I uploaded a modified version with a little text and so on to understand it easier
everytime a slot becomes empty the last value of the array will be copyed to it
I made and uploaded some system using this way of indexing:
http://www.hiveworkshop.com/forums/spells-569/lightning-system-by-d4rk_g4nd4lf-version-0-1d-142234/
I didn't find any bugs while testing but I did not test all cases...
however people told me about fatal errors and I was like:

after thinking about everything I decided to recode the problem at its simplest form and here it is:
it should work but it does not
must be some extreme case I think because it only happenes sporadically
I'm looking for either a way to fix this or an even better indexing system
don't think anything can beat this by its simplicity and efficiency though
Code:
-
Events
-
Time - Every 0.10 seconds of game time
-
-
Conditions
-
Actions
-
Set Number = (Number + 1)
-
Set Duration[Number] = 0.00
-
Set DurationMax[Number] = (Random real number between 0.00 and 2.00)
-
Set loc = (Center of (Playable map area))
-
Set loc2 = (loc offset by 256.00 towards (Real(Number)) degrees)
-
Lightning - Create a Drain Life lightning effect from source loc to target loc2
-
Set Lightning[Number] = (Last created lightning effect)
-
Custom script: call RemoveLocation( udg_loc )
-
Custom script: call RemoveLocation( udg_loc2 )
-
Visibility - Disable fog of war
-
Visibility - Disable black mask
-
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer A) from 1 to Number, do (Actions)
-
Loop - Actions
-
Game - Display to (All players) the text: (Number: + (String(Number)))
-
Game - Display to (All players) the text: (A: + (String((Integer A))))
-
Game - Display to (All players) the text: (Duration: + (String(Duration[(Integer A)])))
-
Game - Display to (All players) the text: (Max Duration: + (String(DurationMax[(Integer A)])))
-
Set Duration[(Integer A)] = (Duration[(Integer A)] + 0.03)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Duration[(Integer A)] Less than DurationMax[(Integer A)]
-
-
Then - Actions
-
Set loc = (Center of (Playable map area))
-
Set loc2 = (loc offset by 256.00 towards (Real((Integer A))) degrees)
-
Lightning - Move Lightning[(Integer A)] to source loc and target loc2
-
Custom script: call RemoveLocation( udg_loc )
-
Custom script: call RemoveLocation( udg_loc2 )
-
-
Else - Actions
-
Lightning - Destroy Lightning[(Integer A)]
-
Set Duration[(Integer A)] = Duration[Number]
-
Set Lightning[(Integer A)] = Lightning[Number]
-
Set Number = (Number - 1)
-
-
-
-
-