Creating a constructible Bridge
Now the GDF spawn have somewhere safe to spawn and some vehicles to drive. Lets give them their first objective to do! As mentioned in the Introduction and goals of the tutorial we will be creating a map with the same objectives as the Valley map. A two stage bridge like valley requires the following components:
- Constructible materials entity.
- The first bridge stage geometry.
- The second bridge stage geometry.
- The fully constructed bridge geometry.
The geometry for any stage can be made from brushes or a model. A example bridge made from brushes can be found in the etqwmap.world. It is a reference called maps/references/etqwmap/bridge.world
Contents
Constructible materials entity
This is the pile of construction materials in the world which the engineers will use to construct our bridge. Place an constructible_materials_gdf entity and name it constructible_materials_bridge.
Required keys
Add the following key pairs:
- constructed bridge_constructed
- Name of the fully constructed bridge. It will replace the first and second stages of the bridge once construction is complete.
- construction bridge_frame
- Name of the first bridge stage. Since our example is a frame allowing infantry to across, we will call it bridge_frame.
- construction_second bridge_platform
- Name of the second bridge stage. Since our example is a platform allowing vehicles to cross, we will call it bridge_platform.
- multiple_stages 1
- Tells the game our bridge has multiple stages.
- objective_index 0
- The game uses objective_index to determine which objective this is. First objective is 0, second is 1 ect.
- object_name maps/generic/bridge
- Localisation string for bridge name.
- task_name maps/valley/task_bridge
- Localisation string for bridge task.
- snd_constructing_strogg sounds/vo/strogg/nexus/objectives/bridge/constructing
- Sound shader played to the Strogg when GDF are in the process of constructing the bridge.
- snd_constructing_gdf sounds/vo/gdf/highcommand/objectives/bridge/constructing
- Sound shader played to the GDF when GDF are in the process of constructing the bridge.
- snd_intro_gdf sounds/vo/gdf/highcommand/objectives/bridge/construct/long
- Sound shader played to GDF at objective start.
- snd_intro_strogg sounds/vo/strogg/nexus/objectives/bridge/stop/long
- Sound shader played to Strogg at objective start.
- snd_reminder_strogg sounds/vo/strogg/nexus/objectives/bridge/stop
- Sound shader played to remind Strogg about the objective.
- snd_reminder_gdf sounds/vo/gdf/highcommand/objectives/bridge/construct
- Sound shader played to remind GDF about the objective.
- snd_firststage_strogg sounds/vo/strogg/nexus/objectives/bridge/constructed/firststage
- Sound shader played to Strogg when the first stage is completed.
- snd_firststage_gdf sounds/vo/gdf/highcommand/objectives/bridge/constructed/firststage
- Sound shader played to GDF when the first stage is completed.
- snd_finished_strogg sounds/vo/strogg/nexus/objectives/bridge/constructed
- Sound shader played to Strogg when the objective is completed.
- snd_finished_gdf sounds/vo/gdf/highcommand/maps/valley/bridge/success
- Sound shader played to GDF when the objective is completed.
The first bridge stage
The example in etqwmap.world is a frame allowing foot soldiers to cross. The brushes should be turned into a constructible_base entity. It is named bridge_frame to match value of the construction key on the constructible_materials_bridge entity.
The second bridge stage
The example in etqwmap.world is a ramp allowing vehicles to cross. The brushes should be turned into a constructible_base entity. It is named bridge_platform to match value of the construction_second key on the constructible_materials_bridge entity.
The fully constructed bridge
The example bridge in etqwmap.world. The brushes should be turned into a constructible_base entity. It is named bridge_constructed to match value of the constructed key on the constructible_materials_bridge entity.
Worldspawn keys
Any entities in the map which are scripted to change, such as bridge materials disappearing once the bridge is completed, are referenced using worldspawn entity keys. In the bridge reference you will see the following entity key in the worldspawn;
- merge_script_bridge_materials constructible_materials_bridge.
The following is a line from script/maps/etqwmap.script
bridgeConstruction = worldspawn.getEntityKey( "script_bridge_materials" );
As you can see, an entity in script, bridgeConstruction, is defined as the value of the worldspawn entity key that was made. Worldspawn keys in reference world files start with merge_script_*. Merge_ is removed when the map is compiled, making the key begin with script_*.