So, you have already created several maps, and now you want to make an interesting scenario, more interesting than "kill all the xenos", "capture hex", "survive". The scripts and triggers tabs will help you do this.Editor allows you to actually create very interesting scenarios using logic and scripts, for example, you can change landscape, dig trenches, create craters, destroy cities, create interactive maps of the landscape and events that the player can influence by moving units. You can also influence state of units, their health, numbers, morale, experience.Let's start with the most interesting.
"Add hex actions"
First I will explain the basics of the editor's work.As you already know, editor has 17 map editing sections and 4 sections for editing scripts, strings and units.
Elements in sections have an ordinal number starting from 0. An example for the "Terrain" section. You can also find the sequence number in a WHDAT file with the name "Terrain" (for the Terrain and Features section) in the "Data" folder and "Tileset" (for the Tiles sections) in the "Graphics" folder:
GUIDE Map Creation. Scripts and Triggers.
Moderators: Slitherine Core, BA Moderators, WH40K Armageddon moderators
Re: GUIDE Map Creation. Scripts and Triggers.
The 17 map editing sections are divided into 9 according to their functions.In turn, these 9 groups are divided into those that can be used in different scripts. Now we are interested groups 1-6, they can be used in the "add hex actions" script:
Let's look at an example of what a script looks like for adding tranches by trigger:
Re: GUIDE Map Creation. Scripts and Triggers.
The "Update hexes" section specifies the hex with which the changes will occur. You can specify a zone or select hex coordinates , in this case you can use the impact radius, where 0 is 1 hex with the specified coordinates.It is also convenient if all 32 zones have already been applied.
"Changet" section is what you can do with this hex. As you can see, in each row there is a link to the sections on the "Edit" tab:
Re: GUIDE Map Creation. Scripts and Triggers.
Let me remind you that the Terrain and Features sections determine the characteristics of the hex, its patency, protective bonuses, shelter, LOS, etc. The tile sections - how the hexagon will look. Therefore, in order for the trenches to be displayed not only as a picture, but also as a description and properties, you need to specify the serial number of the trenches in the Terrain section.That's 31.
Now the hex will have the properties of a trench , but it will look the same as before . Therefore, in the Tiles section, you need to specify how the trench will look and its orientation. As you have already noticed, in the Tiles section there are 9 windows for data entry. 9 is the number of Tiles sections in the Edit tab. We need tab #7 "Road and Trenches", find the desired picture, take its serial number and enter it into the 7 window.
Re: GUIDE Map Creation. Scripts and Triggers.
It's all. When the trigger is activated, a trench will appear in the specified hex.
Re: GUIDE Map Creation. Scripts and Triggers.
"Trigger"
Point that someone may not understand is present in the "map condition".Let me explain with an example: In this example it is indicated that the number of flags of side 1 on the entire map can be less than 3, which means that there can be 0,1,2 flags. Using the example of the number of 3, I will explain the options:
Less than "3" : 0,1,2
No more than "3" : 0,1,2,3
Equal to "3" : 3
No less than "3" : 3,4,5,6...etc
More than "3" : 4,5,6...etc
What's the use of it? Here is an example. This means that a unit with the tag "15" from turn 1 to 50 will appear in zone 15, provided that in zone 16 the number of flags of side 2 is more than 0 and the number of units with the tag "15" on the entire map is 0,1,2,3 and in zone 15 0,1,2,3 units of side 2. For the player it will look like a respawn in zone 15 1-3 units, as they are destroyed, until they run out, or turn 50 comes, or the number of flags of side 2 in zone 16 becomes 0.The number of units is equal to the number of units with this trigger and tag 15 placed on the map.Zone 15 consists of 6 hex,Zone 16 - 1hex:
These conditions are necessary for respawn a small number of units (1-3) as they are destroyed,during the 50 turn, without them all units will appear on the first turn, some of them are in zone 15, and all the rest are where they are placed in the editor.The number of hex in zone 15 is 6 because the script adds 1-3 units, at the same time part of the hex during the game may be occupied by moving units, if so, units will appear in empty hex zones 15 or the appearance of units will be delayed until 3 hex becomes free.This is done because If the number of free hex is less than the number of units that the script should throw into the game, the unit will appear where it was placed in the editor.
Point that someone may not understand is present in the "map condition".Let me explain with an example: In this example it is indicated that the number of flags of side 1 on the entire map can be less than 3, which means that there can be 0,1,2 flags. Using the example of the number of 3, I will explain the options:
Less than "3" : 0,1,2
No more than "3" : 0,1,2,3
Equal to "3" : 3
No less than "3" : 3,4,5,6...etc
More than "3" : 4,5,6...etc
What's the use of it? Here is an example. This means that a unit with the tag "15" from turn 1 to 50 will appear in zone 15, provided that in zone 16 the number of flags of side 2 is more than 0 and the number of units with the tag "15" on the entire map is 0,1,2,3 and in zone 15 0,1,2,3 units of side 2. For the player it will look like a respawn in zone 15 1-3 units, as they are destroyed, until they run out, or turn 50 comes, or the number of flags of side 2 in zone 16 becomes 0.The number of units is equal to the number of units with this trigger and tag 15 placed on the map.Zone 15 consists of 6 hex,Zone 16 - 1hex:
These conditions are necessary for respawn a small number of units (1-3) as they are destroyed,during the 50 turn, without them all units will appear on the first turn, some of them are in zone 15, and all the rest are where they are placed in the editor.The number of hex in zone 15 is 6 because the script adds 1-3 units, at the same time part of the hex during the game may be occupied by moving units, if so, units will appear in empty hex zones 15 or the appearance of units will be delayed until 3 hex becomes free.This is done because If the number of free hex is less than the number of units that the script should throw into the game, the unit will appear where it was placed in the editor.
Re: GUIDE Map Creation. Scripts and Triggers.
"Add unit action" Script
This script works simply.There are three areas for data entry. "Update units" - definition of the units that the script will affect. You can choose a side, class, faction, core, auxiliary units, and by tag it allows you to fairly accurately determine the group of units. "Where" - defines the impact area of the script, you can select a zone or one hex and a radius around it. "Change" - which unit parameter is changed by the script. Example:
This script works on all units of side 1, core and auxiliary, in a zone with a radius of 10 around hex with coordinates "4.10" replacing the value of the unit parameter "morale" to 120
This script works simply.There are three areas for data entry. "Update units" - definition of the units that the script will affect. You can choose a side, class, faction, core, auxiliary units, and by tag it allows you to fairly accurately determine the group of units. "Where" - defines the impact area of the script, you can select a zone or one hex and a radius around it. "Change" - which unit parameter is changed by the script. Example:
This script works on all units of side 1, core and auxiliary, in a zone with a radius of 10 around hex with coordinates "4.10" replacing the value of the unit parameter "morale" to 120