• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trying to Make a 'Unit Spillover' Trigger

Status
Not open for further replies.
Level 21
Joined
Mar 16, 2008
Messages
955
It's a defense map and players A, B, C units sometimes get bugged by 100 unit cap. I tried adding more players to control the spawns and prevent any one of them hitting unit cap of 100 units but it seems in some rare cases they still hit 100 unit cap.

Trigger needs to transfer ownership of units from players A, B, C, ... to player Y.

Thinking maybe assign each one of the spawn unit-types a food cost of 1 then track if player A, B, or C, or ... exceeds cap and transfer to player X.

Wanted to see if anyone on here had a better idea before I went down that path tho.

:thumbs_up:
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
By the unit cap I assume you mean the pathfinding issue where units stutter and refuse to move. In that case, the unit limit can depend on different factors. I find a safe value to be a limit of 50-60 units at one time. Anyway, the solution is simple if you have a good amount of Player Slots available to use.

Setup Computer players that will share the spawned units:
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set Variable ComputerArray[1] = Player 20
    • Set Variable ComputerArray[2] = Player 21
    • Set Variable ComputerArray[3] = Player 22
Whenever you spawn an enemy unit get the next Computer player in line and create it for them:
  • Actions
    • Set Variable ComputerIndex = ComputerIndex + 1
    • If ComputerIndex Greater than 3 then Set Variable ComputerIndex = 0
    • Unit - Create 1 EnemyUnit for ComputerArray[ComputerIndex]...
ComputerIndex = Integer
ComputerArray = Player (array)

It helps to have a solid system for spawning units.
 
Last edited:
Status
Not open for further replies.
Top