Page 1 of 1

Campaign trigger file help

Posted: 2002-06-09 14:21:00
by Snake Man
Here, post anything you know about Campaign Trigger files.

Thanks.

PMC TFW
Snake Man

Re: Campaign trigger file help

Posted: 2002-06-09 18:27:00
by codec
quote:Originally posted by Snake Man:
Here, post anything you know about Campaign Trigger files.
They're text format, and relate to the events view in tacedit. How helpful is that!
:D

Julian.

Re: Campaign trigger file help

Posted: 2002-06-09 19:43:00
by Widowmaker
hehe
that should give Snakeman a lead.. :)


Widmak

Re: Campaign trigger file help

Posted: 2002-06-09 20:44:00
by Washout
Hi Snakeman

There should be a short bit in the tutorial I wrote - not much detail in there I know but it might help.

Later

Chris

PS. If anyone comes up with a full syntax/command listing that would be really great.

Re: Campaign trigger file help

Posted: 2002-06-09 20:49:00
by FAngs32
>>PS. If anyone comes up with a full >>syntax/command listing that would be really >>great.[/B][/QUOTE]

I'll second that motion :-)

FAngs32

Re: Campaign trigger file help

Posted: 2002-06-10 10:23:00
by codec
Full syntax written up, on its way. Hopefully snakeman will post it in the tutorials section.

Julian.

Re: Campaign trigger file help

Posted: 2002-06-17 12:17:00
by Snake Man
Trigger commands syntax finally posted to the campaign tutorial.

PMC TFW
Snake Man

Re: Campaign trigger file help

Posted: 2002-07-30 11:14:00
by Snake Man
I wanted to play around with campaign start so this is what I did.

Started Tacedit, loaded save0.cam my historical ODS 1991 campaign. Selected campaign -> Dates, edited as following:
Cur Time 0:20:30:00.0000, Star Time 0:20:30:00.0000
Teams -> Relations, changed team 2 and team 6 to Hostile status.

Then I went to the campaign\DesStorm directory and edited save0.tri file to the following:

//
// OPERATION DESERT STORM historical 1991 campaign
//

//
// initialize
//
#TOTAL_EVENTS 2
#SET_TEMPO 150
#ENDINIT


// event 1?
#IF_EVENT_PLAYED 1
#ELSE
#IF_CAMPAIGN_DAY G 1
#SET_TEMPO 255
#CHANGE_RELATIONS 2 6 5
#PLAY_MOVIE 108
#DO_EVENT 1
#ENDIF
#ENDIF


//
// US/Coalition controls KUWAIT
//
#IF_CONTROLLED 2 O 3083
#PLAY_MOVIE 116
#DO_EVENT 2
#END_GAME 2
#ENDIF
// End
#ENDSCRIPT


Now the results are that campaign will start at 2030hrs, BARCAPS, Tankers, Airlifts and AWACS get scheduled but no offensive action. We build good backbone for war, then at midnight when clock strucks 0000hrs the war starts and campaign engine starts to schedule offensive strike etc flights. The currenly airborne flights will engage the enemies.

Sounds cool so far... Dunno how it really works eventually, but anyways thought I post this tip.

PMC TFW
Snake Man

Posted: 2007-04-13 19:07:38
by Snake Man
I was wondering, can we setup a trigger file condition that one side has lost too much objectives/units either destroyed or captured, basically I'm looking for victory condition where you bomb the objectives/units so much that some levels (force levels?) drop too much on the enemy and you win.

Hmm maybe I cannot describe good enough of what I want here, anyone getting my idea?

Arent there similar thing in korea campaign, if DPRK gets whipped too bad China enters war... so how do you specify the whipping then? is it just enough of days, some tempo or offensive/defensive posture, what? :)

Posted: 2007-04-13 19:48:49
by Sherlock
Snake Man wrote:I was wondering, can we setup a trigger file condition that one side has lost too much objectives/units either destroyed or captured, basically I'm looking for victory condition where you bomb the objectives/units so much that some levels (force levels?) drop too much on the enemy and you win.

Hmm maybe I cannot describe good enough of what I want here, anyone getting my idea?

Arent there similar thing in korea campaign, if DPRK gets whipped too bad China enters war... so how do you specify the whipping then? is it just enough of days, some tempo or offensive/defensive posture, what? :)
Yes, you can set up conditions based on supply level dropping for a team (which would be caused by large scale destruction of factories, depots, refineries, etc.) which would end the game. Here is an example section of trigger file code extracted from the SP4.2 Korean campaign and modified for the end of game condition you wanted to achieve:

Code: Select all

// 
// Event #12 (note; event #12 is a bogus number; must be changed for entry into REAL campaign trigger file)
// War ends due to large scale destruction of Team #6 infrastructure
// This code requires two teams: Team 2 and Team 6, specifically.
//
#IF_EVENT_PLAYED 12
  #ELSE
    #IF_SUPPLY 6 L 20 // if supply level for Team 6 drops to less than 20 
      #DO_EVENT 12   // do event 12 if conditions in line above are met
      #END_GAME 12  // end game
    #ELSE
      #IF_FORCE_RATIO A 6 2 L 3  // if force ratio between Team #6 versus Team #2 drops less than 3:1 (guess on 3:1 part here)
      #DO_EVENT 12  // do event 12 if conditions in line above are met
      #END_GAME 12  //  end game
      #ENDIF
    #ENDIF
#ENDIF
Note: This is very quick, dirty code and I am sure that other conditions could be added to enhance playability, i.e., set this up for red side AND blue side, etc.

EDIT: Had a couple of line reversed; corrected now.

Posted: 2007-04-14 12:40:27
by Snake Man
I thought to share this trigger file I created today for Afghanistan fictional mayhem campaign as a test.

Code: Select all

//
// Afghanistan Theater fictional campaign #1
//

//
// initialize
//
#TOTAL_EVENTS 2
#ENDINIT

//	Teams
//	1 US == U.S. (no ground objectives).
//	2 ROK == Pakistan. (allied).
//	3 Japan == India. (neutral).
//	4 CIS == Tajikistan, Turkmenistan, kyrgyzstan and Uzbekistan. (allied).
//	5 PRC == China. (hostile).
//	6 DPRK == Afghanistan (at war!)
//	7 Gorn == Iran. (hostile).

//#CHANGE_RELATIONS <team> <with> <rel> - change the relations between team and with to the given rel state. If rel is Allied, then the teams merge.
// 
// <rel> according to tacedit teams page relations
// 0 = none. Used or not? :)
// 1 = Allied
// 2 = Friendly
// 3 = Neutral
// 4 = Hostile
// 5 = At War

// snake: everybody allies with Afghanistan.
#CHANGE_RELATIONS 3 6 1
#CHANGE_RELATIONS 4 6 1
#CHANGE_RELATIONS 5 6 1
#CHANGE_RELATIONS 7 6 1
#SET_TEMPO 255
#DO_EVENT 1
//#ENDIF
#ENDIF

// 
// US/Coalition controls KABUL, KANDAHAR and MAZAR-E SHARIF
//
#IF_CONTROLLED 2 A 441 846 154
#PLAY_MOVIE 116
#DO_EVENT 2
#END_GAME 2
#ENDIF

// End
#ENDSCRIPT
As you can see, all the teams joins up with team 6 which is our enemy, that happens right at the start of the campaign, actually I dont know what controls that, perhaps just the fact that its the first event and there is no conditions so its run right away.

I tested that on AF and it runs, however AF gives debug message on the bfopslog about missing endif line, hmm perhaps its that one I commented out for some reason. Anyways it runs, good enough, for now :)

Posted: 2007-04-14 16:30:34
by Sherlock
Two things:
1. The reason it is happening at the very beginning is because you don't have any conditional statement for the CHANGE_RELATIONS section. So it will execute that everytime without fail (no conditions to check against).

2. The #ENDIF at the end of the CHANGE_RELATIONS section is the reason you are getting a debug message in the bfopslog. It has no corresponding #IF ahead (above) it.

Re: Campaign trigger file help

Posted: 2009-08-18 12:13:10
by Snake Man
I have updated the PMC Editing Wiki: Triggers page with few more items I found in my text file archives.

It is unsure if these work on OF and RV, they should be at least working in AF since these are the SuperPAK series results.