ItsMods
[Tutorial] Killtriggers - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Tutorial] Killtriggers (/Thread-Tutorial-Killtriggers.html)



Killtriggers - Yamato - 07-23-2011

Hello

Another simple gsc tutorial, this time is a command meant for mapedits, is the killtrigger, what it does is to create a death area, if you touch that area, you die, like in outside maps, Wink . The command is located in _utility.gsc, so is easy to use.

This is it:

Code:
killTrigger( position, radius, height )

An example(using classic mapedits):

Code:
Karachi() { Createwalls(blablabla); Createwalls(blablabla); [b]thread killTrigger((850,-130,596),80,1); [/b] Createblocks(blablabla); }

If you are interested in the code it uses:

Code:
killTrigger( pos, radius, height ) { trig = spawn( "trigger_radius", pos, 0, radius, height ); /# if ( getdvar( "scr_killtriggerdebug" ) == "1" ) thread killTriggerDebug( pos, radius, height ); #/ for ( ;; ) { /# if ( getdvar( "scr_killtriggerradius" ) != "" ) radius = int(getdvar( "scr_killtriggerradius" )); #/ trig waittill( "trigger", player ); if ( !isPlayer( player ) ) continue; player suicide(); } } /# killTriggerDebug( pos, radius, height ) { for ( ;; ) { for ( i = 0; i < 20; i++ ) { angle = i / 20 * 360; nextangle = (i+1) / 20 * 360; linepos = pos + (cos(angle) * radius, sin(angle) * radius, 0); nextlinepos = pos + (cos(nextangle) * radius, sin(nextangle) * radius, 0); line( linepos, nextlinepos ); line( linepos + (0,0,height), nextlinepos + (0,0,height) ); line( linepos, linepos + (0,0,height) ); } wait .05; } } #/

I find this command usefull to delete a glitch, a spot or to delete under map spots.

Nyan Cat


RE: Killtriggers - DidUknowiPwn - 11-15-2012

Was looking for this for some time now gracias.