- Joined
- Sep 9, 2007
- Messages
- 253
This is mostly for clarification. I have just had the realisation that the way I make triggers can be greatly improved. Example:
Can this be further improved?
Secondly...
I have a lot of arrays where the data item number refers to a player number (examples below) and I have not used 0 in the array as there is no player 0. Is it OK to do it this way or should I do (player number - 1)?
-
Hero Death
-

Events
-


Unit - A unit Dies
-
-

Conditions
-


((Dying unit) is A Hero) Equal to True
-


((Dying unit) belongs to an enemy of Player 12 (Brown)) Equal to True
-
-

Actions
-


Set Hero_AliveorDead[(Player number of (Owner of (Dying unit)))] = 0
-


Set Deaths[(Player number of (Owner of (Dying unit)))] = (Deaths[(Player number of (Owner of (Dying unit)))] + 1)
-


Multiboard - Set the text for (Last created multiboard) item in column 4, row ((Player number of (Owner of (Dying unit))) + 1) to (String(Deaths[(Player number of (Owner of (Dying unit)))])
-
-
-
Hero Death
-

Events
-


Unit - A unit Dies
-
-

Conditions
-


((Dying unit) is A Hero) Equal to True
-


((Dying unit) belongs to an enemy of Player 12 (Brown)) Equal to True
-
-

Actions
-


Set TempPlayer = (Owner of (Triggering unit))
-


Set Hero_AliveorDead[(Player number of TempPlayer)] = 0
-


Set Deaths[(Player number of TempPlayer)] = (Deaths[(Player number of TempPlayer)] + 1)
-


Multiboard - Set the text for (Last created multiboard) item in column 4, row ((Player number of TempPlayer) + 1) to (String(Deaths[(Player number of TempPlayer)]))
-
-
Can this be further improved?
Secondly...
I have a lot of arrays where the data item number refers to a player number (examples below) and I have not used 0 in the array as there is no player 0. Is it OK to do it this way or should I do (player number - 1)?
-
tp and pan to base
-

Events
-

Conditions
-

Actions
-


Wait 1.00 seconds
-


Set TempPlayerGroup = (All players controlled by a User player)
-


Player Group - Pick every player in TempPlayerGroup and do (Actions)
-



Loop - Actions
-




Set TempPlayer = (Picked player)
-




Camera - Pan camera for TempPlayer to StartPoint[(Player number of TempPlayer)] over 1.00 seconds
-
-
-


Custom script: call DestroyForce(udg_TempPlayerGroup)
-


Wait 0.50 seconds
-


Set TempPlayerGroup = (All players controlled by a User player)
-


Player Group - Pick every player in TempPlayerGroup and do (Actions)
-



Loop - Actions
-




Set TempPlayer = (Picked player)
-




Set TempPoint = (StartPoint[(Player number of TempPlayer)] offset by (-250.00, 100.00))
-




Unit - Move Hero[(Player number of (Picked player))] instantly to TempPoint
-




Custom script: call RemoveLocation(udg_TempPoint2)
-
-
-


Custom script: call DestroyForce(udg_TempPlayerGroup)
-


For each (Integer A) from 1 to 6, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Hero_AliveorDead[(Integer A)] Equal to 0
-
-





Then - Actions
-






Set TempPoint = StartPoint[(Integer A)]
-






Set TempPoint2 = (TempPoint offset by (-250.00, 100.00))
-






Hero - Instantly revive Hero[(Integer A)] at TempPoint, Show revival graphics
-






Set Hero_AliveorDead[(Integer A)] = 1
-






Custom script: call RemoveLocation(udg_TempPoint)
-






Custom script: call RemoveLocation(udg_TempPoint2)
-
-





Else - Actions
-
-
-
-
-
Last edited:




