I'm trying to check if there is a unit in a region, but what I have isn't working for some reason.
Here is what I have right now:
General-If(Conditions)thendo(Actions)elsedo(Actions)If((Unit(AnyUnit))isinP1Nexus)=TrueThenUI-Display"There are units in P1 Nexus"for(Allplayers)toSubtitleareaElse
It never displays there is a unit in that region and there really is a unit in that region.
CreateStartingUnitsforactiveplayersEventsGame-MapinitializationLocalVariablesx=0<Integer>ConditionsActionsPlayerGroup-Pickeachplayerin(ActivePlayers)anddo(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(SpawnLocationvalueforplayer(x+1))==TopLeftThenVariable-SetPurchaseLocations[x] = P1 Units
Variable - Set NexusLocation[x] = P1Nexus
Variable - Set ProbesLocation[x] = P1Probes
Variable - Set AssimilatorLocation[x] = P1Assimilator
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (72, 72) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color (Color((Current player (x + 1) color))) and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Spawn Location value for player (x + 1)) == Top Right
Then
Variable - Set PurchaseLocations[x] = P2Units
Variable - Set NexusLocation[x] = P2Nexus
Variable - Set ProbesLocation[x] = P2Probes
Variable - Set AssimilatorLocation[x] = P2Assimilator
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (196, 72) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color (Color((Current player (x + 1) color))) and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Spawn Location value for player (x + 1)) == Top Middle
Then
Variable - Set PurchaseLocations[x] = P3Units
Variable - Set NexusLocation[x] = P3Nexus
Variable - Set ProbesLocation[x] = P3Probes
Variable - Set AssimilatorLocation[x] = P3Assimilator
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (134, 72) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color (Color((Current player (x + 1) color))) and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Spawn Location value for player (x + 1)) == Bottom Left
Then
Variable - Set PurchaseLocations[x] = P4Units
Variable - Set NexusLocation[x] = P4Nexus
Variable - Set ProbesLocation[x] = P4Probes
Variable - Set AssimilatorLocation[x] = P4Assimilator
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (72, 190) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color (Color((Current player (x + 1) color))) and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Spawn Location value for player (x + 1)) == Bottom Right
Then
Variable - Set PurchaseLocations[x] = P5Units
Variable - Set NexusLocation[x] = P5Nexus
Variable - Set ProbesLocation[x] = P5Probes
Variable - Set AssimilatorLocation[x] = P5Assimilator
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (196, 190) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color (Color((Current player (x + 1) color))) and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Spawn Location value for player (x + 1)) == Bottom Middle
Then
Variable - Set PurchaseLocations[x] = P6Units
Variable - Set NexusLocation[x] = P6Nexus
Variable - Set ProbesLocation[x] = P6Probes
Variable - Set AssimilatorLocation[x] = P6Assimilator
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (134, 190) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color (Color((Current player (x + 1) color))) and blend mode Normal
Else
Camera - Pan the camera for player (x + 1) to (Center of NexusLocation[x]) over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Unit - Create 1 Nexus for player (x + 1) at (Center of NexusLocation[x]) using default facing (No Options)
Unit Selection - Add (Last created unit) to control group 1 for player (x + 1)
Unit - Create 1 Assimilator for player (x + 1) at (Center of AssimilatorLocation[x]) using default facing (No Options)
Unit - Create 2 Probe for player (x + 1) at (Center of ProbesLocation[x]) using default facing (No Options)
Unit - Order workers in (Entire map) owned by player (x + 1) to gather nearby resources
Unit - Create 3 Drone for player (x + 1) at (Center of PurchaseLocations[x]) using default facing (No Options)
Player Group - Add player (x + 1) to VoteGroup
Variable - Modify ActivePlayers: + 1
Bank - Open bank "SettingsData" for player (x + 1)
Bank - Preload and synchronize bank "SettingsData" for player (x + 1)
Variable - Set BankSettings[x] = (Last opened bank)
Trigger - Run Setup Settings (Ignore Conditions, Wait until it finishes)
Variable - Modify x: + 1
General - Wait 5.0 Game Time seconds
General - If (Conditions) then do (Actions) else do (Actions)
If
((Unit(Any Item)) is in P1Nexus) != True
Then
UI - Display "There are no units in P1 Nexus" for (All players) to Subtitle area
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (72, 72) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color White and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
((Unit(Any Unit)) is in P2Nexus) != True
Then
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (196, 72) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color White and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
((Unit(Any Unit)) is in P3Nexus) != True
Then
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (134, 72) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color White and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
((Unit(Any Unit)) is in P4Nexus) != True
Then
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (72, 190) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color White and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
((Unit(Any Unit)) is in P5Nexus) != True
Then
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (196, 190) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color White and blend mode Normal
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
((Unit(Any Unit)) is in P6Nexus) != True
Then
Dialog - Create an image for dialog dlgTransport with the dimensions (35, 35) anchored to Top Left with an offset of (134, 190) setting the tooltip to "" using the image Assets\Textures\btn-ability-terran-snipe.dds as a Normal type with tiled set to False tint color White and blend mode Normal
Else
This is something that s fairly important and yet also quite unusual. ANY UNIT is NOT just saying "any unit in there region". Any unit is a very specific variable that (afaik) only works when you have a unit variable assigned to any unit. Count the number of units in a group instead.
If number of units in unit group (units in (your region)) > 0
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
I'm trying to check if there is a unit in a region, but what I have isn't working for some reason.
Here is what I have right now:
It never displays there is a unit in that region and there really is a unit in that region.
@Demon4231: Go
You don't got any event? add periodic event or remove condition and add event ''Unit enters region''.
@BloodClud: Go
In the same trigger it spawns the unit in that region, if a player chooses to spawn in that region. The event is "Map Initialization".
@Demon4231: Go
? can u copy the whole trigger please :D
@BloodClud: Go
@Demon4231: Go
Use this condition ''((Picked unit) is in Region) == True'' and add ''pick each unit'' action before it.
@BloodClud: Go
I couldn't get it to work the way you explained so I just made a variable that gets set to 1 if a player spawns in that location.
If you want to check whether a region contains any units, id recommend doing it like this:
@Mille25: Go
This is something that s fairly important and yet also quite unusual. ANY UNIT is NOT just saying "any unit in there region". Any unit is a very specific variable that (afaik) only works when you have a unit variable assigned to any unit. Count the number of units in a group instead.
If number of units in unit group (units in (your region)) > 0
you could try adding the check if somethings in the nexus to the conditions spot so it will check conditions before the events
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here