- Joined
- Mar 24, 2013
- Messages
- 1,105
I'm having some difficulty here, it will result in a crash when I test it and spam units, if their is 1 to 10, it works without a problem but should it have to a mass amount like 30 or so it leads to a crash, and I'm not entirely sure what the problem is...
I'm sure it must be hitting some kind of infinite loop or something causing it but I am not seeing it.
Any help would be great
edit: Here's the function shown in the 2nd trigger. It's not mine, I think it might be PnF's actually
I'm sure it must be hitting some kind of infinite loop or something causing it but I am not seeing it.
Any help would be great
-
TD Region Setup
-
Events
- Map initialization
- Conditions
-
Actions
- Set TDRegions[1] = TDspawn1 <gen>
- Set TDRegions[2] = TDspawn2 <gen>
- Set TDRegions[3] = TDspawn3 <gen>
- Set TDRegions[4] = TDspawn4 <gen>
- Set TDRegions[5] = TDspawn5 <gen>
- Set TDRegions[5] = TDspawn5 <gen>
- Set TDRegions[6] = TDspawn6 <gen>
- Set TDRegions[7] = TDspawn7 <gen>
- Set TDRegions[8] = TDspawn8 <gen>
- Set TDRegions[9] = TDa1 <gen>
- Set TDRegions[10] = TDa2 <gen>
- Set TDRegions[11] = TDa3 <gen>
- Set TDRegions[12] = TDa4 <gen>
- Set TDRegions[13] = TDa5 <gen>
- Set TDRegions[14] = TDa6 <gen>
- Set TDRegions[15] = TDa7 <gen>
- Set TDRegions[16] = TDa8 <gen>
- Set TDRegions[17] = TDb1 <gen>
- Set TDRegions[18] = TDb2 <gen>
- Set TDRegions[19] = TDb3 <gen>
- Set TDRegions[20] = TDb4 <gen>
- Set TDRegions[21] = TDb5 <gen>
- Set TDRegions[22] = TDb6 <gen>
- Set TDRegions[23] = TDb7 <gen>
- Set TDRegions[24] = TDb8 <gen>
- Set TDRegions[25] = TDc1 <gen>
- Set TDRegions[26] = TDc2 <gen>
- Set TDRegions[27] = TDc3 <gen>
- Set TDRegions[28] = TDc4 <gen>
- Set TDRegions[29] = TDc5 <gen>
- Set TDRegions[30] = TDc6 <gen>
- Set TDRegions[31] = TDc7 <gen>
- Set TDRegions[32] = TDc8 <gen>
-
For each (Integer TempInteger) from 1 to 32, do (Actions)
-
Loop - Actions
- Trigger - Add to TD Movement <gen> the event (Unit - A unit enters TDRegions[TempInteger])
-
Loop - Actions
-
Events
-
TD Movement
- Events
- Conditions
-
Actions
- Set TempUnit = (Triggering unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Owner of TempUnit) controller) Not equal to User
-
Then - Actions
-
For each (Integer TempInteger2) from 1 to 32, do (Actions)
-
Loop - Actions
- Custom script: if IsUnitInRect(udg_TDRegions[udg_TempInteger2], udg_TempUnit) == true then
- Set TempInteger = TempInteger2
- Custom script: endif
-
Loop - Actions
- Unit - Set level of Region Tracker for TempUnit to ((Level of Region Tracker for TempUnit) + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Region Tracker for TempUnit) Equal to 6
-
Then - Actions
- Set TempPlayer = (Player(TempInteger))
- Set TempForce = (All allies of TempPlayer)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempInteger Less than or equal to 4
-
Then - Actions
- Set Lives[2] = (Lives[2] + 1)
- Set TempInteger2 = 2
-
Else - Actions
- Set Lives[1] = (Lives[1] + 1)
- Set TempInteger2 = 1
-
If - Conditions
- Game - Display to (All players) the text: (playerColors[1] + (((Name of TempPlayer) + is leaking lives to the other team! ) + ( They now have + ((String(Lives[TempInteger2])) + lives!))))
- -------- END --------
- Unit - Set level of Region Tracker for TempUnit to 2
- Set TempPoint = (Center of TDRegions[(TempInteger + 8)])
- Unit - Order TempUnit to Patrol To TempPoint
- Custom script: call RemoveLocation(udg_TempPoint)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Region Tracker for TempUnit) Equal to 5
-
Then - Actions
- Set TempPoint = (Center of TDRegions[(TempInteger - 24)])
-
Else - Actions
- Set TempPoint = (Center of TDRegions[(TempInteger + 8)])
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Unit - Order TempUnit to Patrol To TempPoint
- Custom script: call RemoveLocation(udg_TempPoint)
-
For each (Integer TempInteger2) from 1 to 32, do (Actions)
- Else - Actions
-
If - Conditions
JASS:
function IsUnitInRect takes rect whichRect, unit whichUnit returns boolean
local region r = CreateRegion()
local boolean inside
call RegionAddRect(r, whichRect)
set inside = IsUnitInRegion(r, whichUnit)
call RemoveRegion(r)
set r = null
return inside
endfunction
edit: Here's the function shown in the 2nd trigger. It's not mine, I think it might be PnF's actually
Last edited: