I am in the process of making a new Risk Trigger System. So far I have got the randomize bases trigger done. (Thanks to ruleofiron99 & deathismyfriend) This is going to be my thread to get this entire system done I will make a check list of what needs to be done still and what i need most help on. I will also post each trigger so you guys can double check it for efficient and leaks.
Here is the list of things that need to be done for the entire system to be finished.
1. Base randomizing & Setting starting defenders (Seems completed, feel free to comment)
2. Changing base defenders & owner of bases (Changing base defender is almost done, in the process of optimizing it. working on change owner of base trigger.)
3. Setting bases to countries
4. Income system
5. Unit spawn system
6. Multiboard (Possibly done, will post when I get to #6)
7. Game options
8. Camera (Possibly done, will post when I get to #8)
9. I may add more but I am kind of tired and can't think of any right now.
Here is the Base randomizing trigger / Starting defenders
Here is the trigger that changes the defender of a base, when the player chooses to.
let me know if there anything i can do to make it better.
Here is the list of things that need to be done for the entire system to be finished.
1. Base randomizing & Setting starting defenders (Seems completed, feel free to comment)
2. Changing base defenders & owner of bases (Changing base defender is almost done, in the process of optimizing it. working on change owner of base trigger.)
3. Setting bases to countries
4. Income system
5. Unit spawn system
6. Multiboard (Possibly done, will post when I get to #6)
7. Game options
8. Camera (Possibly done, will post when I get to #8)
9. I may add more but I am kind of tired and can't think of any right now.
Here is the Base randomizing trigger / Starting defenders
-
Randomize Bases Set Defenders
-
Events
- Map initialization
- Conditions
-
Actions
- -------- Add buildings to the pool --------
- Set Bases = (Units owned by Neutral Hostile matching (((Matching unit) is A structure) Equal to True))
- -------- Set active players --------
- Set players = (All players matching (((Matching player) slot status) Equal to Is playing))
- -------- _________________ --------
-
Unit Group - Pick every unit in Bases and do (Actions)
-
Loop - Actions
- -------- Give a City/Tower/Defender to a random player from the pool --------
- Set tempPlayer = (Random player from players)
- Set tempUnit = (Picked unit)
- Unit - Change ownership of tempUnit to tempPlayer and Change color
- Set tempPlayer1 = (Owner of tempUnit)
- Set tempPoint = (Position of tempUnit)
- Set tempPoint1 = (tempPoint offset by (-95.00, -290.00))
- Unit - Create 1 Circle of Power (Custom) for Neutral Passive at tempPoint1 facing Default building facing degrees
- Set tempPoint2 = (Position of (Last created unit))
- Unit - Create 1 Guardtower Normal for tempPlayer1 at tempPoint2 facing Default building facing degrees
- Set tempUnit1 = (Last created unit)
- Unit - Add Defend (Casting) to tempUnit1
- Unit - Create 1 Private for tempPlayer1 at tempPoint2 facing Default building facing degrees
- Set BaseDefender = (Last created unit)
- Unit - Order tempUnit1 to Orc Raider - Ensnare BaseDefender
- Unit Group - Add BaseDefender to BaseDefenders
- -------- Clear Leaks --------
- Custom script: call RemoveLocation( udg_tempPoint )
- Custom script: call RemoveLocation( udg_tempPoint1 )
- Custom script: call RemoveLocation( udg_tempPoint2 )
- Custom script: set udg_tempUnit = null
- Custom script: set udg_tempUnit1 = null
- Custom script: set udg_BaseDefender = null
- Custom script: set udg_tempPlayer1 = null
- -------- Remove and Add Players --------
- Player Group - Remove tempPlayer from players
- Player Group - Add tempPlayer to playerstemper
- -------- Refresh Player Pool --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of players in players) Equal to 0
-
Then - Actions
-
Player Group - Pick every player in playerstemper and do (Actions)
-
Loop - Actions
- Player Group - Remove (Picked player) from playerstemper
- Player Group - Add (Picked player) to players
-
Loop - Actions
-
Player Group - Pick every player in playerstemper and do (Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in (Units owned by Neutral Hostile of type City)) Equal to 0
-
Then - Actions
- Trigger - Turn on Change Defender <gen>
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
Events
let me know if there anything i can do to make it better.
-
Change Defender
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Select New Defender
-
Actions
- -------- Set New Defender & Position --------
- Set tempUnit = (Target unit of ability being cast)
- Set tempPoint = (Position of tempUnit)
- -------- Set Casting Unit and Owner --------
- Set tempUnit1 = (Triggering unit)
- Set tempPlayer = (Owner of tempUnit1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (((Target unit of ability being cast) is in BaseDefenders) Equal to False) and ((((Target unit of ability being cast) is An Ancient) Equal to False) and ((Owner of tempUnit) Equal to tempPlayer))
-
Then - Actions
- -------- Set Casting Unit Position --------
- Set tempPoint1 = (Position of tempUnit1)
- Set tempGroup = (Units within 500.00 of tempPoint1 matching (((Matching unit) is in BaseDefenders) Equal to True))
- -------- Set Current Defender & Position --------
- Set tempUnit2 = (Random unit from tempGroup)
- Set tempPoint2 = (Position of tempUnit2)
- -------- Swap Defenders & Remove/Add Buffs --------
- Unit - Remove All buffs from tempUnit2
- Unit Group - Remove tempUnit2 from BaseDefenders
- Unit - Move tempUnit2 instantly to tempPoint
- Unit - Move tempUnit instantly to tempPoint2
- Unit Group - Add tempUnit to BaseDefenders
- Set tempGroup1 = (Units within 500.00 of tempPoint1 matching ((Unit-type of (Matching unit)) Equal to Guardtower Normal))
- Set tempUnit3 = (Random unit from tempGroup1)
- Unit - Order tempUnit3 to Orc Raider - Ensnare tempUnit
- -------- Clear Leaks --------
- Custom script: call RemoveLocation( udg_tempPoint1 )
- Custom script: call RemoveLocation( udg_tempPoint2 )
- Custom script: set udg_tempUnit2 = null
- Custom script: set udg_tempUnit3 = null
- Custom script: call DestroyGroup( udg_tempGroup )
- Custom script: call DestroyGroup( udg_tempGroup1 )
-
Else - Actions
- Unit - Order tempUnit1 to Stop
- Set tempForce = (All players matching ((Owner of tempUnit1) Equal to tempPlayer))
- Game - Display to tempForce the text: Pick a different un...
-
If - Conditions
- Custom script: call RemoveLocation( udg_tempPoint )
- Custom script: call DestroyForce ( udg_tempForce)
- Custom script: set udg_tempUnit = null
- Custom script: set udg_tempUnit1 = null
- Custom script: set udg_tempPlayer = null
-
Events
Last edited: