This system allows for you to do 3 things
While containing only 6 Triggers and 9 variables
- Ally/Unally/Truce/Giving Full Control to other players
- Give you and tells you your Income
- Camera Movement such as controling the zoom, angle, roll, rotate, and height ( All the things you can move with Camera Triggers xD)
This was made for maps such as strategy/diplomacy maps, but can easily be used for other things as well just look for the group you want like Income which will have this telling you that its dealing with Income
-------- ----------------------------------------------INCOME---------------------------------------------- --------
This uses no Third Party Material and is useable on 1.24
Here are the Triggers
Setup
Setup
Events
Conditions
Actions
-------- ----------------------------------------------ALLIANCE---------------------------------------------- --------
-------- Set this up to what ever you like Example: Red in your map controls a controls a country...Therefore you can name it what the country is instead of red or blue --------
Set PlayerColor[1] = red
Set PlayerColor[2] = blue
Set PlayerColor[3] = teal
Set PlayerColor[4] = purple
Set PlayerColor[5] = yellow
Set PlayerColor[6] = orange
Set PlayerColor[7] = green
Set PlayerColor[8] = pink
Set PlayerColor[9] = pink
Set PlayerColor[10] = light blue
Set PlayerColor[11] = dark green
Set PlayerColor[12] = brown
-------- ----------------------------------------------INCOME---------------------------------------------- --------
-------- Change The Unit Type to what Unit you want to have the income said in IncomeMoney(Make Sure they have The same Array!! --------
Set IncomeUNIT_TYPE[1] = Farm
Set IncomeMoney[1] = 100
Set IncomeUNIT_TYPE[2] = Fruit Stand
Set IncomeMoney[2] = 101
Set IncomeUNIT_TYPE[3] = Lumber Mill
Set IncomeMoney[3] = 10
Set IncomeUNIT_TYPE[4] = Gryphon Aviary
Set IncomeMoney[4] = 11
Setup Timer
Events
Time - Elapsed game time is 0.05 seconds
Conditions
Actions
-------- ----------------------------------------------INCOME---------------------------------------------- --------
-------- This Starts The Timer for the Income --------
Countdown Timer - Start Timer as a Repeating timer that will expire in 60.00 seconds
-------- You can change the Title of the Timer to what ever you desire or the Times it will expire --------
Countdown Timer - Create a timer window for (Last started timer) with title Income
Countdown Timer - Show (Last created timer window)
Commands
Camera Commands
Events
Player - Player 1 (Red) types a chat message containing - as A substring
Player - Player 2 (Blue) types a chat message containing - as A substring
Player - Player 3 (Teal) types a chat message containing - as A substring
Player - Player 4 (Purple) types a chat message containing - as A substring
Player - Player 5 (Yellow) types a chat message containing - as A substring
Player - Player 6 (Orange) types a chat message containing - as A substring
Player - Player 7 (Green) types a chat message containing - as A substring
Player - Player 8 (Pink) types a chat message containing - as A substring
Player - Player 9 (Gray) types a chat message containing - as A substring
Player - Player 10 (Light Blue) types a chat message containing - as A substring
Player - Player 11 (Dark Green) types a chat message containing - as A substring
Player - Player 12 (Brown) types a chat message containing - as A substring
Conditions
Actions
-------- Allows for a memory leak to be destoryed later on --------
Set Saying_Player = (Player group((Triggering player)))
-------- ----------------------------------------------CAMERA---------------------------------------------- --------
-------- !!WARNING!! Dont do anything to these triggers unless you know what your doing...It may get confusing for some. --------
-------- Zoom --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(String((Substring((Entered chat string), 2, 6))) as Lower case) Equal to zoom
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Integer((Substring((Entered chat string), 7, 10)))) Greater than or equal to 1
(Integer((Substring((Entered chat string), 7, 10)))) Less than or equal to 999
Then - Actions
Camera - Set (Triggering player)'s camera Distance to target to (4.00 x (Real((Substring((Entered chat string), 7, 9))))) over 1.00 seconds
Else - Actions
Game - Display to Saying_Player the text: |c00FF0101Zoom Erro...
Else - Actions
-------- Angle --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(String((Substring((Entered chat string), 2, 7))) as Lower case) Equal to angle
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Integer((Substring((Entered chat string), 7, 10)))) Less than or equal to 180
(Integer((Substring((Entered chat string), 7, 10)))) Greater than or equal to 1
Then - Actions
Camera - Set (Triggering player)'s camera Angle of attack to ((Real((Substring((Entered chat string), 8, 10)))) + 180.00) over 1.00 seconds
Else - Actions
Game - Display to Saying_Player the text: |c00FF0101Angle Err...
Else - Actions
-------- Roll --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(String((Substring((Entered chat string), 2, 6))) as Lower case) Equal to roll
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Integer((Substring((Entered chat string), 7, 10)))) Greater than or equal to 1
(Integer((Substring((Entered chat string), 7, 10)))) Less than or equal to 360
Then - Actions
Camera - Set (Triggering player)'s camera Roll to ((Real((Substring((Entered chat string), 7, 10)))) - 1.00) over 1.00 seconds
Else - Actions
Game - Display to Saying_Player the text: |c00FF0101Roll Erro...
Else - Actions
-------- Rotate --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(String((Substring((Entered chat string), 2, 8))) as Lower case) Equal to rotate
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Integer((Substring((Entered chat string), 9, 12)))) Greater than or equal to 1
(Integer((Substring((Entered chat string), 9, 12)))) Less than or equal to 360
Then - Actions
Camera - Set (Triggering player)'s camera Rotation to ((Real((Substring((Entered chat string), 9, 12)))) + 89.00) over 1.00 seconds
Else - Actions
Game - Display to Saying_Player the text: |c00FF0101Rotate Er...
Else - Actions
-------- Height --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(String((Substring((Entered chat string), 2, 8))) as Lower case) Equal to height
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Integer((Substring((Entered chat string), 9, 12)))) Greater than or equal to -400
(Integer((Substring((Entered chat string), 9, 12)))) Less than or equal to 2000
Then - Actions
Camera - Set (Triggering player)'s camera Height Offset to ((Real((Substring((Entered chat string), 9, 12)))) + 0.00) over 1.00 seconds
Else - Actions
Game - Display to Saying_Player the text: |c00FF0101Height Er...
Else - Actions
-------- Destorys the memory leak --------
Custom script: call DestroyForce (udg_Saying_Player)
Alliance Commands
Events
Player - Player 1 (Red) types a chat message containing - as A substring
Player - Player 2 (Blue) types a chat message containing - as A substring
Player - Player 3 (Teal) types a chat message containing - as A substring
Player - Player 4 (Purple) types a chat message containing - as A substring
Player - Player 5 (Yellow) types a chat message containing - as A substring
Player - Player 6 (Orange) types a chat message containing - as A substring
Player - Player 7 (Green) types a chat message containing - as A substring
Player - Player 8 (Pink) types a chat message containing - as A substring
Player - Player 9 (Gray) types a chat message containing - as A substring
Player - Player 10 (Light Blue) types a chat message containing - as A substring
Player - Player 11 (Dark Green) types a chat message containing - as A substring
Player - Player 12 (Brown) types a chat message containing - as A substring
Conditions
Actions
-------- ----------------------------------------------ALLIANCE---------------------------------------------- --------
-------- This finds the rest of the triggering players chat --------
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Entered chat string) Equal to (-ally + PlayerColor[(Integer A)])
Then - Actions
Player - Make (Triggering player) treat (Player((Integer A))) as an Ally with shared vision
Game - Display to (All players) the text: ((Name of (Triggering player)) + ( has allied + (Name of (Player((Integer A))))))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Entered chat string) Equal to (-truce + PlayerColor[(Integer A)])
Then - Actions
Player - Make (Triggering player) treat (Player((Integer A))) as an Neutral
Game - Display to (All players) the text: ((Name of (Triggering player)) + ( has truced + (Name of (Player((Integer A))))))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Entered chat string) Equal to (-unally + PlayerColor[(Integer A)])
Then - Actions
Player - Make (Triggering player) treat (Player((Integer A))) as an Enemy
Game - Display to (All players) the text: (((Name of (Triggering player)) + and ) + ((Name of (Player((Integer A)))) + are now at war.))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Entered chat string) Equal to (-full control + PlayerColor[(Integer A)])
Then - Actions
Player - Make (Triggering player) treat (Player((Integer A))) as an Ally with shared vision and full shared units
Game - Display to (All players) the text: ((Name of (Player((Integer A)))) + ( has full control of + (Name of (Triggering player))))
Else - Actions
Income Command
Events
Player - Player 1 (Red) types a chat message containing -income as An exact match
Player - Player 2 (Blue) types a chat message containing -income as An exact match
Player - Player 3 (Teal) types a chat message containing -income as An exact match
Player - Player 4 (Purple) types a chat message containing -income as An exact match
Player - Player 5 (Yellow) types a chat message containing -income as An exact match
Player - Player 6 (Orange) types a chat message containing -income as An exact match
Player - Player 7 (Green) types a chat message containing -income as An exact match
Player - Player 8 (Pink) types a chat message containing -income as An exact match
Player - Player 9 (Gray) types a chat message containing -income as An exact match
Player - Player 10 (Light Blue) types a chat message containing -income as An exact match
Player - Player 11 (Dark Green) types a chat message containing -income as An exact match
Player - Player 12 (Brown) types a chat message containing -income as An exact match
Conditions
Actions
Set Saying_Player = (Player group((Triggering player)))
-------- ----------------------------------------------INCOME---------------------------------------------- --------
-------- -------GOLD------- --------
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
-------- Counts the # of Units of The Unit Type --------
Set IncomeUnit[(Integer A)] = (Number of units in (Units owned by (Triggering player) of type IncomeUNIT_TYPE[(Integer A)]))
-------- # of Units found in IncomeUnit[Integer A] multiplied the Income amount of what is wanted in the trigger Income --------
Set IncomeAmount[(Integer A)] = (IncomeUnit[(Integer A)] x IncomeMoney[(Integer A)])
-------- Adds the Income Amounts together for a total --------
-------- If you have more Income Amounts then just use Arithmatic till you get the Amount you used --------
Set IncomeTotal = (IncomeAmount[1] + IncomeAmount[2])
-------- -------LUMBER------- --------
For each (Integer B) from 3 to 4, do (Actions)
Loop - Actions
-------- Counts the # of Units of The Unit Type --------
Set IncomeUnit[(Integer B)] = (Number of units in (Units owned by (Triggering player) of type IncomeUNIT_TYPE[(Integer B)]))
-------- # of Units found in IncomeUnit[Integer B] multiplied the Income amount of what is wanted in the trigger Income --------
Set IncomeAmount[(Integer B)] = (IncomeUnit[(Integer B)] x IncomeMoney[(Integer B)])
-------- Adds the Income Amounts together for a total --------
-------- If you have more Income Amounts then just use Arithmatic till you get the Amount you used --------
Set IncomeTotal2 = (IncomeAmount[3] + IncomeAmount[4])
-------- Tells the Triggering Player and only them and tells them their Income --------
Game - Display to Saying_Player the text: (|cffdaa520Gold Income|r: + (String((Integer((Real(IncomeTotal)))))))
Game - Display to Saying_Player the text: (|cff008000Lumber Income|r: + (String((Integer((Real(IncomeTotal2)))))))
-------- Destorys the memory leak --------
Custom script: call DestroyForce (udg_Saying_Player)
Income
Income
Events
Time - Every 60.00 seconds of game time
Conditions
Actions
-------- ----------------------------------------------INCOME---------------------------------------------- --------
-------- Make sure the Event Periodic Timer is the same as your Timer in the Trigger named Timer --------
For each (Integer B) from 1 to 2, do (Actions)
Loop - Actions
-------- The Custom Script makes sure the memory leak is destoryed --------
Custom script: set bj_wantDestroyGroup = true
-------- Make Sure to select the Unit Type tha you want to use --------
Unit Group - Pick every unit in (Units of type IncomeUNIT_TYPE[(Integer B)]) and do (Actions)
Loop - Actions
Player - Add IncomeMoney[(Integer B)] to (Owner of (Picked unit)) Current gold
-------- Note: I Used 2 Integer B actions for Gold and Lumber --------
For each (Integer B) from 3 to 4, do (Actions)
Loop - Actions
-------- The Custom Script makes sure the memory leak is destoryed --------
Custom script: set bj_wantDestroyGroup = true
-------- Make Sure to select the Unit Type tha you want to use --------
Unit Group - Pick every unit in (Units of type IncomeUNIT_TYPE[(Integer B)]) and do (Actions)
Loop - Actions
Player - Add IncomeMoney[(Integer B)] to (Owner of (Picked unit)) Current lumber
Please Give Credit When used
Thanks to Forgotten_Warlord and James7 for helping me
12/15/09 Update 1
- Fixed the mistakes and improved coding that Forgotten_Warlord and James7 pointed out
12/17/09 Update 2
- Fixed The Alliance Bug(But it increases the size of the trigger :O)
- Added Truce as James7 suggested
- Improved Income Code
- Seperated Commands ( Caused Fatal Errors )
12/29/09 Update 3
- Improved Alliance Command ( like 10x smaller... The bug was that I used player Groups xD...Huge Face Palm )
- Added a Full Control Alliance as ikillforeyou suggested
- Added more Help for people who want to use just Camera or just Alliance Commands and such
Keywords:
camera, ally, unally, alliance, income, money, system, truce, full control, gold, lumber, zoom, strategy, diplomacy