Patrolling Units

From AgeofWiki

Ever wanted to make units patrol a certain area of the map? Ever wanted to make villagers wander aimlessly around town? Ever wanted to create groups of people that travel from town to town? Well here is a guide for you! There are many different ways to accomplish the above tasks, but I will only list a few.

1. Patrolling Units

Figure 1
Figure 1
Step 1: This is the simplest method in creating a patrolling unit. First, decide where you want the unit to start, than place a cinematic block there. Next, place another block where you want the unit to walk to. Select the next point, and place a block there. Continue to do this until you have the desired amount of points. Just for this example, I will be using 3 locations (fig 1). Before setting up the triggers, place the unit(s) that you want to move at any of the blocks. Next, make that unit into an army. That’s it for step 1, now we set up the triggers.

Step 2: For this trick, you only require as many triggers as you have locations, so the more locations, the more triggers. Here is the basic trigger setup:


TRIGGER 1
Name: Patrol_1
Active: Yes
Loop: No
Priory: med

Condition
Timer (optional, but suggested)
Seconds: 4 (can be whatever you want, I am just using 4 as an example)

Effects
Army Move to Unit
Army: The army that the unit is in (ex: patrol1)
Target Unit: The cinematic block at the next location
Trigger: Patrol_2 (this trigger will be fired after the army reaches the cinematic block)
Attack Move: On (this means that if the army is near an enemy unit, it will stop moving and attack that unit)
Run: Off (see below)
Run Speed: leave at 1.0 (1.0 is the normal speed, 2.0 is twice as fast. Leave it at 1.0 because if the unit is running, the attack move wont work)



TRIGGER 2
Name: Patrol_2
Active: No
Loop: No
Priory: med

Condition
Timer (optional, but suggested)
Seconds: 4 (can be whatever you want, I am just using 4 as an example)

Effects
Army Move to Unit
Army: The army that the unit is in (ex: patrol1)
Target Unit: The cinematic block at the next location
Trigger: Patrol_3 (this trigger will be fired after the army reaches the cinematic block)
Attack Move: On (this means that if the army is near an enemy unit, it will stop moving and attack that unit)
Run: Off (see below)
Run Speed: leave at 1.0 (1.0 is the normal speed, 2.0 is twice as fast. Leave it at 1.0 because if the unit is running, the attack move won’t work)



TRIGGER 3
Name: Patrol_3
Active: No
Loop: No
Priory: med

Condition
Timer (optional, but suggested)
Seconds: 4 (can be whatever you want, I am just using 4 as an example)

Effects
Army Move to Unit
Army: The army that the unit is in (ex: patrol1)
Target Unit: The cinematic block at the next location
Trigger: Patrol_1 (this trigger will be fired after the army reaches the cinematic block)
Attack Move: On (this means that if the army is near an enemy unit, it will stop moving and attack that unit)
Run: Off (see below)
Run Speed: leave at 1.0 (1.0 is the normal speed, 2.0 is twice as fast. Leave it at 1.0 because if the unit is running, the attack move won’t work)



2. Wondering Citizens

Ever wanted to have citizens wander aimlessly around your town? This adds a very nice effect to your scenarios; it makes your maps feel more realistic. This one is a little bit more complex that the first trick, it requires using some Quest Variables to add the randomization effect.

Figure 2
Figure 2

Step 1: You start this off the same way as the first trick, you place some cinematic blocks. Place them all over the place, everywhere you want your unit to go (fig 2). But keep in mind; the more blocks, the more triggers. Once you have placed all your blocks, you must next place you unit(s) and make them into an army. After you are done with this, you are ready to start triggering.

Step 2: As mentioned above, the triggering in this is a little big more complex. I suggest reading the Quest Var Guide before continuing because we will be using variables. Now that you understand how variables work, it is time to start triggering.


TRIGGER 1
Name: Move_Ran
Active: Yes
Loop: No
Priory: med/high

Condition
Timer (optional, but suggested)
Seconds: 2 (can be whatever you want, I am just using 2 as an example)

Effects
Quest Var Randomize
Var name: The name of the variable you want to use. For this example, lets use ptrl (patrol abbreviated)
Min value: 1 (this is the lowest value that it could be, always use “1” or “0”)
Max value: 6 (this is the highest value that it could be, I only have 6 points, so I am using 6)
Rounding: ON



TRIGGER 2
Name: Move_1
Active: Yes
Loop: Yes
Priory: med/high

Condition
Quest Var Check
Var name: Same name as used above (ptrl)
Operator: == (this means that it needs to be the same as the number stated below) Value: 1 (so when the first trigger is activated, and the variable at randomized, if it equals 1, than this trigger is fired)
Effects
Army Move to Unit
Army: The army that the unit is in (ex: patrol1)
Target Unit: The cinematic block at one of the locations
Trigger: Move_Ran (this trigger will be fired after the army reaches the cinematic block. Therefore, once the unit reaches the location, the variable will be randomized so the unit can move again.)
Attack Move: Off (Your choice, I want it to be off) (this means that if the army is near an enemy unit, it will stop moving and attack that unit)
Run: Off (I don’t want the unit to run)
Run Speed: 1.0 (1.0 is the normal speed, 2.0 is twice as fast. Remember, if the unit is running, the attack move won’t work)



TRIGGER 3
Name: Move_2
Active: Yes
Loop: Yes
Priory: med/high

Condition
Quest Var Check
Var name: Same name as used above (ptrl)
Operator: == (this means that it needs to be the same as the number stated below) Value: 2 (so when the first trigger is activated, and the variable at randomized, if it equals 2, than this trigger is fired)
Effects
Army Move to Unit
Army: The army that the unit is in (ex: patrol1)
Target Unit: The cinematic block at one of the locations, use a different one that used above
Trigger: Move_Ran (this trigger will be fired after the army reaches the cinematic block. Therefore, once the unit reaches the location, the variable will be randomized so the unit can move again.)
Attack Move: Off (Your choice, I want it to be off) (this means that if the army is near an enemy unit, it will stop moving and attack that unit)
Run: Off (I don’t want the unit to run)
Run Speed: 1.0 (1.0 is the normal speed, 2.0 is twice as fast. Remember, if the unit is running, the attack move won’t work)



You than continue to make those triggers for each number, and using a different cinematic block each time.