Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
function CountLivingPlayerUnitsOfTypeId takes integer unitId, player whichPlayer returns integer
local group g
local integer matchedCount
set g = CreateGroup()
set bj_livingPlayerUnitsTypeId = unitId
call GroupEnumUnitsOfPlayer(g, whichPlayer, filterLivingPlayerUnitsOfTypeId)
set matchedCount = CountUnitsInGroup(g)
call DestroyGroup(g)
return matchedCount
endfunction
Trigger
Events

Time - Every 2.00 seconds of gameplay
Conditions
Actions

Player Group - Pick every player in (All Players) an do (Actions):


Loop - Actions


Set gold_mine_number = (Number of living ABandoned Gold Mine units owned by (Picked Player))


Player - Add gold_mine_number to (Picked Player).
Sheep Spawn player 1

Events


Time - Every 30.00 seconds of game time

Conditions

Actions


Set number = ((Current research level of More Sheep for Player 1 (Red)) + 3)


Set temp_point = (Center of Region 000 <gen>)


Unit - Create number Dummy for Player 1 (Red) at temp_point facing Default building facing degrees


Unit Group - Pick every unit in (Units in Region 000 <gen>) and do (Actions)



Loop - Actions




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





If - Conditions






(Unit-type of (Picked unit)) Equal to Dummy





Then - Actions






Unit - Remove (Picked unit) from the game






Set temp_point = (Random point in Region 000 <gen>)






Destructible - Create a Sheep (Tree) at temp_point facing (Random angle) with scale 1.50 and variation 0





Else - Actions






Do nothing


Custom script: call RemoveLocation (udg_temp_point)
Sheep Spawn player 1

Events


Time - Every 30.00 seconds of game time

Conditions

Actions


For each integer A from 1 to *YourPlayerNumber* do (Actions):



Loop - Actions




Set number = ((Current research level of More Sheep for Player(Integer A)) + 3)




Set temp_point = (Random Point in Region[Integer A])




For each integer B from 1 to number do (Actions):





Loop - Actions





Destructible - Create a Sheep (Tree) at temp_point facing (Random angle) with scale 1.50 and variation 0




Custom script: call RemoveLocation (udg_temp_point)
Sheep Spawn player 1

Events


Time - Every 30.00 seconds of game time

Conditions

Actions


For each integer A from 1 to *YourPlayerNumber* do (Actions):



Loop - Actions



Set number = ((Current research level of More Sheep for Player(Integer A)) + 3)



Set temp_point = (Random Point in Region[Integer A])



For each integer B from 1 to number do (Actions):




Loop - Actions




Destructible - Create a Sheep (Tree) at temp_point facing (Random angle) with scale 1.50 and variation 0



Custom script: call RemoveLocation (udg_temp_point)
Sheep Spawn player 1

Events


Time - Every 30.00 seconds of game time

Conditions

Actions


Set number = ((Current research level of More Sheep for Player(1) + 3)


Set temp_point = (Random Point in Region[1])


For each integer B from 1 to number do (Actions):



Loop - Actions



Destructible - Create a Sheep (Tree) at temp_point facing (Random angle) with scale 1.50 and variation 0


Custom script: call RemoveLocation (udg_temp_point)
set bj_wantDestroyGroup = true
Gold Tick

Events


Time - Every 2.00 seconds of game time

Conditions

Actions


Player Group - Pick every player in player_group and do (Actions)



Loop - Actions




Set gold_mine_number = (Number of living Abandoned Gold Mine units owned by (Picked player))




Player - Add gold_mine_number to (Picked player) Current gold
Melee Initialization

Events


Map initialization

Conditions

Actions


Set player_group = (All players matching (((Matching player) controller) Equal to User))
Every 2 secs.
-> Set player_group = (All players matching (((Matching player) controller) Equal to User))
-> Pick every player in player_group and do:
-----> Loop: bla bla
-> call DestroyForce(udg_player_group)
Gold Tick

Events


Time - Every 2.00 seconds of game time

Conditions

Actions


Player Group - Pick every player in player_group and do (Actions)



Loop - Actions




Custom script: set bj_wantDestroyGroup = true




Set gold_mine_number = (Number of living Abandoned Gold Mine units owned by (Picked player))




Player - Add gold_mine_number to (Picked player) Current gold
