Analysis of the SAVE2.TRI trigger file from AF

Campaign editing

Moderators: Lone Wolf, Snake Man

Post Reply
User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Analysis of the SAVE2.TRI trigger file from AF

Post by Sherlock » 2010-08-05 23:02:26

The purpose of this thread is to analyze the SAVE2.TRI file from the Korea theater of Falcon 4:Allied Force.

Right up front I want to give credit where credit is due. My work draws heavily from Chris Carter's "Campaign Creation for Falcon 4.0" which is found in the PMC downloads section here. The trigger file discussion starts on page 16.

Also, my work draws from the very informative comments included in the SuperPAK 4 trigger files. I wish to thank Chris and whomever the annonymous person was who commented the SP4 trigger files so well. Without these two source documents the trigger files might still be a mystery to me. ;)

First some observations about the AF versions of the trigger files:

1. The same trigger file is used across of all three Korea theaters (Korea, Korea2005 and Korea2010) in AF so by definition all three Korea theaters have the same objectives and theater PAK goals.
2. Lead Pursuit implemented a new Trigger command. Whereas the older SuperPak (SP) 4 version of the SAVE2.TRI file used a command "IF_CONTROLLED" the Allied Force (AF) version of the SAVE2.TRI file now uses the command "IF_CONTR_ALLIES".
3. All other commands appear to be identical.
4. I compared the SP4 Korea SAVE2.TRI file to the AF Korea SAVE2.TRI file so I could determine whether Lead Pursuit (LP) renumbered the objectives Campaign ID (CAMPID) in the theater objectives list. The reason I did this is because TacEdit won't open an AF version of the .CAM file so I could do a direct correlation. So I had to find out through the process of elimination whether the Korean PAK objectives were the same in both versions or different. I determined that LP did not change the CAMPIDs for Korea. However, LP DID swap out a few of the objectives assigned to some of the events within the trigger file.

The plan for this analysis will be that I will break each trigger event down into a separate post so it can be dissected "a bite at a time". That way I hope to neither overwhelm my time nor the reader with too much to "digest"! :) I realize that some of you may already be familiar with the trigger file commands and the basic scripting approach the simple trigger system in Falcon uses. However, I will try to be as detailed as possible so as to bring the beginners reading this along as well.

Background:

The trigger file (aka .TRI file) works in conjunction with its corresponding campaign file (aka .cam file) to change the ebb and flow of the campaign as time progresses and to make certain events happen if particular circumstances come into being. For example, you remember China entering the war on the side of the DPRK? Yep. That's controlled by the trigger file. How about those announcements that the Allies are mounting a major offensive? Yep, controlled by the trigger file as well. As reference one states: "...the TRI file gives the [Falcon] campaign engine it’s overall objectives and sets the main events that occur as it progress."

The trigger file consists of basically two parts: (1) Initialization section and (2) Events. The initialization section sets certain event flags to start the campaign with and it sets certain parameters for the Falcon campaign engine to utilize. The events in the second section are stated in "IF-THEN-ELSE" programing statements with conditions to check against. If the condition is found to be true then specific command actions are specified.

The AF SAVE2.TRI trigger file initialization section (or header section):

Code: Select all

----------------------------------------------------
//
// Base event file
//
// Korea Save2: Tiger Spirit
//
// :::::::::::::::::::::::::::::::::::::::::;
//
//
#TOTAL_EVENTS 22
//
// :::::::::::::::::::::::::::::::::::::::::;
// 
//
#SET_EVENT 9
#RESET_EVENT 10
#SET_EVENT 6
#SET_EVENT 7
#PARENTRECALCDEPTH 4
#FLOT_SORTDISTANCE 20
#FLOT_DRAWDISTANCE 50
#MINEVALUATEAIRBASEDISTANCE 20
#ENDINIT
//
// :::::::::::::::::::::::::::::::::::::::::;
// 
-----------------------------------------------------
First of all, the initialization section (or header) is a great place to put down some notes to keep focus on the particular scenario at hand. Here they've listed the .cam file this trigger file is meant to be used with ("Korea Save2: Tiger Spirit") and they have separated things by using colons (":") and double forward slashes ("//"). Note that double forward slashes ("//") have a special meaning in the Falcon trigger file script language. A double slash means to ignore the line that begins with the double slash. So everywhere you see a "//" then that line gets ignored by the Falcon engine when reading it. The double slash will always proceed any comments the writer wishes to place into the trigger file.

Next comes the statement "#TOTAL_EVENTS_22". There are two things here to note. First, the line begins with the "#" character. In the Falcon trigger file script language the "#" character also has special meaning. The "#" character means a command will follow. So whenever entering a script command it must be proceeded by the number character (#). Secondly, the command itself "TOTAL_EVENTS 22" signifies the total number of events contained in the entire trigger file. This number must be kept accurate for the Falcon buffers to be allocated properly for the running campaign.

The next line to take notice of is the "#SET_EVENT 9" entry. This is one of several different commands in the trigger file script language. In this case the command is setting the activated flag on (or true) for EVENT 9 because it is desired to have EVENT 9 appear to already have happened as the campaign starts. This same case applies for EVENT 6 and EVENT 7 a couple of lines following.

The next line states "#RESET_EVENT 10". This line does the opposite of the SET_EVENT command. It turns the event off (or false). So in this case EVENT 10 is reset to false or off.

The next line states "PARENTRECALCDEPTH 4". Information on this command is non-existant as far as I could find. Hopefully Ed_1 can stop by and fill us in on what this command does.

The next line states "#FLOT_SORTDISTANCE 20". Information on this command is non-existant as far as I could find. Hopefully Ed_1 can stop by and fill us in on what this command does.

The next line states "#FLOT_DRAWDISTANCE 50". This command sets the maximum distance between two FLOT objects (in km) to draw a line for the FLOT representation in the 2D map (in the UI).

The next line states "#MINEVALUATEAIRBASEDISTANCE 20". This is the distance set for movement of aircraft squadrons to another airbase when enemy ground forces approach close to their current airbase.

The next line states "#ENDINIT". This command ends the initialization (or header) section of the trigger file. It denotes to the Falcon engine that all the initialization parameters are now done and what comes next are the events.

That's it for now. I'll post the next installment hopefully in a couple of days or so. Next up is "EVENT 1".
Sherlock
Victurous te Saluto

Ed_1
Recruit
Posts: 69
Joined: 2002-07-08 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: NYC, USA

Re: Analysis of the SAVE2.TRI trigger file from AF

Post by Ed_1 » 2010-08-06 21:34:11

I really can't help you here, tri files i never messed with much. Only thing the Flot ones are about flot line displayed on map AFAIK .

demer928
Banned user
Posts: 208
Joined: 2009-05-06 20:48:30
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.

Re: Analysis of the SAVE2.TRI trigger file from AF

Post by demer928 » 2010-08-06 21:57:56

"PARENTRECALCDEPTH 4".

Hmmm......Maybe I can shed some light on that. Have to check with the Boss first though!!!!
Has to do with the GU movement's, but was also used to de-bug.
That's all for now.

demer

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests