[Tutorial] How to make a train escort mission

Hello anyone, this tutorial is for making a train escort mission.
First we need to change the team type. The default Team type when a create a mod map is invasion. For exmaple, in tunisia the default is "team_tunisia_allies+team_narrator_invasion_attack+respawn_creators_team” and "team_tunisia_axis+team_narrator_invasion_defence+respawn_creators_team”.
Now, we need press “T” and add two new entries: the “team_narrator_escort_attack” and the”team_narrator_escort_defence”. Obviously, we need to add “team_tunisia_allies+respawn_creators_team” or "team_tunisia_axis+respawn_creators_team” templates for them, so that it becomes "team_tunisia_allies+team_narrator_escort_attack+respawn_creators_team” and "team_tunisia_axis+team_narrator_escort_defence+respawn_creators_team”.


But… We have 4 team_xxx now, we only need two. How can we delete useless team_xxx entries?
Damn it! This editor can’t delete entries without models.
So, we need to open the blk file with a texture editor, find and delete these entries.

6 Likes

2.Create entries for train

The mission is consist of these entries:
One “berlin_train_carts” + Some "objective_train_zone” + One “train_destination_point”

The “berlin_train_carts” entry is responsible for creating train dynamically.**
The "objective_train_zone” is working as checkpoint, it can give a team scores penalty .
As the name says the “train_destination_point” is the destination.
Set these fields for “berlin_train_carts”:

  • train__teamOffense: int value, 1 or 2, indicate which team offense
  • train__teamDefense: int value, 1 or 2, ndicate which team defense
  • train__offenseTeamAdvantageWeight: int value
  • train__defenseTeamAdvantageWeight: int value
    The “train__offenseTeamAdvantageWeight” and “train__defenseTeamAdvantageWeight” is most interesting. It involves the algorithm that determining whether the train should move. We just set them in a same value.

There also some fields need to be set for "objective_train_zone”:

  • groupName: set a group name
  • capzone__activateChoice: set to next "objective_train_zone”’s groupName
    Oh, it’s the same as the invasion mission.
2 Likes

3.Creating a train’s movement route

Now, we have some entries but it can’t move. Because it doesn’t have a movement route.
We need to create a entry base the “railroad” template now. This really trapped me, But praise the open source daScript document, i find it’s a array of coordinate finally.
By the way, the entry created by “railroad” template can’t be edit by mod editor. Maybe the developer forget it? But we have texture editor, just open and edit it.

entity{
  _template:t="railroad"
	"railroad__points:list<p3>"{
	  item:p3=1001.986, 3.28252, -43.6709
    item:p3=300.986, 3.28252, -43.6709
	}
}

The grammar of daScript is like rust lang, it’s var_name:var_type = var_value .

We add some corrdinate for the movement route. Then we can open the mod editor, press “~” open the console and entry the command “railroad.debug”, we can see the movement route is presented by green straight line.

There also some command about train, like “train.reinit”, you can them by yourself.

2 Likes

4.The final work

In the last, we need to adjust the corrdinate of the berlin_train_carts objective_train_zone train_destination_point and the corrdinate the railroad__points in the railroad entry.

We should make them overlapped, otherwise the train can’t move.

Then, we add a group_activator to activate the first sector. The main work is completed, you can do some balance work by editor the capzone__capReward filed of the objective_train_zone object and the team__capturePenalty , team__scoreCap , team__score of team_xxx.

By the way, It is very difficult to modify the coordinates precisely through the editor. I modify it by the texture editor. For example:

entity{
  _template:t="railroad"
	"railroad__points:list<p3>"{
	  item:p3=1001.986, 3.28252, -43.6709
      item:p3=300.986, 3.28252, -43.6709
	}
}

entity{
  _template:t="berlin_train_carts"
  transform:m=[[-1, 0, 0] [0, 1, 0] [0, 0, -1] [701.986, 3.28252, -43.6709]]
  train__teamOffense:i=2
  train__teamDefense:i=1
  train__offenseTeamAdvantageWeight:i=1
  train__defenseTeamAdvantageWeight:i=1
}

entity{
  _template:t="objective_train_zone"
  transform:m=[[1, 0, 0] [0, 1, 0] [0, 0, 1] [500.986, 3.28252, -43.6709]]
  capzone__onlyTeamCanCapture:i=2
  groupName:t="group_1"
  active:b=no
}

entity{
  _template:t="train_destination_point"
  transform:m=[[1, 0, 0] [0, 1, 0] [0, 0, 1] [400.986, 3.28252, -43.6709]]
}

The transform is a matrix, the first three coordinates [1, 0, 0] [0, 1, 0] [0, 0, 1] is indicate the direction (i think). The lastest is indicate the location. **

So i make the distance between the berlin_train_carts and objective_train_zone as 701.986-500.986 = 201 (I don’t know the unit). The distance between the objective_train_zone and train_destination_point is 500.986-400.986 = 100 .

And I found that this task should be able to combine with other mission (like invasion), looking forward to you can make a map to let players take a train to some place first and then do the invasion battle. :grinning:

3 Likes

Sorry, i means text editor not “texture”.

You can delete pre generated entries by simply pressing select on that screen and then press DEL

1 Like

I have tried, but useless… It doesn’t matter text editor is enough

You just need to select it, close the menu, open again, select and press DEL. Then the name will turn into “null” and the entity will be deleted.

1 Like

Sure i just do this