- Joined
- Feb 20, 2013
- Messages
- 136
Hi, I've been dealing with this for a few hours now and I can't seem to understand why this is happening. I wanted to make a unit group travel to a certain point, and if any of them sees an enemy on the way, they all return to the base.
This sets them on their path, I've tried both Attack Move and Patrol:
Edit: posted first and second trigger
-
Town AI Initialization
-
Events
-
Time - Elapsed game time is 1.00 seconds
-
-
Conditions
-
Actions
-
-------- Setup potential scout destination points --------
-
Set SCOUT_DESTINATION[0] = (Position of Dummy 0035 <gen>)
-
Set SCOUT_DESTINATION[1] = (Position of Dummy 0039 <gen>)
-
Set SCOUT_DESTINATION[2] = (Position of Dummy 0036 <gen>)
-
Set SCOUT_DESTINATION[3] = (Position of Dummy 0033 <gen>)
-
Set SCOUT_DESTINATION[4] = (Position of Dummy 0038 <gen>)
-
Set SCOUT_DESTINATION[5] = (Position of Dummy 0037 <gen>)
-
-------- Setup potential scout destination points --------
-
Set SetupScoutActionsTrigger[0] = PatrolEncounterTL <gen>
-
Set SetupScoutActionsTrigger[1] = PatrolEncounterR <gen>
-
Set SetupScoutActionsTrigger[2] = PatrolEncounterB <gen>
-
-------- Setup Villagers and their homes --------
-
Trigger - Run StartOfDayActions <gen> (checking conditions)
-
-
-
StartOfDayActions
-
Events
-
Time - DayTimer expires
-
-
Conditions
-
Actions
-
-------- Loop through each of 3 towns --------
-
For each (Integer A) from 0 to (NUMBER_OF_CITIES - 1), do (Actions)
-
Loop - Actions
-
-------- This is used for the "Starting Phase", before demons are discovered --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DemonDiscoverSightings[(Integer A)] Equal to 0
-
-
Then - Actions
-
-------- If no demons were seen by scouts, or no warning messages came from other towns, keep sending one scout --------
-
-------- Create one scout, set it to a unit group array variable and start the "SetupOneScoutActions" timer --------
-
Set ScoutPatrolUnits[(Integer A)] = (Units owned by Player 12 (Brown) of type Scout)
-
Set ScoutRoutePoint[(Integer A)] = SCOUT_DESTINATION[(Random integer number between 0 and 5)]
-
Trigger - Add to SetupScoutActionsTrigger[(Integer A)] the event (Unit - Scout 0034 <gen> Acquires a target)
-
Countdown Timer - Start ScoutPatrolTimer[(Integer A)] as a One-shot timer that will expire in (Random real number between 0.00 and 10.00) seconds
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DemonDiscoverSightings[(Integer A)] Equal to 1
-
-
Then - Actions
-
-------- If demons were seen by scouts once, a single warning message came from other towns, send a small guard patrol (3 guards) --------
-
-------- Create 3 guards, set them to a unit group variable and run the "SetupGuardPatrolActions" trigger on the end of this trigger --------
-
-
Else - Actions
-
-------- Offense actions --------
-
-
-
-
-
-
-
Countdown Timer - Start DayTimer as a One-shot timer that will expire in 240.00 seconds
-
-
This sets them on their path, I've tried both Attack Move and Patrol:
-
SetupTownTLScoutActions
-
Events
-
Time - ScoutPatrolTimer[0] expires
-
-
Conditions
-
Actions
-
Game - Display to (All players) the text: Scout has departed!
-
Unit Group - Order ScoutPatrolUnits[0] to Patrol To ScoutRoutePoint[0]
-
-
-
PatrolEncounterTL
-
Events
-
Conditions
-
Actions
-
Floating Text - Create floating text that reads Demons! Run! at (Position of (Triggering unit)) with Z offset 50.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-
Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
-
Unit Group - Pick every unit in ScoutPatrolUnits[0] and do (Actions)
-
Loop - Actions
-
Unit - Order (Picked unit) to Move To (Position of Barracks 0014 <gen>)
-
-
-
-
-
command
-
Events
-
Player - Player 1 (Red) types a chat message containing -return as An exact match
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in ScoutPatrolUnits[0] and do (Actions)
-
Loop - Actions
-
Unit - Order (Picked unit) to Move To (Position of Barracks 0014 <gen>)
-
-
-
-
Edit: posted first and second trigger
Attachments
Last edited: