----------------------------------------------------------------------
Understanding Quest Vars by Sluggs (24/09/05)
----------------------------------------------------------------------
Quest Vars, (Quest Variables), are our friends - You can do much more
with them than meets the eye! They sit there, waiting to be
discovered, waiting for someone to say, "Hey, i can make a game out of
this, damn, that's a game inside a game then!"

"So, what are their main uses?"

As you should already know, they take care of our "Objectives" in our
FM's. They can be put to another use too... Timers and Counters!
----------------------------------------------------------------------
"LET'S MAKE A TIMER"

I'm making an imaginary mission here, where the player must acquire a
certain item within a time limit - (Let's make that 3 minutes)

We shall require:

1) A FlickerTrigger
2) Two QuestVarTraps
3) A QuestVarTrigger

First, we'll make the quest. In the console, type:
quest_create_mis timer,180 (180 Seconds = 3 Minutes)

Create a "FlickerTrigger", open it's properties, add: Tweq/Flicker and
change the following:

AnimC = Sim (Uncheck SimLargeRad)
Rate  = 500 (1 Second Real-Time)
Click "OK"

Change FlickerState/AnimS to "On"

Next create a "QuestVarTrap" and add: Trap/Quest Var = -1:timer Also
add: Script/Trap Control Flags = "NoOff" then link the
"FlickerTrigger" to this via "Control Device"

Now create a "QuestVarTrigger" and add: Trap/Quest Var = 0:timer Once
you have done this, create another "QuestVarTrap" and add:
Trap/Quest Var = =3:goal_state_1 (3 = Failed) Also add:
Script/Trap Control Flags = "NoOff" Link the last "QuestVarTrigger" to
this via "Control Device"

We have now got an objective that fails if the timer reaches zero. If
the player acquires the item inside the time limit, we must break the
timer! The best way to do this is to destroy the FlickerTrigger when
the player picks up the item, i'll leave that part to you.
----------------------------------------------------------------------
"LET'S MAKE A COUNTER"

Let's say we want to have a limit on stealing loot, well why not?

Add to the loot item:

S/Scripts/TrigWorldFrob
Engine Features/FrobInfo/World Action = Move,Script
Check the amount of loot the item is worth:
DarkGameSys/Loot then cancel.

Create a "QuestVarTrap" and add: +x:loot_count (x)= amount loot is
worth then link the loot item to this via "Control Device"

Now create a "QuestVarTrigger" and add: Trap/Quest Var =
>800:loot_count (This will limit the total amount of loot you can
steal to 800. Anything above this will cause the trap to send an "On"
signal)

We will link this to another "QuestVarTrap" which will make our loot
limit objective fail...

Create another "QuestVarTrap" and add:

Trap/Quest Var =
=3:Goal_State_x (x)= objective number

0=incomplete
1=complete
2=inactive
3=failed *

Finally, add the quest data:

Choice #1 - In the console, type: quest_create_mis loot_count,0

Choice #2 - In Editors/Mission Quest Data:
Double-Click on an existing entry, (don't worry about the original
entry, this will not be altered)

Quest Data = loot_count
Value = 0

Checking the "loot_count"...

Create an "Odometer" (Physical/Gizmo/Gauge) and add:
Trap/Quest Var = loot_count

The Odometer will show you the current value of "loot_count" in 
Editors/Quest Data
----------------------------------------------------------------------
Useful info:

*O Denotes - Once only.
*R Denotes - Repeatable.

=x:string = This sets the specified variable to (x) *R

!x:string = This sets the specified variable to (x) *O Note: If you
need to use more than one "QuestVarTrap" to set different figures, use
=x instead, as this doesn't appear to work with high numbers.

+x:string = This increases the specified variable by (x) *R

-x:string = This decreases the specified variable by (x) *R

/x:string = This divides the specified variable by (x) *R

*x:string = This multiplies the specified variable by (x) *R

%x:string = Doesn't appear to work as it should!

"x:string = This changes the last number of the specified variable to
(x) If activated again, the third number of the variable will also be
the same as the last. This is best suited for door combo's only...

Example:

"7:door_combo will look like: 0007
Used again, it will look like: 0077
And again: 0777
And once more: 7777