On my map, a madness map, i wanna cap a certain unit. So for example, When i move my civilian to a beacon showing a scout, i want the spawner to stop spawning scouts when the player owns 48 scouts. At first, I cleared a switch. Then I cleared the switch once again when the player owned 47 scouts and preserved it. When the player has 48 scouts the switch with set itself and the trigger is preserved. I thought this would stop the units from spawning at 48, but if any units died so the player owns less than 48, the player could once again make the scout. However, that didn't do anything at all. So yeah I am stupid and pray you people will lift this ignorance from me.
Thx
No need to do any of that, just do this
QUOTE
Players
- Humans
Conditions
- Current Player Brings at least one civ to Spawn Scout
- Current Player commands at most 47 scouts
Actions
- Create 1 Scout at Scout Spawn
- Preserve Trigger.
voila
I think you are trying to stop "unit unplacebale" stuff? If you are simply trying to do that, folow this solution that doesnt limit the number of units. If there is another reason they can only have 48 scouts, then go wiht Vindexues' method.
My Method:
Create a "spawn" location for the units.
CONDITIONS:
-current player brings 1 civ to 'scout'
-current player brings at most 0 men to 'spawn'
ACTIONS:
-create 1 scout for current player at 'spawn'
-wait for 800 milliseconds
-preserve trigger
CONDITIONS:
-player x commands at least 1 men at 'spawn'
ACTIONS:
-move all men for player x at 'spawn' to 'player x unit create'
-preserve trigger
That way if you reach a unit unplaceable situation, one unit will back up at "spawn" and more units at spawn will not be made. More professional solution if that is what you are trying to do.
QUOTE
Players
- Humans
Conditions
- Bring at least one civ to Spawn Scout
- Command at most 47 Scouts
- Bring exactly 0 men to Spawn Resevoir
Actions
- Create 1 Scout at Spawn Resevoir
- Move all scout for Current Player at Spawn Resevoir to Spawn
- Preserve Trigger
QUOTE
Players
- Humans
Conditions
- Always
Actions
- Move all men at Spawn Resevoir to Spawn
- Preserve Trigger
Just thought I'd post it as both methods.
Yes, yes but my point was that this way he could not cap the unit but avoid unit unplacable (not sure if thats what he wnts, but its better for that specific solution)
Thanks. You guys answered my question.