Greetings, I'm creating a mechanic for event where I have citizens of player coming to his base. To sum it up I need those villagers to be uncontrollable, but people should be able to target them and kill them.
As such I use following triggers:
This is the trigger I'm using to prevent people from ordering any commands for the villagers:
Do you have any ideas where are the mistakes or how to fix the problem?
Thanks in advance for the help
As such I use following triggers:
-
Citizens Route Spawn1
-
Events
- Unit - A unit enters Dresh Citizen Spot 1 <gen>
-
Conditions
- (Owner of (Triggering unit)) Equal to Player 6 (Orange)
-
Or - Any (Conditions) are true
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Child [Dresh Citizen]
- (Unit-type of (Triggering unit)) Equal to Pack Horse [Dresh Citizen]
- (Unit-type of (Triggering unit)) Equal to Villager [Dresh Citizen Female]
- (Unit-type of (Triggering unit)) Equal to Villager [Dresh Citizen Male1]
- (Unit-type of (Triggering unit)) Equal to Villager [Dresh Citizen Male2]
-
Conditions
-
Actions
- Set TempLoc = (Center of Citizen Route4 <gen>)
- Set TempUnit = (Triggering unit)
- Custom script: set udg_TempHandle = udg_TempUnit
- Hashtable - Save Handle OfTempLoc as 0 of (Key TempHandle) in CitizenOrders
- Unit - Set the custom value of (Triggering unit) to 1
- Unit - Order (Triggering unit) to Move To TempLoc
- Unit - Set the custom value of (Triggering unit) to 0
- Custom script: call RemoveLocation (udg_TempLoc)
-
Events
This is the trigger I'm using to prevent people from ordering any commands for the villagers:
-
Citizen orders
-
Events
- Unit - A unit Is issued an order targeting an object
- Unit - A unit Is issued an order targeting a point
- Unit - A unit Is issued an order with no target
-
Conditions
- (Custom value of (Triggering unit)) Equal to 0
-
Or - Any (Conditions) are true
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Child [Dresh Citizen]
- (Unit-type of (Triggering unit)) Equal to Pack Horse [Dresh Citizen]
- (Unit-type of (Triggering unit)) Equal to Villager [Dresh Citizen Female]
- (Unit-type of (Triggering unit)) Equal to Villager [Dresh Citizen Male1]
- (Unit-type of (Triggering unit)) Equal to Villager [Dresh Citizen Male2]
-
Conditions
-
Actions
- Unit - Set the custom value of (Triggering unit) to 1
- Set TempUnit = (Triggering unit)
- Custom script: set udg_TempHandle = udg_TempUnit
- Set TempLoc = (Load 0 of (Key TempHandle) in CitizenOrders)
- Unit - Order (Triggering unit) to Move To TempLoc
- Custom script: call RemoveLocation (udg_TempLoc)
- Unit - Set the custom value of (Triggering unit) to 0
-
Events
Do you have any ideas where are the mistakes or how to fix the problem?
Thanks in advance for the help