S
Skitz_24
Guest
So is there anyone who can help me fix my problem?
So is there anyone who can help me fix my problem?
Just a few more questions to make sure I understand-- So, each player starts out with a preset number of heroes, and each hero assigns squad members. Now, when a unit is assigned to a squad, can the player still assert direct control over the unit or can the unit only be commanded through the hero? Also, you want each player to be a player, so I can't use the comp player cop-out, right? I think I can do all of this, just wait a bit.
Melee Initialization
Events
Map initialization
Conditions
Actions
Set commandertype[1] = Archmage
Set commandertype[2] = Paladin
Set commandertype[3] = Mountain King
Set commandertype[4] = Blood Mage
Set pforce = (All players matching (((Matching player) slot status) Equal to Is playing))
Player Group - Pick every player in pforce and do (Actions)
Loop - Actions
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
Set temp_point = (Random point in (Playable map area))
Unit - Create 1 commandertype[(Random integer number between 1 and 4)] for (Picked player) at temp_point facing Default building facing degrees
Unit - Set the custom value of (Last created unit) to (Integer A)
Custom script: call RemoveLocation (udg_temp_point)
Custom script: call DestroyForce (udg_pforce)
checks
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Add unit (Neutral Hostile)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Target unit of ability being cast) is A structure) Equal to True
Then - Actions
Unit - Order (Triggering unit) to Stop
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Must target a non-h...
Else - Actions
Add unit
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Add unit (Neutral Hostile)
Actions
Set temp_group = (Units owned by (Owner of (Triggering unit)) matching ((Custom value of (Matching unit)) Equal to (Custom value of (Triggering unit))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in temp_group) Less than 5
Then - Actions
Unit - Set the custom value of (Target unit of ability being cast) to (Custom value of (Triggering unit))
Else - Actions
Custom script: call DestroyGroup (udg_temp_group)
checks Copy
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Join a squad (Neutral Hostile)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Target unit of ability being cast) is A structure) Equal to True
Then - Actions
Unit - Order (Triggering unit) to Stop
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Must target a non-s...
Else - Actions
Join squad
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Join a squad (Neutral Hostile)
Actions
Set temp_group = (Units owned by (Owner of (Triggering unit)) matching ((Custom value of (Matching unit)) Equal to (Custom value of (Target unit of ability being cast))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in temp_group) Less than 5
(Custom value of (Target unit of ability being cast)) Greater than 0
Then - Actions
Unit - Set the custom value of (Triggering unit) to (Custom value of (Target unit of ability being cast))
Else - Actions
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Unable to join that...
Custom script: call DestroyGroup (udg_temp_group)
Remove unit from one squad to join another
Events
Unit - A unit Is issued an order targeting an object
Conditions
(Issued order) Not equal to (Order("fingerofdeath"))
Actions
Unit - Set the custom value of (Ordered unit) to 0
set selected unit
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit
Player - Player 7 (Green) Selects a unit
Player - Player 8 (Pink) Selects a unit
Player - Player 9 (Gray) Selects a unit
Player - Player 10 (Light Blue) Selects a unit
Player - Player 11 (Dark Green) Selects a unit
Player - Player 12 (Brown) Selects a unit
Conditions
(Custom value of (Triggering unit)) Greater than 0
Actions
Set selectedunit[(Player number of (Triggering player))] = (Triggering unit)
move
Events
Unit - A unit Is issued an order targeting a point
Conditions
(Ordered unit) Equal to selectedunit[(Player number of (Owner of (Ordered unit)))]
(Issued order) Not equal to (Order("move"))
(Issued order) Not equal to (Order("smart"))
Actions
Set temp_point = (Target point of issued order)
Set temp_group = (Units owned by (Owner of (Ordered unit)) matching ((Custom value of (Matching unit)) Equal to (Custom value of selectedunit[(Player number of (Owner of (Triggering unit)))])))
Unit Group - Remove selectedunit[(Player number of (Owner of (Ordered unit)))] from temp_group
Unit Group - Pick every unit in temp_group and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Move To temp_point
Custom script: call RemoveLocation (udg_temp_point)
Custom script: call DestroyGroup (udg_temp_group)
attack
Events
Unit - A unit Is issued an order targeting an object
Conditions
(Ordered unit) Equal to selectedunit[(Player number of (Owner of (Ordered unit)))]
(Issued order) Not equal to (Order("attack"))
(Issued order) Not equal to (Order("smart"))
Actions
Set temp_group = (Units owned by (Owner of (Ordered unit)) matching ((Custom value of (Matching unit)) Equal to (Custom value of selectedunit[(Player number of (Owner of (Triggering unit)))])))
Unit Group - Remove selectedunit[(Player number of (Owner of (Ordered unit)))] from temp_group
Unit Group - Pick every unit in temp_group and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Attack (Target unit of issued order)
Custom script: call DestroyGroup (udg_temp_group)
stop
Events
Unit - A unit Is issued an order with no target
Conditions
(Ordered unit) Equal to selectedunit[(Player number of (Owner of (Ordered unit)))]
(Issued order) Not equal to (Order("stop"))
Actions
Set temp_group = (Units owned by (Owner of (Ordered unit)) matching ((Custom value of (Matching unit)) Equal to (Custom value of selectedunit[(Player number of (Owner of (Triggering unit)))])))
Unit Group - Remove selectedunit[(Player number of (Owner of (Ordered unit)))] from temp_group
Unit Group - Pick every unit in temp_group and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Stop
Custom script: call DestroyGroup (udg_temp_group)
Create Squad
Events
Unit - A unit Finishes training a unit
Conditions
((Triggering unit) is A Hero) Equal to False
Actions
Set Squad_Leader[Counter] = (Trained unit)
Unit - Set the custom value of (Trained unit) to Counter
Unit - Make (Trained unit) Invulnerable
Unit - Create SquadSize (Unit-type of (Trained unit)) for (Owner of (Trained unit)) at (Position of (Trained unit)) facing Default building facing degrees
Set Squad[Counter] = (Last created unit group)
Unit Group - Pick every unit in (Last created unit group) and do (Actions)
Loop - Actions
Unit - Disable supply usage for (Picked unit)
Unit - Set the custom value of (Picked unit) to Counter
Unit - Add classification of Summoned to (Picked unit)
Unit Group - Add Squad_Leader[Counter] to Squad[Counter]
Trigger - Turn off Move Squad Unit <gen>
Unit Group - Order Squad[Counter] to Right-Click (Rally-Point of (Triggering unit) as a point)
Trigger - Turn on Move Squad Unit <gen>
Set Counter = (Counter + 1)
Move Squad Unit
Events
Unit - A unit Is issued an order targeting an object
Conditions
Actions
Trigger - Turn off (This trigger)
Unit Group - Order Squad[(Custom value of (Ordered unit))] to Right-Click (Target unit of issued order)
Trigger - Turn on (This trigger)
Move Squad Point
Events
Unit - A unit Is issued an order targeting a point
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Issued order) Equal to (Order(smart))
Then - Actions
Trigger - Turn off (This trigger)
Unit Group - Order Squad[(Custom value of (Ordered unit))] to Right-Click (Target point of issued order)
Trigger - Turn on (This trigger)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Issued order) Equal to (Order(attack))
Then - Actions
Trigger - Turn off (This trigger)
Unit Group - Order Squad[(Custom value of (Ordered unit))] to Attack-Move To (Target point of issued order)
Trigger - Turn on (This trigger)
Else - Actions
Death
Events
Unit - A unit Dies
Conditions
((Triggering unit) is Summoned) Equal to True
Actions
Set Num = (Custom value of (Dying unit))
Unit Group - Remove (Dying unit) from Squad[Num]
Unit - Set life of Squad_Leader[Num] to (((Real((Number of units in Squad[Num]))) / (Real(SquadSize))) x 100.00)%
Selection
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit
Player - Player 7 (Green) Selects a unit
Player - Player 8 (Pink) Selects a unit
Player - Player 9 (Gray) Selects a unit
Player - Player 10 (Light Blue) Selects a unit
Player - Player 11 (Dark Green) Selects a unit
Player - Player 12 (Brown) Selects a unit
Conditions
Actions
Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is Summoned) Equal to True
Then - Actions
Selection - Remove (Picked unit) from selection for (Triggering player)
Selection - Add Squad_Leader[(Custom value of (Picked unit))] to selection for (Triggering player)
Else - Actions