Scenario Stealth System!

Article written by CarolKarine
Published on 03-06-2013; updated on 08-17-2014
Tags:

I’m here to explain how you can create a Stealth System by using the guard’s LOS (Line of Sight) (their search radius, effectively)

what you’ll need:
1. A unit that serves as your guard with a search radius/LoS of 4*
2. A modified .dat file that changes the OLD_EXPLORER LoS to 5*
3. A modified .dat file that adds a “Spy” unit which has no LoS.**

* these can be anything you want. just make sure that the OLD_EXPLORER LoS is one more than the guard’s LoS.
** AoFE, the unofficial expansion for AoK:TC (it’s free) has both of the .dat file changes I pointed out as necessary here. IF you are making a modded .dat file, keep in mind that AoFE has a limit on the number of units (it’s capped at 900) and it cannot go over without the AI behaving erratically. Changing units is perfectly acceptable. (I suggest changing the hero units that aren’t used in campaigns.)

PATROLLING GUARDS

Setup:
1. The player controls the spy unit (this is the unit with no LoS)
2. wherever it can walk, make sure you reveal that area with creating and removing player 1 map revealers. (of course, you can also use the add blackness trick with cartography and stuff to put the blackness back if you wish)
3. Guards have patrol triggers, and when you get within a certain area of their patrol, (bring object to area or objects in area) it creates an OLD_EXPLORER.
4. This OLD_EXPLORER is then tasked to the guard in a continuous loop.
Make sure to pre-place the OLD_EXPLORERS if you are using more than one guard, and to select them specifically in the looping trigger, lest you accidentally task all of them to one guard.
5. When the guard has you as it’s target, maybe have an alarm ready to go off.

TRIGGER SETUP:

   trigger 1
condition: object in area - area around the guard's patrol area
effect: create object/change ownership* - OLD_EXPLORER (P1)
effect: activate trigger - trigger 2
starting state on

   trigger 2
condition: timer - 0
effect: task object - OLD_EXPLORER to Guard**
looping, starting state off

   trigger 3
condition: object has target - Guard to Spy unit
effect: activate trigger - trigger 4
starting state on

   trigger 4
condition: timer - 4 or 5 or somesuch.
effect: task object - all guards to Spy unit
effect: display instructions - "ENEMIES IN THE CAMP" (or somesuch)
starting state off

*Note that if there are multiple guards, there must be multiple OLD_EXPLORERs, because if you set up the triggers as such:

condition: object in area - area around guard 1's patrol area
effect: task object - OLD_EXPLORER to guard 1

ALL of the OLD_EXPLORERs (the ones you use for other guards) will be tasked to guard 1. This means that you must specify which OLD_EXPLORER you want for each guard (I use trigger studio to do this. I’m not sure if there’s another way)

**note again that the OLD_EXPLORER needs to be pre-placed in the editor, so as to allow you to select one specific OLD_EXPLORER using trigger studio. this is to keep you from tasking all of the OLD_EXPLORERs to one guard.

STANDING GUARDS

These have the same setup as those above, except they must start as a player which is your ally (and you are neutral towards) This way you can attack them and so on, but they won’t attack you.

So, now you have them facing a certain way. Remember the area that is in front of them (the area they seem to be looking at) When your Spy unit enters this area, change their ownership to the enemy. This means they will now attack you. This is used to allow you to backstab guards.

   trigger 1
condition: object in area - Spy unit in front of guard
effect: change ownership - guard changes from ally player to enemy player.
starting state on

change diplomacy would also work in place of change ownership, but remember – all patrolling enemies need to ALWAYS be an enemy player. So if you have both standing and patrolling guards, you need to use two players.

HOW TO MAKE BACKSTABS POSSIBLE

So in order to backstab the enemy, either an “objects in area” a “bring object to area” or a “bring object to object” trigger is necessary. The way it works:

   trigger 1
condition: (any of the three listed above) - set it up in a way where the Spy unit must be behind the standing guard.
effect: change attack - change the Spy unit's attack to something more than the guard's health.
effect: activate trigger - trigger 2
starting state on

   trigger 2
condition: timer - 4/5
effect: change attack - change the Spy unit's attack back to normal
starting state off

(this requires a negative sign. either just type it in if you are using AoFE or the user patch, or copy paste (ctrl+c/ctrl+v) it in using the standard version of the game.)

REGARDING THE DEATH OF GUARDS

make sure you have a trigger when if the guard dies their OLD_EXPLORER is removed as well. you must select their OLD_EXPLORER specifically, lest the trigger remove all the OLD _EXPLORERs.

I hope this helped! Make sure that all enemy units or buildings you want attackable are in LOS of something, because otherwise your 0 LoS Spy unit will be unable to see or attack it.


Do you want to comment on this article? Thank the author? Tribute resources for its improvement? Raze it to the ground?

Come by and visit its thread in the University Forum!