Script 4U: a cool parametric minefield
Posted: Fri Aug 01, 2003 3:52 pm
Hello, world.
Here is my first real contribution to the mapping comunity. I hope nobody came out with this thing before...
I create a global script, you can download it here:
valoche_magic.pk3
I copy/pasted the header of the global script included in the pk3, here it goes... It's self explanatory.
Let me know if you like it.
Valoche
// 1- MINEFIELD v1.0
// =================
// A new sort of minefields. The minefield can be walked through
// provided you avoid the mines, defuse them, or make them blow up
// with a grenade or a bazooka.
//
// Features:
// ---------
// a) Walk on mine: you hear a "click", and it blows up 0.5 seconds later,
// doing the following damage:
// - 50 within 4.8 meters (250 world units)
// - 20 between 4.8 and 6.7 meters (250 and 350 world units)
// - 5 between 6.7 and 8.5 meters (350 and 450 units)
// b) Send a grenade or shoot with a bazooka: all the mines affected by the
// explosion blow up.
// c) You can defuse a mine by getting close to it and pressing the "use" key/button.
// It takes 2 seconds to defuse a mine. You'll get a neat defuse sound, and a little
// smoke effect.
//
// To create a minefield, follow this tutorial:
// --------------------------------------------
// a) Create a brush, convert it to a script_object (RCLICK/script/object)
// b) Give it a targetname, for example: $targetname / minefield1
// c) Give it the following keys:
// - #x / X size as displayed in MOHradiant (press SHITF+Q if you don't see it)
// - #y / Y size as displayed in MOHradiant (press SHITF+Q if you don't see it)
// - #z / Z size as displayed in MOHradiant (press SHITF+Q if you don't see it)
//
// d) In the map's script file, add the following line:
// <script_object> thread global/valoche_magic.scr::mines_setup <# mines>
// For our example, it could be:
// $minefield1 thread global/valoche_magic.scr::mines_setup 70
// That would spread 70 mines on top of the brush $minefield1.
Here is my first real contribution to the mapping comunity. I hope nobody came out with this thing before...
I create a global script, you can download it here:
valoche_magic.pk3
I copy/pasted the header of the global script included in the pk3, here it goes... It's self explanatory.
Let me know if you like it.
Valoche
// 1- MINEFIELD v1.0
// =================
// A new sort of minefields. The minefield can be walked through
// provided you avoid the mines, defuse them, or make them blow up
// with a grenade or a bazooka.
//
// Features:
// ---------
// a) Walk on mine: you hear a "click", and it blows up 0.5 seconds later,
// doing the following damage:
// - 50 within 4.8 meters (250 world units)
// - 20 between 4.8 and 6.7 meters (250 and 350 world units)
// - 5 between 6.7 and 8.5 meters (350 and 450 units)
// b) Send a grenade or shoot with a bazooka: all the mines affected by the
// explosion blow up.
// c) You can defuse a mine by getting close to it and pressing the "use" key/button.
// It takes 2 seconds to defuse a mine. You'll get a neat defuse sound, and a little
// smoke effect.
//
// To create a minefield, follow this tutorial:
// --------------------------------------------
// a) Create a brush, convert it to a script_object (RCLICK/script/object)
// b) Give it a targetname, for example: $targetname / minefield1
// c) Give it the following keys:
// - #x / X size as displayed in MOHradiant (press SHITF+Q if you don't see it)
// - #y / Y size as displayed in MOHradiant (press SHITF+Q if you don't see it)
// - #z / Z size as displayed in MOHradiant (press SHITF+Q if you don't see it)
//
// d) In the map's script file, add the following line:
// <script_object> thread global/valoche_magic.scr::mines_setup <# mines>
// For our example, it could be:
// $minefield1 thread global/valoche_magic.scr::mines_setup 70
// That would spread 70 mines on top of the brush $minefield1.