- Quick Links -


Jedi Knight modifying site

Visitor No.72282
Since July 1999

Theme :

Massassi Temple MILLENNIUM
LucasArts Entertainment Company

- Random Picture -

Enhancement Pack 2.1

Enhancement Pack 2.1

Forum Projects Documents Features Extra Links
Making a Trip Wire Mine

DOWNLOAD


1

Now this tutorial will tell you how to make a trip wire mine. (a mine with laser that blows up when passed by) And before you go on, you have to know that this doesn't work in multiplayer.


2

To get that done, here is the rough method. First you place a mine, the mine will launch beams directly above it, so if you stick it on walls, it is ready to trip people.

The beam will use the laser pointer method, which you can read on how to make from the link here.


3

On how to detonate the mine when passed by, I used created message. Touched message sounds like the one, but the trailthing, which is used for laser doesn't really send touched message well, so I placed an alternative method.

The cog should be read like this, place a mine, put the mine ID into a global variable, which using a new bin is the best. Retrieve the length from the mine to the wall on the opposite side, since it's a laser, the explosion from the laser which is created on the other side of the wall is created every seconds.

Check if the distance from the wall is different or the same, if different, that means something passed over the beam, causing the explosion to be created on the "passed" which will return a shorter distance from the mine to the wall.

So make it explode when that happens.


4

Ok, it might sound confusing, but will be explained as I go through the cog.

First you need a mine cog, which I just ripped from sequencer cog from JK. This cog will launch beams and another cog will detect the length between the wall and the explosion and a few editings on the items.dat and static.jkl and that should do.

Open up the weap_seqcharge.cog and add a few lines that will create the trip laser, like this. And make sure to take away the original FireProjectile() line as it's already included in here.

This will create the mine once pressed, the next time pressed it will detonate. Or will it blow up if not pressed in 30 seconds or otherwise when someone passes by the beam, which will be covered later.

The beam will be launched in a few seconds, so it will not blow up when you try to drop it. It will store the mine ID into a bin, so it can be blown up from a different cog and another is used to know if the distance is set for check or not.

   if(!Dropped)
   {
      projectile = FireProjectile(player, projectile_tpl, -1, 16, '0 0.05 0.00', '0 0 0', 1.0, 0, 0.0, 0.0);
      SetTimerEx(30, 3, 0, 0);
      jkPlayPOVKey(player, povfireAnim, 1, 0x38);
      ChangeInv(player, 8, -1);

      SetInv(player, 130, projectile);
      SetInv(player, 131, 1);
      SetTimerEx(2, 0, 0, 0);
   }
   else call user0;

   Dropped = 1 - Dropped;

Let's place the timer message, so it will blow up and ready to be placed again in 30 seconds. Place the following line in the timer message, and do not let it be confused with other timers, I've used timer ID 3 and 0 in the above script.

   if(GetSenderID() == 3) call user0;
   else
   if(GetSenderID() == 0) SetThingPulse(projectile, 0.01);

5

Now time for making the trip laser. For the trip laser model, use the laser pointer but make the beam to whatever color you wish, while I used a translucent light blue, which can be found in the resource below.

You have to make a new template for the trip wire laser, which has the following attributes. It has to have a cog assigned which I will rename as "triplaser.cog" and a trailthing so it looks a like a beam. Once done, open a new blank cog, and fill it in with the following codes, so it blows up the mine upon detection of different distance.

   created:

   player = GetLocalPlayerThing();
   glow = GetSenderRef();

   Dist = VectorDist( GetThingPos(glow), GetThingPos(GetInv(player, 130)) );
   Dist_Round = Dist * 100000;

   if(GetInv(player, 131))
   {
      SetInv(player, 132, Dist_Round);
      SetInv(player, 131, 0);
   }
   else
   if(Dist_Round != GetInv(player, 132)) SendMessage(GetInvCog(player, 8), user0);

This cog will detect and destroy the mine, and it sends a message upon activation, so add "user0" message in the weap_seqcharge.cog with the following line to make sure the player will drop and not detonate again next time pressing.

   user0:

   Dropped = 0;
   SetLifeLeft(projectile, 0.01);
   KillTimerEx(3);

   return;

Let's place the pulse message to fire the trip laser before we forget in the pulse message in the weapon cog.

FireProjectile(projectile, trap, -1, -1, '0 0 0.1', '90 0 0', 1, 0, 0, 0);

This is all with cogging.


6

A few notes before we go on, make sure the mine template (use the secondary fire mine template but rename it the same as the primary mine) has a life that is longer than 30 seconds, which is defined as "timer" in the static.jkl (you have to cut and paste from master.tpl from JED) and the name of the laser template is defined the same as you put all the symbols section.

So does the name of the 3do for the beam.


7

Now I will roughly explain what to do with the templates, you just cut and paste the template for the mine from master.tpl and make the life longer, so it just doesn't suddenly blow up before 30 seconds and a new entry for the laser beam is needed, and is described in the laser pointer tutorial, but with a cog assigned as the one you just made and 3do for the new beam.

For items.dat, make 3 new entries, I used 130 to 132, make the max as big as you can for 132 but around 1000 max for the other 2, so it works. And give all symbols in the cogs. This will place a new mine and launches beam and when you pass it, it blows up.


Resources

weap_seqcharge.cog

tripwire.cog

items.dat

laser.3do

laserb.mat

static.jkl


Forum Projects Documents Features Extra Links

Top - Home - Back

PHP Apache Valid XHTML 1.0! Valid CSS!

This site is developed using PHP under Apache server
with XHTML, JavaScript, CSS and Cookie technology.

Certain parts of this site require Cookie support.

This site is best viewed with Internet Explorer 5.5, Netscape 6.0, Opera 6.0 or Mozilla 1.0 and above
at resolution 800 * 600 and higher.

Nothing on this site is made, distributed, or supported by LEC.
Please use and download all materials at your own risk.

© 1999-2004 Hideki.

This page was last modified on Sat, 30 Jul 2011 17:28:41 +0000.