• 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.

Problem with zones

Status
Not open for further replies.
Level 1
Joined
Jan 15, 2013
Messages
61
Hi guys,
I'm making a tag map where everybody has to take control of one zone and build and defend against creatures. So i have a problem i cant solve. How to make that when you for example enter a zone and take control of the circle of power nobody cant build in this zone beside you, only if you give permission. I tried for every zone to make their own triggers and it took for every zone 2 triggers. Imagine if i have 20 zones i need to make a lot of triggers. So is a possibility to make it in 1-2 triggers?
Thx in advance)
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
If you take control of the circle of power (as in it also changes its team to yours) then you can check an order, or leave it as an event when unit begins constructing a building.
When one or the other fires, check, if the owner of the new building (or owner of issued unit) equals to the one who holds the circle. If not, issue that unit to stop.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
  • Events
    • Unit - A Unit entered Circle of power region
  • Actions
    • Set PlayerControllerOfCircleOfPower[Player Number of (Owner of (Triggering Unit))] = Owner of Triggering Unit
  • Events
    • Unit - A Unit is ordered to build a construction
  • Conditions
  • Actions
    • If/Then/Else All/And conditions are true - DO multiple actions
      • Conditions
        • ((Owner of (Triggering Unit)) is an ally of PlayerControllerOfCircleOfPower[Player Number of (Owner of (Triggering Unit))] ) Equal to True
      • Then - Actions
        • YOUR DIALOG OR WHATEVER :3 to take Permission
      • Else - Actions
        • Unit - Order (Triggering Unit) to Stop
 
Level 1
Joined
Jan 15, 2013
Messages
61
My triggers are in russian))

I will try to explain with words
So every zone has 2 regions. 1 is all the zone and the 2 is the circle of power, a unit made like a circle when you enter it it changes owner.

So the first trigger goes like this
-A unit enters circle of power(region)
-owner of unit is not player 12 ( the creeps)
-change owner of the circle of power(unit)
turn off this trigger

The second trigger:
-A unit starts constructing
-
-Set Unit=Constructing Structure
Set Unit2= Circle of Power(Unit)
Set group= Units within 512 of position of Unit2
Pick every unit in group and do actions
- If owner of unit is owner of unit2 equals to no
- kill Unit

Something like that. And for every zone i make this 2 triggers
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
  • Events
    • Unit - A Unit is ordered to build a construction
  • Conditions
  • Actions
    • If/Then/Else All/And conditions are true - DO multiple actions
      • Conditions
        • ((Owner of (Triggering Unit)) is an ally of PlayerControllerOfCircleOfPower[Player Number of (Owner of (Triggering Unit))] ) Equal to True
      • Then - Actions
        • YOUR DIALOG OR WHATEVER :3 to take Permission
      • Else - Actions
        • Unit - Order (Triggering Unit) to Stop
This won't work well, as this does not check anything besides if units are allies. This will result in enemies of the PlayerController... player to be unable to build units anywhere on the map.


I meant something along these lines:
  • Check
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set loc = (Position of (Constructing structure))
      • Set group = (Units within 2000.00 of loc matching (((Unit-type of (Matching unit)) Equal to Circle of Power (large)) and ((Owner of (Matching unit)) Not equal to (Triggering player))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (group is empty) Equal to False
        • Then - Actions
          • Unit - Remove (Triggering unit) from the game
        • Else - Actions
      • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call DestroyGroup(udg_group)
This checks if the construction is nearby any circle of power which is not owned by the player building this construction.
ATM I put there to just remove the building (= you also lose resources you put into building that structure).
I'm unsure if there is any order to cancel the building in the GUI, though I guess it should be in jass.

(loc is point variable, group is unit group variable)
 
Level 1
Joined
Jan 15, 2013
Messages
61
Thx ill try it) +rep

Edit: It works but if the unit takes control of a circle of power near my base( that is in limit of 2000) he can build on my base too

But if for example to make such thing like building a flag? If you build a flag you take control of the zone
 
Last edited:
Put all regions into variables, also with all CircleOfPower (circle [1] is in region [1],... and so on)

set point position of building being constructed
For each ineter i from 1 to AmountOfRegions do Actions:
If
-point is in region = true
-owner of circle =! owner of triggering unit
Then
- remove unit
Else
 
Last edited:
Status
Not open for further replies.
Top