Moderator
M
Moderator
17:30 Dec 3, 2012
Magtheridon96: Approved.
This is a useful and robust system.
Magtheridon96: Approved.
This is a useful and robust system.
Triggers
- Movement Setup
- Events
- Map initialization
- Conditions
- Actions
- -------- Setup the units using the system. --------
- Set GMS_PlayersHero[0] = Footman 0001 <gen>
- Set GMS_PlayersHero[1] = Footman 0002 <gen>
- Set GMS_PlayersHero[2] = Footman 0003 <gen>
- Set GMS_PlayersHero[3] = Footman 0004 <gen>
- -------- Setting the direction for each arrow key used in degrees. --------
- Set GMS_UpDegree = 90.00
- Set GMS_DownDegree = 270.00
- Set GMS_LeftDegree = 180.00
- Set GMS_RightDegree = 0.00
- Set GMS_UpLeftDegree = 135.00
- Set GMS_UpRightDegree = 45.00
- Set GMS_DownLeftDegree = 225.00
- Set GMS_DownRightDegree = 315.00
- -------- Setting the distance for the units to move each time in each direction. --------
- -------- Do not set the offset to anything less than 16.00 --------
- Set GMS_UpOffset = 50.00
- Set GMS_DownOffset = 50.00
- Set GMS_LeftOffset = 50.00
- Set GMS_RightOffset = 50.00
- Set GMS_UpLeftOffset = 50.00
- Set GMS_UpRightOffset = 50.00
- Set GMS_DownLeftOffset = 50.00
- Set GMS_DownRightOffset = 50.00
- Player Group - Pick every player in (All players) and do (Actions)
- Loop - Actions
- Set GMS_TempPlayer = (Picked player)
- Custom script: set udg_GMS_TriggerPlayer = GetPlayerId(GetEnumPlayer())
- -------- Locking the camera so it doesn't move from the unit. --------
- Camera - Lock camera target for GMS_TempPlayer to GMS_PlayersHero[GMS_TriggerPlayer], offset by (0.00, 0.00) using Default rotation
- -------- Add the events to the Movement Controller trigger. --------
- Trigger - Add to Movement Controller <gen> the event (Player - GMS_TempPlayer Presses the Left Arrow key)
- Trigger - Add to Movement Controller <gen> the event (Player - GMS_TempPlayer Releases the Left Arrow key)
- Trigger - Add to Movement Controller <gen> the event (Player - GMS_TempPlayer Presses the Right Arrow key)
- Trigger - Add to Movement Controller <gen> the event (Player - GMS_TempPlayer Releases the Right Arrow key)
- Trigger - Add to Movement Controller <gen> the event (Player - GMS_TempPlayer Presses the Down Arrow key)
- Trigger - Add to Movement Controller <gen> the event (Player - GMS_TempPlayer Releases the Down Arrow key)
- Trigger - Add to Movement Controller <gen> the event (Player - GMS_TempPlayer Presses the Up Arrow key)
- Trigger - Add to Movement Controller <gen> the event (Player - GMS_TempPlayer Releases the Up Arrow key)
- Movement Controller
- Events
- Conditions
- Actions
- Custom script: set udg_GMS_id = GetHandleId( GetTriggerEventId() ) - 260
- Set GMS_TempPlayer = (Triggering player)
- Custom script: set udg_GMS_TriggerPlayer = GetPlayerId(udg_GMS_TempPlayer)
- Player Group - Add GMS_TempPlayer to GMS_TriggerPlayerGroup
- -------- Updating key status --------
- Custom script: if udg_GMS_id / 2 * 2 != udg_GMS_id then
- -------- If pressing keys --------
- Set GMS_Keys[(((GMS_id / 2) + 1) + (GMS_TriggerPlayer x 12))] = True
- Custom script: else
- -------- If releasing keys --------
- Set GMS_Keys[((GMS_id / 2) + (GMS_TriggerPlayer x 12))] = False
- Custom script: endif
- -------- If no arrow keys are pressed then it removes the player from the system. --------
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GMS_Keys[(1 + (GMS_TriggerPlayer x 12))] Equal to (==) False
- GMS_Keys[(2 + (GMS_TriggerPlayer x 12))] Equal to (==) False
- GMS_Keys[(3 + (GMS_TriggerPlayer x 12))] Equal to (==) False
- GMS_Keys[(4 + (GMS_TriggerPlayer x 12))] Equal to (==) False
- Then - Actions
- Player Group - Remove GMS_TempPlayer from GMS_TriggerPlayerGroup
- Else - Actions
- Movement System
- Events
- Time - Every 0.03 seconds of game time
- Conditions
- Actions
- Player Group - Pick every player in GMS_TriggerPlayerGroup and do (Actions)
- Loop - Actions
- Custom script: set udg_GMS_TriggerPlayer = GetPlayerId(GetEnumPlayer())
- Set GMS_TempPoint = (Position of GMS_PlayersHero[GMS_TriggerPlayer])
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GMS_Keys[(4 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- Then - Actions
- Set GMS_TempPoint2 = (GMS_TempPoint offset by GMS_UpOffset towards GMS_UpDegree degrees)
- Unit - Order GMS_PlayersHero[GMS_TriggerPlayer] to Move To GMS_TempPoint2
- Custom script: call RemoveLocation(udg_GMS_TempPoint2)
- Else - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GMS_Keys[(3 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- Then - Actions
- Set GMS_TempPoint2 = (GMS_TempPoint offset by GMS_DownOffset towards GMS_DownDegree degrees)
- Unit - Order GMS_PlayersHero[GMS_TriggerPlayer] to Move To GMS_TempPoint2
- Custom script: call RemoveLocation(udg_GMS_TempPoint2)
- Else - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GMS_Keys[(1 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- Then - Actions
- Set GMS_TempPoint2 = (GMS_TempPoint offset by GMS_LeftOffset towards GMS_LeftDegree degrees)
- Unit - Order GMS_PlayersHero[GMS_TriggerPlayer] to Move To GMS_TempPoint2
- Custom script: call RemoveLocation(udg_GMS_TempPoint2)
- Else - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GMS_Keys[(2 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- Then - Actions
- Set GMS_TempPoint2 = (GMS_TempPoint offset by GMS_RightOffset towards GMS_RightDegree degrees)
- Unit - Order GMS_PlayersHero[GMS_TriggerPlayer] to Move To GMS_TempPoint2
- Custom script: call RemoveLocation(udg_GMS_TempPoint2)
- Else - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GMS_Keys[(4 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- GMS_Keys[(1 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- Then - Actions
- Set GMS_TempPoint2 = (GMS_TempPoint offset by GMS_UpLeftOffset towards GMS_UpLeftDegree degrees)
- Unit - Order GMS_PlayersHero[GMS_TriggerPlayer] to Move To GMS_TempPoint2
- Custom script: call RemoveLocation(udg_GMS_TempPoint2)
- Else - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GMS_Keys[(4 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- GMS_Keys[(2 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- Then - Actions
- Set GMS_TempPoint2 = (GMS_TempPoint offset by GMS_UpRightOffset towards GMS_UpRightDegree degrees)
- Unit - Order GMS_PlayersHero[GMS_TriggerPlayer] to Move To GMS_TempPoint2
- Custom script: call RemoveLocation(udg_GMS_TempPoint2)
- Else - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GMS_Keys[(3 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- GMS_Keys[(1 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- Then - Actions
- Set GMS_TempPoint2 = (GMS_TempPoint offset by GMS_DownLeftOffset towards GMS_DownLeftDegree degrees)
- Unit - Order GMS_PlayersHero[GMS_TriggerPlayer] to Move To GMS_TempPoint2
- Custom script: call RemoveLocation(udg_GMS_TempPoint2)
- Else - Actions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- GMS_Keys[(3 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- GMS_Keys[(2 + (GMS_TriggerPlayer x 12))] Equal to (==) True
- Then - Actions
- Set GMS_TempPoint2 = (GMS_TempPoint offset by GMS_DownRightOffset towards GMS_DownRightDegree degrees)
- Unit - Order GMS_PlayersHero[GMS_TriggerPlayer] to Move To GMS_TempPoint2
- Custom script: call RemoveLocation(udg_GMS_TempPoint2)
- Else - Actions
- Custom script: call RemoveLocation(udg_GMS_TempPoint)
Change-Log
-Initial release.
-Removed all point leaks.
-Removed the second point leaks.
-Made the offsets to be set individually.
-Updated the comments and how to import.
-Reduced the movement controller trigger to increase efficiency.
-Greatly increased efficiency in setup trigger.
-Increased efficiency of movement controller trigger.
-Changed the way the system worked so it uses array
[0] also and is not wasted now.