<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.splashdamage.com/index.php?action=history&amp;feed=atom&amp;title=Construction_System</id>
	<title>Construction System - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.splashdamage.com/index.php?action=history&amp;feed=atom&amp;title=Construction_System"/>
	<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Construction_System&amp;action=history"/>
	<updated>2026-04-11T06:46:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Construction_System&amp;diff=4135&amp;oldid=prev</id>
		<title>192.168.0.151 at 17:11, 11 August 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Construction_System&amp;diff=4135&amp;oldid=prev"/>
		<updated>2008-08-11T17:11:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Intro==&lt;br /&gt;
&lt;br /&gt;
The design goal for the construction system was to introduce basic RTS style game-play to the multiplayer Wolfenstein universe. The construction system was designed to be as flexible as possible by having support for multiple stages which can be created from either game models or brushwork. &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ability to build constructions is an enhanced feature of the engineer class. Engineers are able to construct objects within maps such as bridges, guard towers and gun emplacements in predefined locations. The construction locations should be marked by the crates model so that everyone can recognise a construction point in the map.&lt;br /&gt;
&lt;br /&gt;
Each construction will have a construction class which defines how much 'charge bar' time is required to complete each stage of the construction. The speed at which an item can be constructed can be increased with additional Engineers.&lt;br /&gt;
&lt;br /&gt;
While the construction is being built a translucent representation of the object will appear and then become solid when built. If a player is in the construction area while being built they will be warned to leave the area before the construction is finished. Players failing to leave the construction zone will be killed the instant the construction is complete.&lt;br /&gt;
&lt;br /&gt;
A construction object which has not finished or been touched by an engineer will decay after 30 seconds (current default) to its previous deconstructed 'crates' state. Multiple stage constructions will decay back to their previous built stage.&lt;br /&gt;
&lt;br /&gt;
Once the construction has been built by one team, only the opposing team can damage it. The construction class of the construction object dictates how it can be destroyed. Friendly fire will not apply to constructed objects.&lt;br /&gt;
&lt;br /&gt;
==Construction Classes==&lt;br /&gt;
&lt;br /&gt;
Most of the construction system's functionality is located in the scripting system and only the basic parameters are present in the maps. This could present a problem for Level Designers who have had very little experience of scripting but the existing maps do offer a lot of workable examples to study if you're unsure.&lt;br /&gt;
&lt;br /&gt;
The construction system has 6 variables which can affect the way a constructible object will work in-game. These variables are also organized into 3 presets so that construction objects can be consistent across all maps. The main difference between each of the construction presets is the 'charge bar' times and the type of explosives that can damage the object.&lt;br /&gt;
&lt;br /&gt;
The largest construction objects in the game were given the highest 'charge bar' value so that it would encourage the engineers to work together on completing objectives. The preset value of a construction should reflect its importance to the overall map objectives. The only exception to the rule is the escorted tanks which have a high health value and can be damaged by all explosives.&lt;br /&gt;
&lt;br /&gt;
All constructible items must have the construction class (preset) defined upon spawning in the map. Further construction parameters can be changed after the construction class has been defined. The following table highlights the presets and what values they use.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- bgcolor=&amp;quot;#E0E0E0&amp;quot;&lt;br /&gt;
|  | Construction Class (preset)&lt;br /&gt;
|  | Charge Bar Req.&lt;br /&gt;
|  | Construct XP Bonus&lt;br /&gt;
|  | Destruct XP Bonus&lt;br /&gt;
|  | Health&lt;br /&gt;
|  | Weapon Class&lt;br /&gt;
|  | Duration (msec)&lt;br /&gt;
|  | Icon&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
| 1&lt;br /&gt;
| 0.5&lt;br /&gt;
| 5&lt;br /&gt;
| 5&lt;br /&gt;
| 350&lt;br /&gt;
| 1*&lt;br /&gt;
| 2500&lt;br /&gt;
| class=&amp;quot;gensmall&amp;quot; | Grenade&lt;br /&gt;
|- bgcolor=&amp;quot;#C0C0C0&amp;quot;&lt;br /&gt;
| 2&lt;br /&gt;
| 1&lt;br /&gt;
| 7.5&lt;br /&gt;
| 7.5&lt;br /&gt;
| N/A&lt;br /&gt;
| 2*&lt;br /&gt;
| 5000&lt;br /&gt;
| class=&amp;quot;gensmall&amp;quot; | Satchel Charge&lt;br /&gt;
|- bgcolor=&amp;quot;#C0C0C0&amp;quot;&lt;br /&gt;
| 3&lt;br /&gt;
| 1.5&lt;br /&gt;
| 10&lt;br /&gt;
| 10&lt;br /&gt;
| N/A&lt;br /&gt;
| 3*&lt;br /&gt;
| 2500&lt;br /&gt;
| class=&amp;quot;gensmall&amp;quot; | Dynamite&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;gensmall&amp;quot;&amp;gt; 1* = All Explosives (Dynamite, Satchel Charge, Grenades, Panzerfaust, Mortars, Air Strike, etc.)&amp;lt;br /&amp;gt; 2* = Dynamite, Satchel Charge&amp;lt;br /&amp;gt; 3* = Dynamite Only &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that constructible_health only applies to construction class 1 because the other values are instantly destroyed by satchel or dynamite explosions.&lt;br /&gt;
&lt;br /&gt;
The script commands below match the columns of the table above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt; constructible_chargebarreq&amp;lt;br /&amp;gt; constructible_constructxpbonus&amp;lt;br /&amp;gt; constructible_destructxpbonus&amp;lt;br /&amp;gt; constructible_health&amp;lt;br /&amp;gt; constructible_weaponclass&amp;lt;br /&amp;gt; constructible_duration &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if a tank takes a lot of damage and can be damaged by anything from grenades upwards, the following spawn settings would be used:&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
| class=&amp;quot;codeblock&amp;quot; | &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
example_tank&lt;br /&gt;
{&lt;br /&gt;
    spawn {&lt;br /&gt;
        constructible_class 1&lt;br /&gt;
        constructible_health 1200&lt;br /&gt;
    }&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==New Entities==&lt;br /&gt;
&lt;br /&gt;
All constructible objectives have a core set of entities which are used everytime regardless of construction configuration. Each construction objective must contain at least one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; and one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity both linked together.&lt;br /&gt;
&lt;br /&gt;
Neutral team construction objectives contain two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entities because both teams cannot own the same construction entity. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity targets both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entities.&lt;br /&gt;
&lt;br /&gt;
===func_constructible===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; is the primary entity which specifies which team can build or destroy the construction. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; is a brushwork entity and '''must''' contain an origin brush; otherwise it will cause problems with the planting of dynamite.&lt;br /&gt;
&lt;br /&gt;
When a team plants explosives next to a construction objective the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; defines where the explosives can be planted. Because some explosives have a wide damage radius be careful not to create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entities too close to each other.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity has the following keys:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| targetname:&lt;br /&gt;
| The name used in the script for referencing this entity.&lt;br /&gt;
|-&lt;br /&gt;
| scriptname:&lt;br /&gt;
|&lt;br /&gt;
The routine name in the script file.&lt;br /&gt;
|-&lt;br /&gt;
| track:&lt;br /&gt;
| Construction group function.&lt;br /&gt;
|-&lt;br /&gt;
| wait, score, health:&lt;br /&gt;
| Not used anymore (replaced with script commands).&lt;br /&gt;
|-&lt;br /&gt;
| constages:&lt;br /&gt;
| List of construction &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_brushmodel&amp;lt;/span&amp;gt; entities.&lt;br /&gt;
|-&lt;br /&gt;
| constages:&lt;br /&gt;
| List of destruction &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_brushmodel&amp;lt;/span&amp;gt; entities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The track key functions like a group name. All entities with the same track key as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; will be constructed at the same time. This is important if you want players to be warned to leave construction areas during the transparent stage of construction. If you set entities via the script to the transparent construction state then players will not get the warning message for construction.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity has the following spawnflag options:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| start_built:&lt;br /&gt;
| Starts built.&lt;br /&gt;
|-&lt;br /&gt;
| invulnerable:&lt;br /&gt;
| Cannot be destroyed by explosives.&lt;br /&gt;
|-&lt;br /&gt;
| axis_constructible:&lt;br /&gt;
| Can be built by the Axis.&lt;br /&gt;
|-&lt;br /&gt;
| allied_constructible:&lt;br /&gt;
| Can be built by the Allied.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity is not assigned to a team then the map will fail to load. If both teams are selected on the spawnflag then the default team will be Axis.&lt;br /&gt;
&lt;br /&gt;
'''Hint:''' Keep in mind that some explosives have a very wide destructive radius and can be placed some distance away from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; and still be effective at destroying the construction objective.&lt;br /&gt;
&lt;br /&gt;
===trigger_objective_info (TOI)===&lt;br /&gt;
&lt;br /&gt;
This entity is used to represent other entities (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_explosive&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;misc_commandmap_marker&amp;lt;/span&amp;gt; ) on the command map. The state of the construction objective determines what icons are displayed on the command map.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; is a brushwork entity and '''must''' contain an origin brush; otherwise it will appear half way between its current map position and &amp;quot;0 0 0&amp;quot; map position on the command map. The brushwork area of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity specifies where the player can build, a 'pliers' hint icon and an on screen message.&lt;br /&gt;
&lt;br /&gt;
Each map is limited to a maximum of '''18''' &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entities. This total usually includes command posts, health / ammo cabinets, onscreen hint areas and all constructible objectives. Some constructible objectives may '''only''' exist in certain game types. (The map 'Fueldump' hits the TOI limit)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity has the following keys:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| targetname:&lt;br /&gt;
| The name used in the script for referencing this entity.&lt;br /&gt;
|-&lt;br /&gt;
| scriptname:&lt;br /&gt;
|&lt;br /&gt;
The routine name in the script file.&lt;br /&gt;
|-&lt;br /&gt;
| shortname:&lt;br /&gt;
| Name on the command map.&lt;br /&gt;
|-&lt;br /&gt;
| objflags:&lt;br /&gt;
| Used for pulsating icons on the command map.&lt;br /&gt;
|-&lt;br /&gt;
| track:&lt;br /&gt;
| Onscreen text message for what you are near.&lt;br /&gt;
|-&lt;br /&gt;
| customimage:&lt;br /&gt;
| Replaces the default icon for both teams.&lt;br /&gt;
|-&lt;br /&gt;
| customalliedimage::&lt;br /&gt;
| Replaces the default icon for the allied team only.&lt;br /&gt;
|-&lt;br /&gt;
| customaxisimage:&lt;br /&gt;
| Replaces the default icon for the axis team only.&lt;br /&gt;
|-&lt;br /&gt;
| infoAxis/infoAllied:&lt;br /&gt;
| Not used anymore, do not use.&lt;br /&gt;
|-&lt;br /&gt;
| score:&lt;br /&gt;
| Replaced with script commands.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity has the following spawnflag options:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| axis_objective:&lt;br /&gt;
| Only works with '&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_explosive&amp;lt;/span&amp;gt;' entities.&lt;br /&gt;
|-&lt;br /&gt;
| allied_objective:&lt;br /&gt;
| Only works with '&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_explosive&amp;lt;/span&amp;gt;' entities.&lt;br /&gt;
|-&lt;br /&gt;
| tank:&lt;br /&gt;
| Will use a tank icon on the command map.&lt;br /&gt;
|-&lt;br /&gt;
| is_objective:&lt;br /&gt;
| Will use a standard objective icon on the command map.&lt;br /&gt;
|-&lt;br /&gt;
| is_healthammocabinet:&lt;br /&gt;
| Will use a health / ammo cabinet icon on the command map.&lt;br /&gt;
|-&lt;br /&gt;
| is_commandpost:&lt;br /&gt;
| Will use a command post icon on the command map.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity does not target any other entities it will still exist in the map. The entity will still produce &amp;quot;You are near .&amp;quot; messages and if the axis/allied objective spawnflags are set, it will still interact with explosives.&lt;br /&gt;
&lt;br /&gt;
Using the script command setstate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity can be switched on and off in the map for different game types. Once the entity has been switched off all relevant command map icons disappear as well.&lt;br /&gt;
&lt;br /&gt;
'''Hint:''' Try and keep the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity some distance away from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity, so that any Engineers building the construction cannot stand in the construction area and get killed when it's complete.&lt;br /&gt;
&lt;br /&gt;
===Single Team===&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;4px&amp;quot; align=&amp;quot;left&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[Image:singleteam_1.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
[[Image:singleteam_2.jpg]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The flag and construction crates mark the location of where the Engineers can build a constructible objective. Each team has specific skins for the flag and construction crates so that they are easily recognisable by all players.&lt;br /&gt;
&lt;br /&gt;
''Construction crates and skins:'' ( &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;misc_gamemodel&amp;lt;/span&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
models/mapobjects/cmarker/cmarker_crates.md3&amp;lt;br /&amp;gt; models/mapobjects/cmarker/axis_crates.skin&amp;lt;br /&amp;gt; models/mapobjects/cmarker/allied_crates.skin&lt;br /&gt;
&lt;br /&gt;
''Flag and skins:'' ( &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;misc_gamemodel&amp;lt;/span&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
models/mapobjects/cmarker/cmarker_flag.md3&amp;lt;br /&amp;gt; models/mapobjects/cmarker/axis_cflag.skin&amp;lt;br /&amp;gt; models/mapobjects/cmarker/allied_cflag.skin&lt;br /&gt;
&lt;br /&gt;
Additional key/values for the flag model:&lt;br /&gt;
{|&lt;br /&gt;
| modelscale:&lt;br /&gt;
| 0.4&lt;br /&gt;
|-&lt;br /&gt;
| frame:&lt;br /&gt;
| 0.4 (Total amount of animation frames)&lt;br /&gt;
|-&lt;br /&gt;
| spawnflags:&lt;br /&gt;
| 2 (Start entity animated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The flag and construction crate models are made from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;misc_gamemodel&amp;lt;/span&amp;gt; entities with targetname and scriptname keys so that they can be referred to by the script.&lt;br /&gt;
&lt;br /&gt;
Create a rough set of clip brushes which mirror the shape of the construction crates model. Then create an origin brush, select all the previously created clip brushes and converted them into a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_static&amp;lt;/span&amp;gt; entity. Select the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_static&amp;lt;/span&amp;gt; entity and set the targetname and scriptname keys so that it can be referred to by the script.&lt;br /&gt;
&lt;br /&gt;
Create the constructible objective from brushwork and position it a reasonable distance from the construction crates model. Create an origin brush, select the constructible objective brushwork and convert into a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If you want to create the constructible objective from a model then use clip brushes for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; instead. It's important that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity is made from brushes because the explosive's radius has to hit something.&lt;br /&gt;
&lt;br /&gt;
Select the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity and set the targetname and scriptname keys so that it can be referred to by the script and targeted by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity. Set the spawnflags to the relevant team which can construct the objective. (Only one team should be selected.)&lt;br /&gt;
&lt;br /&gt;
Finally create a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; brushwork entity around the construction crates model and target it at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity. Allow enough room for the Engineers to be able to move around the construction while building. Setup all the relevant keys and spawnflags for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity as [#toi documented above] .&lt;br /&gt;
&lt;br /&gt;
==Scripting== &lt;br /&gt;
&lt;br /&gt;
All constructive objectives require scripting to work. In order for Level Designers to create maps for Enemy Territory they will need to learn how to write scripts. This may be a simple case of cut and paste from the original scripts or may involve creating new script content.&lt;br /&gt;
&lt;br /&gt;
In order to explain scripting this documentation defines certain words with regards to scripting. Wherever possible certain words/phrases have been hyperlinked to a glossary.&lt;br /&gt;
&lt;br /&gt;
Here follows a quick primer on the how, where and what of scripting. This is by no means a complete guide to scripting but all of the maps that come with the original game do have script files which can be used as examples. Open them up and have a look .&lt;br /&gt;
&lt;br /&gt;
===Back to Basics=== The script file is located in the maps directory with a &amp;quot;.script&amp;quot; file extension. The script filename has to be the same as the map filename. (Eg. 'oasis.bsp', 'oasis.script')&lt;br /&gt;
&lt;br /&gt;
The script file is made up of routines which define what various entities do and how they react to game events. Each entity in the map has the possibility to run a routine in the script file. To enable an entity to run a routine in the script file it needs a targetname and scriptname key with relevant values.&lt;br /&gt;
&lt;br /&gt;
For example: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;targetname&amp;lt;/span&amp;gt;, &amp;quot;alliedmgnest&amp;quot; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;scriptname&amp;lt;/span&amp;gt; , &amp;quot;alliedmgnest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
It's recommended that the targetname and scriptname values are the same so it's easier to debug the script and map for possible errors. (Technically not all of the entities require the targetname and scriptname keys to be defined but it's recommended)&lt;br /&gt;
&lt;br /&gt;
Each entity routine is broken down into functions which are triggered by various game events. For example: The function spawn is triggered when the entity is spawned into the map at the beginning of the game.&lt;br /&gt;
&lt;br /&gt;
Certain functions exist for all entities regardless of what type they are. The standard functions are spawn, trigger, pain and death. Some entities have further functions which are specific to what they can do in game.&lt;br /&gt;
&lt;br /&gt;
The script can run several entity routines at once, but each routine can only run one function at once. For example if any function uses a wait command it will stop all other functions for that entity routine. Because of this limitation several entities maybe required in order to perform several tasks at once.&lt;br /&gt;
&lt;br /&gt;
Each entity routine can use / define up to 8 local variables. These local variables cannot be referenced outside of the defining routine. The script system also supports up to 10 global variables which can be used / referenced by any routine / function in the same script.&lt;br /&gt;
&lt;br /&gt;
Script variables can be used to store values which can determine if game events have been completed or what state they are currently in. For example in the map 'Radar' a variable is used to count the total amount of radar parts taken from the axis base.&lt;br /&gt;
&lt;br /&gt;
===Construction Script Functions===&lt;br /&gt;
&lt;br /&gt;
The func_constructible entity has 5 basic functions as defined below:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| class=&amp;quot;code&amp;quot; valign=&amp;quot;top&amp;quot; | spawn:&lt;br /&gt;
|&lt;br /&gt;
This function is run the first time upon starting the map. All spawn functions should have a wait command before processing any other commands because not all entities are initially ready when the map is first loaded.&lt;br /&gt;
&lt;br /&gt;
All constructible items in Enemy Territory must setup their construction class when they spawn. This determines how much 'charge bar' time to be used while constructing. (There are currently 3 types of [#conclasses construction classes] defined.)&lt;br /&gt;
&lt;br /&gt;
The construction materials should be made visible (default) and the main construction elements made invisible.&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;code&amp;quot; valign=&amp;quot;top&amp;quot; | buildstart:&lt;br /&gt;
|&lt;br /&gt;
This function is called once the construction has been started. The various construction elements are set up to be displayed in a translucent state. This shows all players where the construction is going to be built.&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;code&amp;quot; valign=&amp;quot;top&amp;quot; | built:&lt;br /&gt;
|&lt;br /&gt;
This function is called once the construction has been finished. All construction materials are made invisible and the main construction elements are visible.&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;code&amp;quot; valign=&amp;quot;top&amp;quot; | decayed:&lt;br /&gt;
|&lt;br /&gt;
If the construction has not been touched by an engineer for 30 seconds (current default) then this function is called. The construction elements are made invisible. If this function is not defined then the construction will remain in a translucent state.&lt;br /&gt;
|-&lt;br /&gt;
| class=&amp;quot;code&amp;quot; valign=&amp;quot;top&amp;quot; | death:&lt;br /&gt;
|&lt;br /&gt;
This function is called once the construction has been destroyed. All construction materials are made visible and the main construction elements are made invisible.&lt;br /&gt;
&lt;br /&gt;
If the construction involves a MG entity then it must be repaired by the script at this point. If the MG entity was damaged during the destruction of the construction object then the MG will be built in a damaged state.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The backbone of the construction system is one script command called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;setstate&amp;lt;/span&amp;gt; . This command allows entities to be switched into 3 different states of 'default / invisible / underconstruction'. Combined with the various functions defined above the construction system is not overly complex to setup.&lt;br /&gt;
&lt;br /&gt;
==Neutral Team==&lt;br /&gt;
&lt;br /&gt;
A neutral construction is no different to a single stage construction except there is one for each team, both linked to one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity can only be associated to one team so neutral constructions need two constructible entities.&lt;br /&gt;
&lt;br /&gt;
It is recommended that both team constructions are different so that the players can easily tell from a distance who built the construction in the first place. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;trigger_objective_info&amp;lt;/span&amp;gt; entity controls which &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; is built and which script routine is active.&lt;br /&gt;
&lt;br /&gt;
==Multiple Stages== &lt;br /&gt;
&lt;br /&gt;
The construction system can support up to 3 different stages for construction (stage1, stage2, final) and 2 different stages for destruction. Depending on which happens to the func_constructible depends on which stage will be active as the diagram below illustrates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:construct.jpg]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The best way to make a multiple staged construction is to create the final object first and set it up like a single staged construction. Once you have a single stage construction working then add more stages to it.&lt;br /&gt;
&lt;br /&gt;
Multiple stage constructions use two new keys for the func_constructible entity.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| constages:&lt;br /&gt;
| List of construction &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_brushmodel&amp;lt;/span&amp;gt; entities.&lt;br /&gt;
|-&lt;br /&gt;
| constages:&lt;br /&gt;
| List of destruction &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_brushmodel&amp;lt;/span&amp;gt; entities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All additional construction/destruction stages need to be setup as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_brushmodel&amp;lt;/span&amp;gt; entities with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;targetname&amp;lt;/span&amp;gt; key. The value of the targetname key will appear in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;constages&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;desstages&amp;lt;/span&amp;gt; lists.&lt;br /&gt;
&lt;br /&gt;
For example if the construction stage 1 and 2 entities have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;targetname&amp;lt;/span&amp;gt; key values of 'constage1' and 'constage2', then the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;constages&amp;lt;/span&amp;gt; key for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; will have a value of 'constage1;constage2;'&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;constages&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;desstages&amp;lt;/span&amp;gt; lists must be separated by semicolons and have no spaces. Only need to use these keys if creating multiple stage constructions.&lt;br /&gt;
&lt;br /&gt;
Wherever the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; is in the map, all the construction/deconstruction stages will appear as well. It does not matter if you create the stages elsewhere in the map or at the same space, all stages will be displayed at the same location.&lt;br /&gt;
&lt;br /&gt;
The last stage in a multiple construction is always referred to as 'final' in the script. If you are only creating a 2 stage construction then the script will use 'stage1' and 'final' only.&lt;br /&gt;
&lt;br /&gt;
===An Example Multiple Stage Construction Script===&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
| class=&amp;quot;codeblock&amp;quot; | &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//============================================&lt;br /&gt;
// Test multiple stage construction&lt;br /&gt;
//============================================&lt;br /&gt;
constructfinal&lt;br /&gt;
{&lt;br /&gt;
    spawn&lt;br /&gt;
    {&lt;br /&gt;
        wait 200&lt;br /&gt;
        constructible_class 1&lt;br /&gt;
&lt;br /&gt;
        setstate constage1 invisible&lt;br /&gt;
        setstate constage2 invisible&lt;br /&gt;
        setstate constructfinal invisible&lt;br /&gt;
&lt;br /&gt;
        setstate desstage1 invisible&lt;br /&gt;
        setstate desstage2 invisible&lt;br /&gt;
&lt;br /&gt;
        setstate construct_stage1 default&lt;br /&gt;
        setstate construct_stage2 default&lt;br /&gt;
        setstate construct_stage3 default&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //============================================&lt;br /&gt;
    // Stage 1&lt;br /&gt;
    //============================================&lt;br /&gt;
    buildstart stage1&lt;br /&gt;
    {&lt;br /&gt;
        wm_announce &amp;quot;Stage 1 started ...&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    built stage1&lt;br /&gt;
    {&lt;br /&gt;
        setstate construct_stage1 invisible&lt;br /&gt;
        wm_announce &amp;quot;Stage 1 BUILT!&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    decayed stage1&lt;br /&gt;
    {&lt;br /&gt;
        setstate construct_stage1 default&lt;br /&gt;
        wm_announce &amp;quot;Stage 1 DECAYED!&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    death&lt;br /&gt;
    {&lt;br /&gt;
        setstate construct_stage1 default&lt;br /&gt;
        wm_announce &amp;quot;Stage 1 DEATH!&amp;quot;&lt;br /&gt;
    } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The 'constructfinal' script routine is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity. The 'constage1', 'constage2', 'desstage1' and 'desstage2' are the targetname key values for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_brushmodel&amp;lt;/span&amp;gt; entities.&lt;br /&gt;
&lt;br /&gt;
The 'construct_stage1', 'construct_stage2' and 'construct_stage3' are the construction materials. (The crates model and clip brushes)&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;90%&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
| class=&amp;quot;codeblock&amp;quot; | &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    //============================================&lt;br /&gt;
    // Stage 2&lt;br /&gt;
    //============================================&lt;br /&gt;
    buildstart stage2&lt;br /&gt;
    {&lt;br /&gt;
        wm_announce &amp;quot;Stage 2 started ...&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    built stage2&lt;br /&gt;
    {&lt;br /&gt;
        setstate construct_stage2 invisible&lt;br /&gt;
        wm_announce &amp;quot;Stage 2 BUILT!&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    decayed stage2&lt;br /&gt;
    {&lt;br /&gt;
        setstate construct_stage2 default&lt;br /&gt;
        wm_announce &amp;quot;Stage 2 DECAYED!&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    destroyed stage2&lt;br /&gt;
    {&lt;br /&gt;
        setstate construct_stage2 default&lt;br /&gt;
        wm_announce &amp;quot;Stage 2 DESTROYED!&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //============================================&lt;br /&gt;
    // Stage 3&lt;br /&gt;
    //============================================&lt;br /&gt;
    buildstart final&lt;br /&gt;
    {&lt;br /&gt;
        wm_announce &amp;quot;Stage 3 started ...&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    built final&lt;br /&gt;
    {&lt;br /&gt;
        setstate construct_stage3 invisible&lt;br /&gt;
        wm_announce &amp;quot;Stage 3 BUILT!&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    decayed final&lt;br /&gt;
    {&lt;br /&gt;
        setstate construct_stage3 default&lt;br /&gt;
        wm_announce &amp;quot;Stage 3 DECAYED!&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    destroyed final&lt;br /&gt;
    {&lt;br /&gt;
        setstate construct_stage3 default&lt;br /&gt;
        wm_announce &amp;quot;Stage 3 DESTROYED!&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Each stage has four functions which are run depending on the state of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;func_constructible&amp;lt;/span&amp;gt; entity. Some of the functions in this example script don't actually do anything but are included so that you can use them if you want.&lt;br /&gt;
&lt;br /&gt;
The final stage of construction is always called 'final', so if you require only 2 stages of construction then only use 'stage1' and 'final' sections of the above sample script.&lt;br /&gt;
&lt;br /&gt;
[[Category:WET Documentation]]&lt;/div&gt;</summary>
		<author><name>192.168.0.151</name></author>
		
	</entry>
</feed>