Hey i was trying to create a zombie map, but i got some issues i jsut cant get to work!
a wave of zombies is spawning
i want those zombies to attack some random player (1-6)
If you're spawning only one type of zombie..
And the player controls only one hero..
Create 20 Zombies at Region
Pick every unit in (Random 1 units from (Units in (Playable map area))) and do actions
Loop
Order (Last created unit group) to attack picked unit.
End Loop
Yeah continuing on with LearningCode, here is an example that I came up with:
Trigger:
Zombie Attack Player
Events
Time - Every 300.00 seconds of game time
Conditions
Actions
Set SpawnLoc = (Center of Zombieland <gen>)
Set ZombieGroup = (Units in Zombieland <gen> owned by Neutral Hostile)
Set Humans = (Units in (Playable map area) owned by Player 1 (Red))
Unit - Create 100 Flesh-Eating Zombies for Player 1 (Red) at SpawnLoc facing Default building facing (270.0) degrees
Unit Group - Pick every unit in ZombieGroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Attack (Random unit from Humans)
Custom script: call RemoveLocation(udg_SpawnLoc)
Custom script: call DestroyGroup(udg_ZombieGroup)
Custom script: call DestroyGroup(udg_Humans)
It spawns the zombies, sets them to their own group, and then orders them to attack a random unit for a specific player.
EDIT: You need to be more specific. We don't know if you want Zombies to Attack-Move to a region, attack a random unit, each zombie to attack something different, zombies to attack a player's base...we don't know. You can't attack a player. They are represented in the game by their units...
Assuming Player 12 is the "Computer" controlling the Zombies..
Try this:
Set UnitGroupPlayer = (Units in (Playable map area) matching (((Matching unit) belongs to an enemy of Player 12) Equal to True)
Order (Units owned by (Player 12)) to Attack (Random unit from (UnitGroupPlayer))
I'm on a page about incorrect corrections, and spent the better part of like two hours trying to get someone to understand that -5^2 = -25, not 25, and then that post had comments get reposted because that group is self sustaining, and that person was in turn trying to explain what I just explained to them. And I'm taking that as a victory
I will be AFK for a couple of days you guys hold down the fort while I am gone. I will be checking in on my phone but that will severly limit me. Be back saturday!
I just got to watch the video because even though I was there I was trying to work out tech problems with the chat since I was the social media guy so I was distracted but check it out guys the video is super fucking great!