Ghosting
Works best with GayleSaver's custom scripts.

In this tutorial, I will describe how to set up a simple Ghosting objective.

In case you don't know, 'Ghosting' is a style of playing Thief in which you must complete all of your objectives without anyone knowing you were there in the first place.
What this means is that the player is not allowed to alert any of the AIs in the mission, including watchers. Minor (level one) alerts, such as "Is someone there?" are okay, but ghosting has failed if any AI reaches level two or higher, such as "Alright, I hear you. Come out in the open at once!".
Knocking out, injurring or killing an AI also fails your ghosting attempt.
Basically, if the AI is unsure, then it's okay, but if the AI is certain someone is there, then ghosting has failed.

Okay, now on to the tutorial!
First of all, make sure you have script.osm loaded.
Now, create a Button (-448) named 'TrigGhostFail' and a RelayTrap (-1704) named 'GhostFail'.
Add a ControlDevice link from the Button to the RelayTrap.
This RelayTrap will be triggered when ghosting fails, either via the Button or directly.

Open the object heirarchy and create a new metaproperty named M-GhostableAI.
Add the following AI->Responses->Alert Response:

Alert Level   (2) Moderate
Priority   Absolute
Response: Step 1   Frob Object
Argument 1   TrigGhostFail

Set up the same mini-conversation in AI->Responses->Body Response and >AI->Responses->Sense Combat Response

You also need to give M-GhostableAI the AI->Utility->Watch: Watch link defaults property, and set it up as follows:

Watch Kind   Self entry
Priority   Very High
Trigger: Radius   5
Heigh   5
Required Awareness   (0) None
Line Requirement   None
Minimum Alertness   (2) Moderate
Maximum Alertness   (3) High
Exit: Link Kill Option   After Completion
Kill Like Links   False
No Test Once Triggered  

True

Reuse Delay   0
Reset Delay   0
Response: Step 1   Frob Object
Argument 1   TrigGhostFail

If that huge dialogue box doesn't fit on your screen, you should be able to get away with just typing in the first letter of what should go in each box and then hit the tab key, until you can see what you're doing.
(Press exactly these keys: S; Tab; V; V; Tab; 5; Tab; 5; Tab; Tab; Tab; Down Arrow; Down Arrow; Tab; Page Down; Tab; Page Down; Tab; Tab; Space)

Next, add some Act/React Receptrons:

Stimulus Min Max Effect Target Object
WeaponStim 0 No Max Frob Object

TrigGhostFail

FireStim No Min No Max Frob Object

TrigGhostFail

HolyStim No Min 0 Frob Object

TrigGhostFail

Knockout 0 No Max Frob Object

TrigGhostFail

KOGas 0 No Max Frob Object

TrigGhostFail

MagicZapStim 0 No Max Frob Object

TrigGhostFail

ToxicStim 0 No Max Frob Object

TrigGhostFail

I'm sure you get the idea. If you add any new stims that you think should fail the ghosting objective, add a receptrons for those, too.
You should also add this receptron to the Banner (-150) archetype, as Ghosts don't slash banners:

Stimulus Min Max Effect Target Object
SlashStim 0 No Max Frob Object

TrigGhostFail

(The problem with this is that you need to move the original Damage Object receptron so that it only happens after the Frob Object one is triggered. To do that, select it and then hit the 'Add' button. Leave everything as it is and press 'OK'. There should now be two Damage Object receptrons, one on top of and one below Frob Object. If there isn't one below, repeat the procedure until there is. Now, delete all but the bottommost Damage Object receptron.)

Next, put M-GhostableAI on any archetypes that should make ghosting fail. In most cases, that means adding the metaproperty to Creature (-8).
An additional note; the GetsKOGassed metaproperty, which both Animal and Beast have, has an Abort receptron for KOGas, so if you put M-GhostableAI on Creature, then the KOGas receptron will never trigger for any Animals or Beasts. Either remove the KOGas Abort receptron from GetsKOGassed or add the M-GhostableAI metaproperty to each of Creature's children archetypes instead.

Now, you also need to add AIWatchObj from every Ghostable AI in the mission to itself. A daunting proccess if you want to do it manually, but there is another way:

Create two markers (-36) and an Up/Down Switch (-464). Name one marker 'Conv' and the other 'StartConv'. The first marker is going to become an AI, so give it an AI>AI Core>AI of Default and give it the M-NeverEfficient metaproperty (Found under AI Behaviours->AI_B_Gen).

The second marker needs to act as a conversation, so add S>Scripts and set Script 0 to 'TrapConverse', then add AI->Conversations->Conversation and enter the following data into the '00' section:

Actor:   ActorOne
Action 1:   Add Link
Argument 1:   AIWatchObj
Argument 2:   @M-GhostableAI
Argument 3:   @M-GhostableAI

Create ControlDevice link from the Up/Down Switch to StartConv, and an AIConversationActor link, with a data of 1, from StartConv to Conv.

Finally, add Tweq->JointsState to the Up/Down Switch and set both AnimC and Joint1AnimC to On.
You can hide the two switches, in a blue room. As general good practice, add the Schema>Class Tags property and delete anything you find there, so that the switches are not making noises that no one can hear while hiding in their blue room.

The only thing left to do now is to decide what should happen the player fails his/her ghosting attempt.
In most (but not all) cases, ghosting should be an optional objective, so the next thing to do is to create one of those. For this tutorial, I will use Goal 0, but you can obviously use any goal you like.
Type the following items into DromEd's console:

Console command to enter
quest_create_mis goal_visible_0, 1
quest_create_mis goal_optional_0, 1
quest_create_mis goal_state_0, 0

Next, create a GoldPlaque (-2926) and add the TrapStim script. Add Editor->Design Note, and set it up as follows:

stim="EarthStim";intensity=-905.00

Give the GoldPlaque the following Act/React Receptrons:

Stimulus Min Max Effect Target Variable Operation Operand
EarthStim -905.05 -904.95 Set Quest Variable   goal_state_0 Set To

2

EarthStim -905.05 -904.95 Frob Object [Me]    

 

Give 'GhostFail' the 'TrapSetQVar' and a Trap->Quest Var property of:

=2:goal_state_0

This will cause the objective you created to be marked as 'cancelled' when the RelayTrap is triggered. (TrapStim only seems to work half the time...)

Create two ControlDevice links; one from 'GhostFail' to the GoldPlaque, and the other both to and from the GoldPlaque.

If you don't want to use GayleSaver's custom scripts for some reason, you could create a more roundabout method to trigger the receptrons, with a little effort.

You still need to add the Book->Text property to the GoldPlaque - just a short message informing the player that his ghosting has failed should do the trick.

You might also want to create a VOTrap (-4862), create a ControlDevice link to it from the RelayTrap, and then give it a SoundDescription link to an appropriate Garrett schema, such as Gar9909, Gar9908, or Gar1103.

You should now have a fully function ghosting objective, which fails when the player alerts someone, and also lets the player know that it has failed.

 

== New Ghosting Tutorial - gamesys ONLY ==

Copy the Ghosting.sch file to your schemas folder and type reload_schemas into DromEd's console.

Add a new Act/React Stim, 'GhostingStim'. Save the gamesys, the mission, and then reload.

Create two new metaproperties, M-GhostableAI and M-GhostingFailed. We'll get back to them later.

Create a new archetype under VOTrap (-4862) and name it 'GhostingFailedVO'.
Give this new archetype the Tweq->Delete property, set AnimC to Sim and Rate to 2500.
Also add Tweq->DeleteState and set the AnimS to On.

Create a new Genie named 'G-EnableGhostMode', and set up its AI->Responses->Alert Response as follows:

Alert Level   (3) Low
Priority   Very High
Response: Step 1   Wait
Argument 1   500
Argument 2    
Argument 3    
Response: Step 2   Add Link
Argument 1   AIWatchObj
Argument 2   @M-GhostableAI
Argument 3   @M-GhostableAI

Now, create a new Genie archetype under EnableGhostMode, and name it 'GhostingFailedText'.
Give it the StdBook and StdButton scripts, and a Frob Info with the World Action set to Script.
Add Book->Text and put in an appropriate filename (for example, 'GhostingFailed').

Add AI->Responses->Alert Response, and change the inherited values to those given below:

Alert Level   (3) Low
Priority   Very High
Response: Step 1   Wait
Argument 1   200
Argument 2    
Argument 3    
Response: Step 2   Add Link
Argument 1   ControlDevice
Argument 2   @GhostingFailedVO
Argument 3   @GhostingFailedText
Response: Step 3   Add Link
Argument 1   SoundDescription
Argument 2   GarGhostingFail
Argument 3   @GhostingFailedVO

Now, add an Act/React Source:

Stimulus Propagator Intensity Radius Flags Dispersion Flags Period Max Firings Intensity Slope
GhostingStim Radius -2111 1 [None] None [None] 750 2 -1.00

And some Act/React Receptrons:

Stimulus Min Max Effect Target Object Agent Object
GhostingStim -2111.05 -2110.95 Create Object GhostingFailedVO [Me]
GhostingStim -2112.05 -2111.95 Frob Object [Me]  

Now, let's move back to the M-GhostingFailed metaproperty we created earlier.
It also needs one Act/React Source:

Stimulus Propagator Intensity Radius Flags Dispersion Flags Period Max Firings Intensity Slope
GhostingStim Radius -2101 1 [None] None [None] 5000 1 0

And two Act/React Receptrons:

Stimulus Min Max Effect Target Object Agent Object
GhostingStim -4111.05 -4110.95 Abort    

And now, the most important part, the M-GhostableAI metaproperty. It also needs quite a lot of Act/React Receptrons:

Stimulus Min Max Effect Target Object Agent Object Effect Stimulus Mult By Then Add
GhostingStim -2101.05 -2100.95 Create Object GhostingFailedText [Me]      
WeaponStim 0 No Max Stimulate Object

[Me]

[Me] GhostingStim 0.00 -4111.00
FireStim No Min No Max Create Object GhostingFailedText [Me]      
ToxicStim 0 No Max Stimulate Object

[Me]

[Me] GhostingStim 0.00 -4111.00
MagicZapStim 0 No Max Stimulate Object

[Me]

[Me] GhostingStim 0.00 -4111.00
HolyStim No Min 0 Stimulate Object

[Me]

[Me] GhostingStim 0.00 -4111.00
Knockout 0 No Max Stimulate Object

[Me]

[Me] GhostingStim 0.00 -4111.00
KOGas 0 No Max Stimulate Object

[Me]

[Me] GhostingStim 0.00 -4111.00

The M-HuntedFlee metarproperty (found under AI_Behaviors->AI_B_Gen) also needs a receptron (This is for Brother Cavador in 'Kidnap' only):

Stimulus Min Max Effect Target Object Agent Object
GhostingStim -2101.05 -2100.95 Abort    

Finally, add the AI->Utility->Watch: Watch link defaults property, and set it up as follows:

Watch Kind   Self entry
Priority   Very High
Trigger: Radius   5
Heigh   5
Required Awareness   (0) None
Line Requirement   None
Minimum Alertness   (2) Moderate
Maximum Alertness   (3) High
Exit: Link Kill Option   After Completion
Kill Like Links   False
No Test Once Triggered  

True

Reuse Delay   0
Reset Delay   0
Response: Step 1   Add/Remove Metaproperty
Argument 1   Add
Argument 2   M-GhostingFailed

Now, there is only one more thing to do. Find the Garrett (-2099) archetype and add one Source...

Stimulus Propagator Intensity Radius Flags Dispersion Flags Period Max Firings Intensity Slope
GhostingStim Radius -71 1 [None] None [None] 5000 1 0

...and one receptron:

Stimulus Min Max Effect Target Object Agent Object
GhostingStim -2101.05 -2100.95 Create Object EnableGhostMode [Me]

Of course, the whole system doesn't do anything unless you also add the M-GhostableAI metaproperty to some archetypes, namely Undead (-1319), Beast (-1327), CombatBot (-5388), WorkerBot (-5383), SpiderBot (-3240), Human (-14), and possibly Spider (-2103). Do not add it to Robot (-1783) or Cameras (-3363), as security cameras and turrets can sometimes be destroyed with one hit, and therefore the Stimulate Object receptron could cause problems. Anyway, EyeballPlant (-5698) inherits from Cameras!
All done!