Trigger Analysis by JJ86 (8/11/04)


I am going to break down and analyze the triggers that are found in Mission 1 of the campaign so that mappers can get a good idea of how they work and are used. Brahmin Wood is the first game play in the game so there are a lot of campaign variable initializations. It is a standard assault mission where you have to free the village from raiders, kill Horus - the Raider leader and rescue some captured villagers. Outside of the captured village you will encounter the Elder Charon and the Shaman Hawkeye. There are several ways to approach the entire battle and some ways will give you a few different results. Here is the complete list of triggers used in the mission accompanied by notes by me in red italics.

Basically a trigger is a script where a "condition" has to be met before an "action" can happen. As long as the condition is true, everything in the action will follow. The order of the actions isn't too important because the speed with which they are happening is very fast. That is unless you place a blocking action to order one action before another. A lot of times you want to store information that happens at the start of the game so that you can present it later in the game. Then you use variables to store that information so it can be used to give a specific debriefing at the mission end.

before_first_tick
    Conditions:
            ALWAYS
    Actions:
            SET DEATH TEXT TO 'M01_FAILUREA' (From MIS_01_SPEECH.txt file in Locale/Missions/missions01/ folder)
            ADD OBJECTIVE M01_OBJ_01 (From MIS_01_SPEECH.txt file in Locale/Missions/missions01/ folder)
            B PLAY BINK MOVIE: movie/secondary.bik (B signifies a blocking action not to move on until after movie is played)
 
-------------------------------------------------------------------------------------------------------------STARTUP
EVENT -All Raiders Dead
    Conditions:
            RAIDERS (R) HAS EXACTLY 0 ALIVE ANYWHERE
    Actions:
            SET MISSION VARIABLE 'M01_ALL_RAIDERS_DEAD' to 'T'
 
MISSION - Variables (This trigger will initialize the variables so that you can later tell if they were changed)
    Conditions:
            ALWAYS
    Actions:
            SET MISSION VARIABLE 'M01_ALL_RAIDERS_DEAD' to 'F'
            SET MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' to 'F'
            SET MISSION VARIABLE 'M01_ELDER_LEADER_ENCOUNTERED' to 'F'
            SET MISSION VARIABLE 'M01_BOS_ALL_ALIVE' to 'T'
            SET MISSION VARIABLE 'M01_BOS_ATTACKED' to 'F'
            SET MISSION VARIABLE 'M01_SHAMAN_ENCOUNTERED' to 'F'
            SET MISSION VARIABLE 'M01_TRIBALS_ATTACKED' to 'F'
            SET MISSION VARIABLE 'DEBRIEF_COMPLETE' to 'FALSE'
 
-------------------------------------------------------------------------------------------------------------FAILURE & SUCCESS NOTICES
MISSION_FAILED - Elder Dead (It is rare that this might occur, but you want to plan for many possibilities)
    Conditions:
            ELDER HAS LESS THAN 1 ALIVE AT ANYWHERE
    Actions:
            TURN EXIT GRIDS 'OFF'
            B CENTER VIEW FOR BOS ON ELDER
            B WAIT 3 SECONDS (Used as a dramatic spacer)
            B DISPLAY TEXT 'M01_FAILUREB'
            B WAIT 3 SECONDS
            END MISSION (FAIL SCREEN)
 
MISSION_COMPLETE - RaiderLeader Eliminated - 600XP
    Conditions:
            HORUS HAS EXACTLY 1 DEATHS AT ANYWHERE (AFAIK, there is no difference between using this method and the condition in the             previous trigger)
    Actions:
            SET MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' to 'T'
            TURN EXIT GRIDS 'ON'
            B WAIT 2 SECONDS
            ADD 600XP TO BOS
            B DISPLAY TEXT 'M01_SUCCESSA'
            COMPLETE OBJECTIVE 'M01_OBJ_01'
 
SUCCESS - Prisoner Guards Killed - 100XP
    Conditions:
            (R) GUARD (H) HAS LESS THAN 1 ALIVE AT ANYWHERE
    Actions:
            ADD 100XP TO BOS
            SET CLICK SPEECH FOR 'CAPTIVE_1' TO 'NONE'
            SET CLICK SPEECH FOR 'CAPTIVE_2' TO 'NONE'
            SET CLICK SPEECH FOR 'CAPTIVE_3' TO 'NONE'
            SET CLICK SPEECH FOR 'CAPTIVE_4' TO 'NONE'
            SET CLICK SPEECH FOR 'CAPTIVE_5' TO 'NONE'
            SET CLICK SPEECH FOR 'CAPTIVE_6' TO 'NONE'
            SET CLICK SPEECH FOR 'CAPTIVE_7' TO 'NONE'
 
-------------------------------------------------------------------------------------------------------------SHAMAN HAWKEYE
(Notice the different order of events and how they affect the final outcome)
SPEECH EVENT - Shaman spoken to before Raider defeat
    Conditions:
            SPEECH EVENT 'HAWKEYE_SPOKEN_TO' OCCURRED
    Actions:
            SET MISSION VARIABLE 'M01_SHAMAN_ENCOUNTERED' to 'T'
            SET CLICK SPEECH FOR UNIT 'HAWKEYE' to 'NONE'
            SET RANDOM SPEECH FOR UNIT 'HAWKEYE' to 'HAWK_Z_F'
 
SPEECH EVENT - Shaman spoken to after
    Conditions:
            SPEECH EVENT 'HAWKEYE_AFTER' OCCURRED
    Actions:
            SET RANDOM SPEECH FOR UNIT 'HAWKEYE' to 'HAWK_Z_F'
            SET CLICK SPEECH FOR UNIT 'HAWKEYE' to 'NONE'
            GIVE ITEM TAGGED 'HPOWDER' FROM 'HAWKEYE' to HUMAN
 
SPEECH EVENT - Shaman not spoken to, Raider defeated
    Conditions:
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
            IF MISSION VARIABLE 'M01_SHAMAN_ENCOUNTERED' is 'F'
    Actions:
            SET CLICK SPEECH FOR UNIT 'HAWKEYE' to 'HAWK_D00_W'
            SET RANDOM SPEECH FOR UNIT 'HAWKEYE' to 'HAWK_B_F'
 
SPEECH EVENT - Shaman spoken to, Raider defeated
    Conditions:
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
            IF MISSION VARIABLE 'M01_SHAMAN_ENCOUNTERED' is 'T'
    Actions:
            SET CLICK SPEECH FOR UNIT 'HAWKEYE' to 'HAWK_D01_W'
            SET RANDOM SPEECH FOR UNIT 'HAWKEYE' to 'HAWK_Z_F'
 
-------------------------------------------------------------------------------------------------------------ELDER CHARON
SPEECH EVENT - Charon spoken to before Raider defeat
    Conditions:
            SPEECH EVENT 'CHARON_SPOKEN_TO' OCCURRED
    Actions:
            SET MISSION VARIABLE 'M01_ELDER_ENCOUNTERED' to 'T'
            SET CLICK SPEECH FOR UNIT 'ELDER' to 'NONE'
            SET RANDOM SPEECH FOR UNIT 'ELDER' to 'CHAR_Z_F'
 
SPEECH EVENT - Charon spoken to after, Tribals lost
    Conditions:
            SPEECH EVENT 'CHARON_FINAL_2' OCCURRED
    Actions:
            SET CLICK SPEECH FOR UNIT 'ELDER' to 'NONE'
            SET RANDOM SPEECH FOR UNIT 'ELDER' to 'CHAR_X_F'
 
SPEECH EVENT - Charon spoken to after, No Tribals lost
    Conditions:
            SPEECH EVENT 'CHARON_FINAL' OCCURRED
    Actions:
            SET CLICK SPEECH FOR UNIT 'ELDER' to 'NONE'
            SET RANDOM SPEECH FOR UNIT 'ELDER' to 'CHAR_Y_F'
            GIVE ITEM TAGGED 'DETONATOR' FROM 'ELDER' to HUMAN
 
SPEECH CHANGE - Raiders defeated, No Tribals lost
    Conditions:
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
            IF MISSION VARIABLE 'M01_TRIBALS_ATTACKED' IS 'F'
    Actions:
            SET CLICK SPEECH FOR UNIT 'ELDER' to 'CHAR_D02_W'
            SET RANDOM SPEECH FOR UNIT 'ELDER' to 'CHAR_Y_F'
 
SPEECH CHANGE - Raiders defeated, Tribals lost
    Conditions:
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
            IF MISSION VARIABLE 'M01_TRIBALS_ATTACKED' IS 'T'
    Actions:
            SET CLICK SPEECH FOR UNIT 'ELDER' to 'CHAR_D03_W'
            SET RANDOM SPEECH FOR UNIT 'ELDER' to 'CHAR_X_F'
 
-------------------------------------------------------------------------------------------------------------PRISONERS
SPEECH - Prisoner guard killed
    Conditions:
            (R) GUARD (H) HAS EXACTLY 0 ALIVE AT ANYWHERE
    Actions:
            SET RANDOM SPEECH FOR 'CAPTIVE_1' TO 'CAP01_C_F'
            SET RANDOM SPEECH FOR 'CAPTIVE_2' TO 'CAP02_C_F'
            SET RANDOM SPEECH FOR 'CAPTIVE_3' TO 'CAP03_C_F'
            SET RANDOM SPEECH FOR 'CAPTIVE_4' TO 'CAP04_C_F'
            SET RANDOM SPEECH FOR 'CAPTIVE_5' TO 'CAP05_C_F'
            SET RANDOM SPEECH FOR 'CAPTIVE_6' TO 'CAP06_C_F'
            SET RANDOM SPEECH FOR 'CAPTIVE_7' TO 'CAP07_C_F'
 
EVENT - Prisoners lost
    Conditions:
            HOSTAGES HAS MORE THAN 2 DEATHS AT ANYWHERE
    Actions:
            SET MISSION VARIABLE 'M01_TRIBALS_ATTACKED' to 'T'
 
-------------------------------------------------------------------------------------------------------------TRIBALS
SPEECH - Tribals spoken to after, Prisoners all alive
    Conditions:
            IF MISSION VARIABLE 'M01_PRISONERS_ALL_ALIVE' IS 'T'
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
    Actions:
            SET CLICK SPEECH FOR UNIT 'ELDER' to 'CHAR_D02_W'
            SET RANDOM SPEECH FOR UNIT 'ELDER' to 'CHAR_Y_F'
            GIVE ITEM TAGGED 'DETONATOR' FROM 'ELDER' to HUMAN
            SET CLICK SPEECH FOR UNIT 'TRIBAL_NC' to 'TRIBAL_B_F'
            SET CLICK SPEECH FOR UNIT 'JUNKIE' to 'JUNKIE_B_F'
 
SPEECH - Tribals spoken to after, Prisoners lost
    Conditions:
            IF MISSION VARIABLE 'M01_PRISONERS_ALL_ALIVE' IS 'F'
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
    Actions:
            SET CLICK SPEECH FOR UNIT 'ELDER' to 'CHAR_D03_W'
            SET RANDOM SPEECH FOR UNIT 'ELDER' to 'CHAR_X_F'
            SET CLICK SPEECH FOR UNIT 'TRIBAL_NC' to 'TRIBAL_C_F'
            SET CLICK SPEECH FOR UNIT 'JUNKIE' to 'JUNKIE_C_F'
 
EVENT - Tribals attacked by player
    Conditions:
            TRIBALS (T) HAS MORE THAN 0 DEATHS AT ANYWHERE
    Actions:
            SET MISSION VARIABLE 'M01_TRIBALS_ATTACKED' to 'T'
            CHANGE TRIBAL (T)'s ALIGNMENT TOWARDS 'BOS' TO -4
 
-------------------------------------------------------------------------------------------------------------LEADER HORUS
SPEECH - Raider Leader perceives player
    Conditions:
            PLAYER 'HORUS' CAN SEE PLAYER 'BOS'
            'BOS' HAS MORE THAN 0 ALIVE AT 'LEADER_DOAMIN'
    Actions:
            ENTITY 'LEADER' WILL USE SPEECH NODE 'HORUS_A00_W'
 
SPEECH - Raider Leader Dying
   Conditions:
            PLAYER 'HORUS' CAN SEE PLAYER 'BOS'
            'LEADER' HAS LESS THAN 60 ATTRIBUTE HITPOINTS% AT ANYWHERE
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'F'
    Actions:
            ENTITY 'LEADER' WILL USE SPEECH NODE 'HORUS_A01_W'
 
-------------------------------------------------------------------------------------------------------------DEBRIEFS
(Note how sloppy combat can result in loss of XP and reputation and also a bad debriefing from the General.)
 
MISSION_01_DEBRIEF_A01 = {Mission Complete warrior.You have dealt with the raiders without hesitation and without mercy. Well done. Every defeat we hand them lessens their numbers and increases our realm of influence. The primitives you saved will be thankful, and fearful of the Brotherhood in the future. This is important since the village must learn to live by our strict rules and thus... be free.}
 
MISSION_01_DEBRIEF_B01 = {I have to admit it's been a while since an initiate performed so solidly in his first mission. The fact that your actions prevented the loss of a single primitive's life speaks volumes of your ability. To show their respect, they renamed their Brahmin stud after you. The Brotherhood, however, will look favorably on you for your next review.}
 
MISSION_01_DEBRIEF_B02 = {You accomplished your mission. However, the loss of so many villagers reflects badly on all of us. As a result we received less initiates than what we require. You need to focus on your future tasks and insure the Brotherhood does not appear fallible.}
 
MISSION_01_DEBRIEF_C01 = {What I fail to understand is how you let a fellow Initiate perish. You were given ample men and equipment to complete the job without suffering any Brotherhood fatalities. But the fault might be mine in putting you in charge of the squad. In either case I will be watching you closely to insure that I made the right decision.}
 
MISSION_01_DEBRIEF_D01 = {You are dismissed.}
 
EVENT - Player takes casualties
    Conditions:
            'BOS' HAS MORE THAN 0 DEATHS AT ANYWHERE
    Actions:
            SET MISSION VARIABLE 'M01_BOS_ALL_ALIVE' to 'F'
 
DEBRIEF - All BOS survived, no Tribals lost - 150XP - Gain Reputation
    Conditions:
            IF MISSION VARIABLE 'M01_BOS_ALL_ALIVE' is 'T'
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
            IF MISSION VARIABLE 'M01_TRIBALS_ATTACKED' IS 'F'
            'BOS' HAS ALL ALIVE AT EXIT GRIDS
    Actions:
            ADD 150XP to 'BOS'
            ADD 100 REPUTATION TO MAIN CHARACTER
            (Note how separate debriefings can be added together and stacked in a specific order)
            ADD 'MISSION_01_DEBRIEF_A01' TO DEBRIEF LIST AT POSITION:0
            ADD 'MISSION_01_DEBRIEF_B01' TO DEBRIEF LIST AT POSITION:1
            ADD 'MISSION_01_DEBRIEF_D01' TO DEBRIEF LIST AT POSITION:2
            B WAIT 2 SECONDS
            B DISPLAY DEBRIEF WINDOW AND TEXT
            B WAIT 3 SECONDS
            END MISSION (WORLD MAP)
 
DEBRIEF - All BOS survived, Tribals lost - lose Reputation
    Conditions:
            IF MISSION VARIABLE 'M01_BOS_ALL_ALIVE' is 'T'
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
            IF MISSION VARIABLE 'M01_TRIBALS_ATTACKED' IS 'T'
            'BOS' HAS ALL ALIVE AT EXIT GRIDS
    Actions:
            ADD -100 REPUTATION TO MAIN CHARACTER
            ADD 'MISSION_01_DEBRIEF_A01' TO DEBRIEF LIST AT POSITION:0
            ADD 'MISSION_01_DEBRIEF_B02' TO DEBRIEF LIST AT POSITION:1
            ADD 'MISSION_01_DEBRIEF_D01' TO DEBRIEF LIST AT POSITION:2
            B WAIT 2 SECONDS
            B DISPLAY DEBRIEF WINDOW AND TEXT
            B WAIT 3 SECONDS
            END MISSION (WORLD MAP)
 
DEBRIEF - Some BOS survived, No Tribals lost - Gain Reputation
    Conditions:
            IF MISSION VARIABLE 'M01_BOS_ALL_ALIVE' is 'F'
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
            IF MISSION VARIABLE 'M01_TRIBALS_ATTACKED' IS 'F'
            'BOS' HAS ALL ALIVE AT EXIT GRIDS
    Actions:
            ADD 100 REPUTATION TO MAIN CHARACTER
            ADD 'MISSION_01_DEBRIEF_A01' TO DEBRIEF LIST AT POSITION:0
            ADD 'MISSION_01_DEBRIEF_B01' TO DEBRIEF LIST AT POSITION:1
            ADD 'MISSION_01_DEBRIEF_C01' TO DEBRIEF LIST AT POSITION:2
            ADD 'MISSION_01_DEBRIEF_D01' TO DEBRIEF LIST AT POSITION:3
            SET MISSION VARIABLE 'DEBRIEF_COMPLETE' to 'TRUE'
 
DEBRIEF - Some BOS survived, Tribals lost - Lose Reputation
    Conditions:
            IF MISSION VARIABLE 'M01_BOS_ALL_ALIVE' is 'F'
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
            IF MISSION VARIABLE 'M01_TRIBALS_ATTACKED' IS 'T'
            'BOS' HAS ALL ALIVE AT EXIT GRIDS
    Actions:
            ADD -100 REPUTATION TO MAIN CHARACTER
            ADD 'MISSION_01_DEBRIEF_A01' TO DEBRIEF LIST AT POSITION:0
            ADD 'MISSION_01_DEBRIEF_B02' TO DEBRIEF LIST AT POSITION:1
            ADD 'MISSION_01_DEBRIEF_C01' TO DEBRIEF LIST AT POSITION:2
            ADD 'MISSION_01_DEBRIEF_D01' TO DEBRIEF LIST AT POSITION:3
            SET MISSION VARIABLE 'DEBRIEF_COMPLETE' to 'TRUE'
 
DEBRIEF COMPLETE: DISPLAY DEBRIEF AND END GAME
    Conditions:
            IF MISSION VARIABLE 'DEBRIEF_COMPLETE' IS 'TRUE'
    Actions:
            B WAIT 2 SECONDS
            B DISPLAY DEBRIEF WINDOW AND TEXT
            B WAIT 3 SECONDS
            END MISSION (WORLD MAP)
 
-------------------------------------------------------------------------------------------------------------CVARS
(These are a few campaign variables that are changed by some actions you take in the mission. I believe these will change how people will react to you when you return to the bunker.)
CVAR_INITIALIZATION
    Conditions:
            ALWAYS
    Actions:
            SET CAMPAIGN VARIABLE 'CVAR_M01_COMPLETE' to 'FALSE'
            SET CAMPAIGN VARIABLE 'CVAR_M01_NPC_HAWKEYE' to 'ALIVE'
            SET CAMPAIGN VARIABLE 'CVAR_M01_VILLAGERS_DEAD' to 'FALSE'
            SET CAMPAIGN VARIABLE 'CVAR_M01_INITIATES_DEAD' to 'FALSE'
 
CVAR_M01_COMPLETE
    Conditions:
            IF MISSION VARIABLE 'M01_RAIDER_LEADER_DEAD' IS 'T'
            'BOS' HAS ALL ALIVE AT EXIT GRIDS
    Actions:
            SET CAMPAIGN VARIABLE 'CVAR_M01_COMPLETE' to 'TRUE'
            SET MISSION 'MISSION_NAME_B01' to 'VISITED'
            SET MISSION 'MISSION_NAME_01' TO 'COMPLETE'
 
CVAR_M01_NPC_HAWKEYE
    Conditions:
            'HAWKEYE' HAS LESS THAN 1 ALIVE AT ANYWHERE
    Actions:
            SET CAMPAIGN VARIABLE 'CVAR_M01_NPC_HAWKEYE' to 'DEAD'
 
CVAR_M01_VILLAGERS_DEAD
    Conditions:
            IF MISSION VARIABLE 'M01_TRIBALS_ATTACKED' IS 'T'
    Actions:
            SET CAMPAIGN VARIABLE 'CVAR_M01_NPC_VILLAGERS_DEAD' to 'TRUE'
 
CVAR_M01_INITIATES_DEAD
    Conditions:
            'BOS' HAS MORE THAN 0 DEATHS AT ANYWHERE
    Actions:
            SET CAMPAIGN VARIABLE 'CVAR_M01_INITIATES_DEAD' to 'TRUE'
 
-------------------------------------------------------------------------------------------------------------
(These are various campaign variables in the campaign that must be initialized here)
GLOBAL_CVAR_INITIALIZATION - DO NOT MODIFY-BEND-TEAR
UNIQUE CVAR INITIALIZATION - DO NOT IMMOLATE-SCRATCH-TAKE INTERNALLY