Gtam
Lerning how to write and read!! Yeah.
- Reaction score
- 164
Unit Exchange System
By Gtam
By Gtam
This is a nice system that would fit maps like Footman Wars, Footman Frenzy or any map with lagre armies.
What is made from:
Blood, Sweat and tears
GUI
MUI
Jass Snippet made by Rainther.( not Released)
And Some help by Yoshi.
What This system does is allows people to select a group of their units and give it to another player.
This system will not allow the the user to give away Heroes.
When the player types -Switch this systen will display the units he has selected and how many of each type thats selected. After that it will set a boolean to true allowing him to switch the next time he types
Then he types e.g. -Switch 2 then this system will give the selected untis to player 2.
Trigger:
- Exchange
- 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
- Set Selected_G = (Units currently selected by (Triggering player))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Substring((Entered chat string), 2, 7)) Equal to Switch
- Then - Actions
- Unit Group - Pick every unit in Selected_G and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Or - Any (Conditions) are true
- Conditions
- ((Picked unit) is A Hero) Equal to True
- Conditions
- Or - Any (Conditions) are true
- Then - Actions
- Unit Group - Remove (Picked unit) from Selected_G
- Game - Display to (All players) the text: |cffff0000No Heroes...
- Skip remaining actions
- Else - Actions
- Set Exchange[(Player number of (Triggering player))] = True
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- HeIsSure[(Player number of (Triggering player))] Equal to False
- Exchange[(Player number of (Triggering player))] Equal to True
- Then - Actions
- Custom script: call UnitCount(udg_Selected_G, GetTriggerPlayer())
- Set HeIsSure[(Player number of (Triggering player))] = True
- Else - Actions
- Unit Group - Pick every unit in Selected_G and do (Actions)
- Loop - Actions
- Unit - Change ownership of (Picked unit) to (Player((Integer((Substring((Entered chat string), 8, 10)))))) and Change color
- Set HeIsSure[(Player number of (Triggering player))] = False
- Set Exchange[(Player number of (Triggering player))] = False
- Loop - Actions
- Unit Group - Pick every unit in Selected_G and do (Actions)
- If - Conditions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Custom script: call DestroyGroup(udg_Selected_G)
- Unit Group - Pick every unit in Selected_G and do (Actions)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Entered chat string) Equal to -DontSwitch
- Exchange[(Player number of (Triggering player))] Equal to True
- HeIsSure[(Player number of (Triggering player))] Equal to True
- Then - Actions
- Set Exchange[(Player number of (Triggering player))] = False
- Set HeIsSure[(Player number of (Triggering player))] = False
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Events
Credits to:
Rainther for snippet
Yoshi for trigger help
Credits is not needed when system used.
Code:
Changelog
v1.00 Released
v1.00b Leak Fix