Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785

Warning: Division by zero in /home/g/gronnevik/gronnevik/gronnevik.se/www/rjukan/index.php on line 785
The Rjukan Project - Main - ObjectiveExplosion

Menu

Wiki usage

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
Edit Sidebar
Main > ObjectiveExplosion

Blow up that multiplayer objective, tutorial

There are a bunch of tutorials on blowing objectives... they mostly tell you half the story. I will try to be more complete.

This tutorial requires a bit of scripting and ParametersOnEntities? and configuring entities, so if you have no idea what those words mean, try to learn that first.

Oh yeah, you'll probably want to put the objective somewhere, so I recommend building a map, made up only of one small room ( To minimize compile times while you are learning ).

This tutorial includes a complete set of .map .bsp and .scr files, that can be downloaded here: Attach:cust_obj_test.zip ( 20 kb ).

A multiplayer objective destruction is made out of a number of parts:

On this page...

So lets start from the top.

Making a bomb

Create a script_model ( with nothing selected, right click on the map grid and select script -> model ).

Give it these key-value pairs ( with the object selected, press 'n' and enter the key-value pairs at the bottom of the dialog :

KeyValueExplanation
#exploder_set1Id that connects all the parts of the objective. To add entities to this exploder give them the key/value #set/1.
$explosion_fxmodels/fx/fx_explosion.tikWhat explosion effect to activate when the bomb blows ( optional )
$killareagroundzeroTarget name of a trigger_multiple brush that defines the area where you will be killed by the bomb blast ( optional, if left out a default radius from the bomb will be used ). See below.
$trigger_namepanel_triggerTarget name of a trigger_use brush that defines the area where you can plant the bomb.
modelmodels/items/pulse_explosive.tikWhat model to use for the bomb ( optional, you can make your own bomb and skip this key).
targetnamepanel_bombA name used by other entities to target this entity.

By now you should have a nice black/yellow bomb before you.

Making a trigger for the bomb

Create a trigger_use ( with nothing selected, right click on the map grid and select trigger->use ).

Give it these key-value pairs ( with the object selected, press 'n' and enter the key-value pairs at the bottom of the dialog :

:

KeyValueExplanation
targetnamepanel_triggerA name used by other entities to target this entity ( the bomb above uses it ).

Reposition the trigger so that it sits around your bomb. Done.

Something to blow up

I made a control panel out of a single brush, textured with the norway/nor_panelXXX textures, but you can use any number of brushes or a model, in the same way as we set a model for the bomb ( the models/statweapons/flak88turret.tik is apparently popular ).

Select all the brushes you wish to blow up and make them a script_object ( right click on the map grid and select script->object ).

Give it these key-value pairs ( with the object selected, press 'n' and enter the key-value pairs at the bottom of thedialog :

:

KeyValueExplanation
#set1Id that connects all the parts of the objective to the bomb.
targetnameexploderTells the exploder system that this is an item that shall be destroyed.

By now you should have a doomed panel.

Blast radius calibration

Shouldn't soldiers nearby be affected by the explosion too? Well yes, the default behavior, like damage and blast radius is set in the .scr file below, but we can be more specific.

Create a trigger_multiple ( with nothing selected, right click on the map grid and select trigger->multiple ).

Give it these key-value pairs ( with the object selected, press 'n' and enter the key-value pairs at the bottom of the dialog :

:

KeyValueExplanation
targetnamegroundzeroA name used by other entities to target this entity ( the bomb above uses it ).

Reposition the trigger so that it sits around the area where the bomb should hurt / kill people. Done.

Fire and brimstone shall rain!

We want some wicked fire and sound FX, right? You know you want it... So lets create a chain-reaction explosion effect:

Create two script_model's ( with nothing selected, right click on the map grid and select script->model ).

Place them close to the bomb and give both of them these key-value pairs ( with the object selected, press 'n' and enter the key-value pairs at the bottom of the dialog :

:

KeyValueExplanation
#set1Id that connects all the parts of the objective. To add entities to this exploder give them the key / value #set / 1.
modelmodels/animate/fx_explosion_tank.tikWhat model to use for the explosion effect.
targetnameexploderfireTells the exploder system that this is an item containing special FX.

Give one of the script_model's this value:

KeyValueExplanation
#pause0.5Delays the explosion FX to 0.5 seconds after the bomb goes of.

By now you should have a funky, two stage explosion.

Throwing debris out of the explosion.

We are not talking debris from the explosion FX here, but the thing you are blowing up breaking apart and getting hurled in all directions. It will not break apart by itself; you will have to make the debris by yourself ( or select a model ).

I copied the panel and split the copy in four pieces.

Select all the brushes one by one and make them script_object's ( right click on the map grid and select script->object ).

Give them these key-value pairs ( with the object selected, press 'n' and enter the key-value pairs at the bottom of the dialog:

KeyValueExplanation
#set1Id that connects all the parts of the objective to the bomb.
targetnameexploderchunkTells the exploder system that this is an item that shall be hurled when the bomb is blown.

Place the pieces a bit outside the panel ( don't worry, the exploder system will hide them until the bomb blows ).

Were to throw the debris?

Create a script_origin ( with nothing selected, right click on the map grid and select script -> origin ) for each piece where you want it to be hurled ( Remember: It will start in that direction, and then be drawn towards the ground as gravity takes over ).

Unselect everything, select first the piece then the script_origin, then press CTRL+k ( this konnects the entities. Order is important ). You can also set the targetname of the script_origin and then set the target key of the piece to the same value ( using CTRL+k gives targetnames like t3, and that can be hard to debug ).

You should now have some debris that point a blue arrow towards one red box each.

Something left after the explosion?

Sometimes there is a need for something to remain after the explosion. A twisted Flak88, a nice wall turns into a smoking hole...

Construct what remains after the explosion. Select the blown up remains and make them a script_object ( right click on the map grid and select script->object ).

Give the selection these key-value pairs ( with the object selected, press 'n' and enter the key-value pairs at the bottom of the dialog:

KeyValueExplanation
#set1Id that connects all the parts of the objective to the bomb.
targetnameexplodersmashedTells the exploder system that this is an item that shall replace the exploder object after it has been destroyed.

That's what will replace the panel after the explosion.

Last but not least: some scripting

Here is the script for the objective map.


 // Custom objective test map
 // ARCHITECTURE: Bjarne Grönnevik
 // SCRIPTING: Bjarne Grönnevik
 main:
   setcvar "g_obj_alliedtext1" "Destroy the control" 
   setcvar "g_obj_alliedtext2" "panel"
   setcvar "g_obj_alliedtext3" ""
   setcvar "g_obj_axistext1" "Defend the control"
   setcvar "g_obj_axistext2" "panel"
   setcvar "g_obj_axistext3" ""
   setcvar "g_scoreboardpic" "none"
   level waittill prespawn
   exec global/DMprecache.scr
   level.script = maps/obj/cust_obj_test.scr
   exec global/ambient.scr cust_obj_test
   // Initialize the exploder subsystem
   thread global/exploder.scr::main
   level waittill spawn
   // Axis like the bombs unplanted
   level.defusing_team = "axis
   // Allies will try to plant the bombs
   level.planting_team = "allies"
   // Number of targets in this map
   level.targets_to_destroy = 1
   // Default damage of the bomb 
   level.bomb_damage = 200
   // Default radius of bomb blast
   level.bomb_explosion_radius = 2048
   // Set the parameters for round based match
   level.dmrespawning = 0 // 1 or 0 (0=no respawn)
   level.dmroundlimit = 5 // round time limit in minutes
   level.clockside = axis // axis, allies, kills, or draw
   // Comment out this line to be able to set the bomb
   // when alone on the map ( just for testing )
   // level waittill roundstart
   $panel_bomb thread global/obj_dm.scr::bomb_thinker
   // "panel_bomb" is the targetname of a bomb in Radiant
   thread allies_win_bom
   // Start the win check thread for allies
   // Start the win check thread for axis
   $panel_bomb thread axis_win_timer
 end // end of main

 // Allied victory test
 allies_win_bomb:
   // While undestroyed objectives left
   while(level.targets_destroyed < level.targets_to_destroy) {
     // chill out
     waitframe
   }
   // No objectives left allies win
   teamwin allies
 end // end allied victory test

 // Axis victory test
 axis_win_timer:
   // At the end Axis win
   level waittill axiswin
 end // end axis victory test

That's all you need to know to blow most of the world into tiny bits, in thy mercy...

This tutorial includes a complete set of.map .bsp and .scr files, that can be downloaded here: Attach:cust_obj_test.zip ( 20 kb ).

-Bjarne

Recent Changes Printable View Page History Edit Page [Attributes] [Printable View] [WikiHelp]
Page last modified on February 01, 2005, at 12:19 AM