- Joined
- Sep 27, 2011
- Messages
- 141
-
Actions
-

Set Temp_Unit = (Triggering unit)
-

Set Player = (Owner of Temp_Unit)
-

Set Temp_Int3 = (Player number of Player)
-

Set Resource_Unit = (Unit-type((String((Issued order)))))
-

Custom script: set udg_Temp_Int2 = udg_Resource_Unit
-

Set Temp_Boolean = True
-

-------- Check Unit Costs --------
-

For each (Integer Temp_Int) from 1 to Number_Of_Resources, do (Actions)
-


Loop - Actions
-



Set Unit_Resource_Cost = (Load Temp_Int of Temp_Int2 from Unit_Costs_Table)
-



Set Player_Resources = (Load Temp_Int3 of Temp_Int from Player_Resources_Table)
-



Set Resources_Value = (Integer((Substring(Player_Resources, ((Length of Resources_Contained[Temp_Int]) + 1), (Length of Player_Resources)))))
-



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




If - Conditions
-





Unit_Resource_Cost Greater than Resources_Value
-
-




Then - Actions
-





Set Temp_Boolean = False
-
-




Else - Actions
-
-
-
-

-------- Temp_Boolean is true even after being set to false i checked --------
-


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



If - Conditions
-




Temp_Boolean Equal to True
-
-



Then - Actions
-




For each (Integer Temp_Int) from 1 to Number_Of_Resources, do (Actions)
-





Loop - Actions
-






Set Unit_Resource_Cost = (Load Temp_Int of Temp_Int2 from Unit_Costs_Table)
-






Set Player_Resources = (Load Temp_Int3 of Temp_Int from Player_Resources_Table)
-






Set Resources_Value = (Integer((Substring(Player_Resources, ((Length of Resources_Contained[Temp_Int]) + 1), (Length of Player_Resources)))))
-






Set Resources_Value = (Resources_Value - Unit_Resource_Cost)
-






Set Player_Resources = (Resources_Contained[Temp_Int] + (String(Resources_Value)))
-






Hashtable - Save Player_Resources as Temp_Int3 of Temp_Int in Player_Resources_Table
-
-
-
-



Else - Actions
-




Custom script: call IssueImmediateOrderById( udg_Temp_Unit, 851976 )
-




Set Players = (Player group(Player))
-




Game - Display to tempForce the text: Not Enough Resources
-




Custom script: call DestroyForce(udg_Players)
-
-
-
-






