jan 2002 TosaInu

Historical Campaigns for STW WE/MI

This brief guide will explain how to make historical campaigns/fictional scenarios for STW WE/MI.

This guide will likely not be complete, but you should be able to create a working scenario.

 

What do you need?

Maps (jjm files) where the story takes place, you can either use default maps from STW

STW WE/MI, existing custom maps from http://www.totalwar.org or create your own with either the

editor in the STW demo (battletrainer) or the editor that shipped with WE/MI.

 

A texteditor: wordpad or notepad will do. Notepad is a bit limited when you edit the comments (memory

constraints).

 

The MapGrid made by Doug Barnett is very useful to estimate the coordinates and directions for units.

http://www.totalwar.org/maps/tools/NewMapGrid.zip

 

An aid in planning a battle is Planners by Doug Barnett http://www.totalwar.org/maps/tools/Planners.zip

Note: both the MapGrid and the planners were made for small STW maps (20*20 tiles).

Best thing to do first is to think of a name to use for your scenario, this can be a workingname, but you

need to make a FRAME.

It's also nice to think about how many battles will be needed (making 100 battles is a lot of work).

 

We'll make a small and simple scenario with 4 battles. The scenario is called MyScenario, the four battles are

called: Battle1, Battle2, Battle3 and Battle4.

We need to make the folders and files in Battle/batinit/Historical Campaigns.

First we'll create a new folder and name it MyScenario (Battle/batinit/Historical Campaigns/MyScenario). Open that folder and create 4 new folders

in it, name them: Battle1, Battle2, Battle3 and Battle4. The folders will be installed to Battle/batinit/Historical Campaigns when the Ikki scenario is installed.

Create a new textfile in the folder MyScenario and rename it to: MyScenario.HCF

Open the file with a texteditor and type the following:

 

//The double slashes are used to insert comments to a file.

NumBattlesInCampaign::4

BattleName::"Battle1"

BattleName::"Battle2"

BattleName::"Battle3"

BattleName::"Battle4"

Predefined::true

Description::"MyScenario_Description_Label"

When you add Battle5, this txt needs to get updated:

NumBattlesInCampaign::5

BattleName::"Battle1"

BattleName::"Battle2"

BattleName::"Battle3"

BattleName::"Battle4"

BattleName::"Battle5"

You might want to include a picture to the scenario, make a tga file of 304*120 pixels and name it:

MyScenario.tga, save it in the MyScenario folder.

 

Open the folder Battle1. This will be a battle between an archerunit and a yarisamuraiunit on Totomi.

If the player wins he'll go to Battle2, if he loses he has to try again. We need to make 3 files (with a

texteditor): Battle1.bdf (Battle Description File), Bad.adf (Army Descri[tion File) and Good.bdf.

Open Battle1.bdf with a texteditor: (these files are also already installed with the Ikki scenario).

//This lines makes that the battledescription gets comments from loc/eng/HistCampaigns.txt

//which we'll make later. loc/german for German copies etc.

Predefined::true

Title::"MyScenario_Battle1_Title_Label"

Author::"MyScenario_Battle1_Author_Label"

Rating::"MyScenario_Battle1_Rating_Label"

Description::"MyScenario_Battle1_Description_Label"

Conditions::"MyScenario_Battle1_Conditions_Label"

//You can play movies before or after the battle. You can play the mpg from EvAnims or Movies.

//The default folder is Movies, if you want to play a mpg that's located inside this folder, just type

//the name including extension inside the quotes. If you want to play a file from another folder, go out

//Movies folder by using ../ then type the name of the folder the mpg is located in (inside the main STW folder!)

// We'll play the intro.mpg and MaSword.mpg from EvAnims (outro).

IntroFMV::"intro.mpg"

OutroFMV::"../EvAnims/MaSword.Mpg"

 

MapName::"totomi"

BattleType::BATTLE_TYPE_HISTORICAL

Deployement::false

Season::summer //can also be spring, winter or autumn

WeatherSequenceId::1 //1 is a fine day, many more weathers can be used: rain, wind, snow, fog etc.

//Some of them are listed in Appendix A.

//The name between the quotes will get displayed, the first 0 determines which color will be used (white/grey

//rebel, the 2nd 0 indicates the alliance group: all players with the same digit here are allied. Different

//digits will attack each other. LOCAL means that this iis the human player, ARTIFICIAL is controlled

//by the PC. The second name inside the quotes tells which adf will be used for the player Angela. Note:

//type Good without the adf extension. False means that the player is the defender. It can be useful

//to make the AI attacker TRUE), as he tends to be passive in defending roles. The 0 preceding false

//seems to determine a kokulimit, I don't know what it does. The last 3 digits determine homecoordinates

//and direction, I don't use that either. Colors are listed in Appendix B.

Player::"Angela" 0 0 LOCAL "Good" 0 false 21100 31939 0

Player::"BlackSamurai" 5 5 ARTIFICIAL "Bad" 0 true 21548 11874 0

//The best part of all: triggers. Stw has quite a few Triggers and they can be combined too. A full listing of

//known Triggers is in Appendix C. We use the most simple here: victory and defeat: by killing and/or routing.

//The first digit always indicates the TriggerGroup. Here the second indicates which player/color won or lost.

//0 is Angela

TerminatingTrigger::"BATTLE_PLAYER_WON" 1 0

TerminatingTrigger::"BATTLE_PLAYER_LOST" 2 0

//Here are the TerminatingTriggerGroups, when the Trigger(s) are hit/objectives completed, this determines what

//happens next. The first digit is an ID for the TriggerGroup which should match the TerminatingTriggers. The second

//digit has some nice features, for now we'll use 1 as there's only 1 objective to be completed. If the DEFENDER WON

//the player goes to Battle2, otherwise he has to replay it (Battle1). LOST ATTACKER can be used instead of WON DEFENDER.

TerminatingTriggerGroup::1 1 WON DEFENDER "Battle2"

TerminatingTriggerGroup::2 1 LOST DEFENDER "Battle1"

 

Open Bad.adf:

One army can field 16 units at a time, every unit has a description like this:

UnitStart::"Unit" //You can type a name here, this name will be displayed in the afterbattle summary

InitialLeaderName::"Bad Boy" //Leaving the space between the two doublequotes blank will generate a default name.

IsGeneral::true //true makes a taisho, false a normal unit. Note: only one taisho is fielded

Position:: 17000 32000 //These are the coordinates of the centre of the unit on the field

Direction::180 //The direction a unit looks to (degrees 0-259)

GeneralRank::0 //A generalrank boost the honor of every unit in the army. Every 2 points raise honor with 1

LeaderHonour::0 //seems to be used in HTH combat calculations

UnitMon::1 //??

TroopType::samspears //indicates the unittype, here a yarisam. See Appendix D.

TroopNum::25 //Determines how many soldiers are in that unit: 1-120 can be used.

TroopHonour::2 //Honor of the unit (includes fightingskills)

Columns::10 //Number of columns the unit is in

CurveRadius::1 //??

FormationType::FORMATION_CLOSE //never worked for me, expect WEDGE and LOOSE

MeleeMode::ENGAGE_AT_WILL //never worked for me

FatigueLevel::FRESH //never worked for me

HoldPosition::true //never worked for me

GeneralIsDaimyo::false //true: the taisho is also daimyo, will play appropiate sounds in battle

ArmourLevel::0 //armor and weapon upgrades 0-3

WeaponLevel::0

UnitEnd:: //Required to make clear that description for this unit is done.

 

Good.adf has 120 honor 3 archers with level 2 armor and level 2 weapons.

 

Battle2 is a branched battle, this means that you'll continue to the next battle regardless of the outcome. But the outcome dictates what the next battle will be.

If Battle2 is lost the player goes to battle3, if he wins it he'll also go to battle3, if he occupies area 1 (or just any other objective like castleinvasion, assassination of a taisho) and wins (in this case kiling 70% of the enemy) he'll go to battle 4.

Battle3. If the player loses it the scenario is over. If he wins it he'll go to battle4.

Battle4. This is the last battle in this scenario and thus the player can just lose or win here.

 

A textdescription can be made to explain the player what to do in a given battle. Descriptions for Historical Campaigns/scenarios are located in loc/eng/HistCampaigns.txt (in case of english language). Here's the text for the campaigndescription and battle2:

/////////////////////////////////////////////////////////////////////////////////

///MyScenario///////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////

["MyScenario_Description_Label"]

{"This is a genaral desciption for MyScenario. Any text can be typed here, all text should be in one line, double quotes can't be used."}

/////////////////////////////////////////////////////////////////////////////////

///Battle1////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////

["MyScenario_Battle1_Title_Label"]

{"Title/brief description of Battle1."}

["MyScenario_Battle1_Author_Label"]

{"TosaInu"}

["MyScenario_Battle1_Rating_Label"]

{"Seems not displayed in scenario: easy."}

["MyScenario_Battle1_Description_Label"]

{"This section is used to describe the battle, explain the background."}

["MyScenario_Battle1_Conditions_Label"]

{"This section explains the player what he's expected to do, which conditions lead to victory, which to defeat, it can also be used as a second alinea for the description, or a combination of those two."}

Just copy the structure of {[" etc to add battles. Place all battles of a given campaign under the same Scenario header (///MyScenario///). Make sure that any description is placed between 

SetShowTransOn // Do not translate.

//???? Remove when localised.

["StartposData"] {"StartPos data."}

and

SetShowTransOff // Do not translate.

//???? Remove when localised.

Advanced

-Crossalliances can cause incorrect battlereports.

-The pivot/most important army should dictate the alliancenumber.

-When combinations of triggers are used, the one with the most triggers should be listed first. Example: Event A Event B and Battle WON Event.

 

Group 1     A is met    

                   B is met

                   Battle WON

Group 2     A is met

                   Battle WON

Group1 goto battle1

Group2 goto battle2

If the groups are changed (1 is 2, 2 is 1), then event A & B & Battle Won will (likely, as I experienced that) not be recognised or used as A and Battle Won is read first and is considered to be the correct termination, even if B is also met.

 

Appendix A

Weather:

1 fine day

2 fine day, but less sunny

3 fine, day least sunny

4 light rain

5 med rain

6 hvy rain

7 light snow

8 med snow

9 hvy snow

10 light fog

11 med fog

12 hvy fog

13 cloudy, light wind?

14 cloudy, med wind?

15 cloudy, strong wind?

16 light rain

17 med rain, seem to g alternate with light rain

18 hvy rain, wind alternated by med rain.

19 light snow & ?

20 med snow & ?

21 hvy snow & ?

22 med rain, wind and dry patches

more...

 

Appendix B

# Color

0 White/grey Rebels

1 Green Shimazu

2 Red Mori

3 Yellow Oda

4 Light Blue Imagawa

5 Black Takeda

6 Purple Hojo

7 Dark Blue Uesugi

 

Appendix C

Note: WON ATTACKER is same as LOST DEFENDER

Player is 0, enemy is 5.

1. TerminatingTrigger::"BATTLE_PLAYER_WON" 1 0

Player 0 wins if he routs and or kills all enemies. This also applies if player 0 loses but his

allies win.

2. TerminatingTrigger::"BATTLE_PLAYER_LOST" 1 0

Player 0 lost if he is routed and or killed.

3. TerminatingTrigger::"BATTLE_PLAYER_KILL_ENEMY_GENERAL" 1 5 5

Kill general 5 gives victory (function of the other five is not yet known by me).

4. TerminatingTrigger::"BATTLE_PLAYER_ROUT_ENEMY_GENERAL" 1 5 5

Rout general 5 gives victory (function of the other five is not yet known by me).

5. TerminatingTrigger::"BATTLE_PLAYER_KILLED_A_PERCENTAGE_OF_TROOPS" 1 50 true 5

Killing 50% of army 5 gives victory. If False then also allies of 5 can be part of 50%.

6. TerminatingTrigger::"BATTLE_PLAYER_LOST_A_PERCENTAGE_OF_TROOPS" 1 50 false 0

If player 0 lost 50% of his troops. This can be useful in a combined objective, i.e.: beaten enemy

but lost 50% of own forces =>rematch on fieldB. Won & lost less than 50% of own forces =>

full victory. 

Note about 5 and 6: these triggers seems to be limited in combination with other triggers. You can't for example have a Victory or Defeat and check for how many soldiers are left in your own army:  when you lost say 50% of your troops, stw 'thinks' you lost. It seems not possible to continue the game and get a Victory. 

7. TerminatingTrigger::"BATTLE_PLAYER_ROUTED_A_PERCENTAGE_OF_TROOPS" 1 10 true 5

Routing 50% of army 5 gives victory. If False then also allies of 5 can be part of 50%.

8. TerminatingTrigger::"BATTLE_PLAYER_INVADE_CASTLE" 1 100 0

Player 0 wins if he invades the castle with 100 men.

9. TerminatingTrigger::"BATTLE_PLAYER_TIMEOUT" 1 15 0

Player 0 loses if he can't finish the battle within 15 minutes.

10. TerminatingTrigger::"BATTLE_PLAYER_CAPTURE_AREA" 1 1 100 0.1 0

Player 0 captures area 1 with 100 men and holds it for 0.1 minutes (6 seconds)

AreaCircle:: 1 16000 16000 600 area 1 on coordinate 16000,16000 dimension 600

Note: it should be possible to include more than 1 area!

This looks like 'only' 10 objectives, but there's variation per Trigger: numbers of men required, time,

color which is subject, whether allies are included and best of all triggers can be combined and or.

Example:

TerminatingTrigger::"BATTLE_PLAYER_KILL_ENEMY_GENERAL" 1 5 5

TerminatingTrigger::"BATTLE_PLAYER_INVADE_CASTLE" 1 100 0

 

TerminatingTrigger::"BATTLE_PLAYER_INVADE_CASTLE" 2 100 0

TerminatingTrigger::"BATTLE_PLAYER_LOST" 3 0

 

TerminatingTriggerGroup::1 2 SUCCESS_FINISHED_SEQUENCE ATTACKER

TerminatingTriggerGroup::2 1 WON ATTACKER "NextMap"

TerminatingTriggerGroup::3 1 FAILURE_FINISHED_SEQUENCE ATTACKER

 

If the player kills the General and invades the castle he wins.

If the player invades the castle but the general escapes (something which isn't really possible

in a castleattack) he wins but has to battle again in nextmap.

If he does neither he loses.

 

Appendix D

Names used in adf files.

Japanese units:

ashigaruxbow crossbow

lsamurai archers

musketmen

arquemen

hcavalry heavy cav

naginatacav

lcavalry mounted archers

lancers yari cav

ashispears YA

samspears YSam

naginata

monks

nodachi

ninjas

maswords Kensai

 

Mongol Units:

mongolheavycav

mongollightcav

mongolspears

mongolpolearms Korean Guard

mongoljavelins

grenadiers ThunderBombers