Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Multiplayer Trip Mines
Multiplayer Trip Mines
2002-09-05, 3:56 PM #1
I always prefered the strategic weapons over the brute-force weapons, just due to there shear coolness. Tripmines are by far one of my favorites of all time. Seldom are they useful in a game though, because of their gameplay restrictions and the way the levels are built. In comparsion though, JK would be perfect for Tripmines. Pleanty of maps have nice, small winding corriders or small shafts that are prefect for hiding a tripmine.

After seeing the Tripmine in the 'Enhancement Pack 2.0' I was duely impressed. The only problems were you could only use ONE. Then I discovered they also weren't multiplayer. I was pretty upset, those would be a tight addition to almost any game.

I spent quite a bit of time tearing about that tripmine, and I got down almost all of how it worked. But no matter what I did, I was unable to build a multiplayer version. And I -KNOW- Its possible. Its just tricky.

From what I could tell, the Tripmine from the Enhancement pack was pretty straight forward. The mine fires a 'traplaser', which dies when it hits a player or surface. When it dies, it checks its distance with the placed mine (stored in bin 130 on the local player) and if it doesn't equal the last checked distance (stored in bin 132 on the local player) it uses a sendmessage to the weapon cog to trigger the detonate. Lot of work.

Now, I was able to reproduce almost all of this with client cogs and such.. But the only problem is remembering WHICH MINE fired the laser in the first place. The catch is: The mine fires the laser. The laser hits a wall and creates the 'glow'. The glow can't tell which mine fired it, because it wasn't mine fired. It was 'fired' from the laser when it died. Now, I did try using the GetParentThing twice, once for the laser, then to the mine. Doesn't work.

Anybody have any thoughts on how someone could do this? I like the Enhancement Packs style better than a FirstThinginView because ANYTHING that interrupts the beam trips the mine, doors, actors, crates, etc. Not just players/actors and such. I think this would make a tight multiplayer weapon, I just can't figure out how to keep the mines straight.
2002-09-06, 2:12 PM #2
Awww, Crap.

I got really close, then I discovered if you get more than 5-6 of the mines in play at a time, the lasers don't work right. The game can't handle the shear number of projectiles involved in creating the solid laser beams. Even over extremely short distances. Bah.

Oh well. And I was like two steps away from the first successful version. I got one question now, since I spent two hours working on it: How can a projectile templates cog tell if it 'died' before the remove code? By time it hits 'removed', Its seems to no-longer be there, I can't run the distance checks by that point.
2002-09-08, 11:51 AM #3
When removed is called, the thing being removed still exists and retains its status. The removed code has time to run before the thing is taken from the game.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-09-08, 5:45 PM #4
Really? Hmm. Thats odd. In my routines, I wasn't able to lookup the thing parent or check the GetThingUserData right. *Shrugs* I probably fuggered one of my checks.. Oh well. I'm just going to move on and throw in a huge cannon instead. Kinda cliche, but whatever. Only the first edition anyhow.
2002-09-09, 5:53 AM #5
Post your removed message code.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-09-09, 9:06 AM #6
I have working laser trip mines for my current project. I had been working on them on and off for almost a year before I was able to get them working, I actually woke up in the middle of the night with an idea and got it to work. I was extremely proud when I finally got them working...as nerdy as that sounds. But I'd actually written it off as impossible, at least in the capacity that I wanted it more then once.

Mutliple mines can be placed...an unlimited number in fact (within reason) and they will work seperately. Mines do not use a trail laser becuase it creates an extremely high thing count, and although I have created in game provisions to work around the 200 thing limit, you would only be able to place a limited number of mines with it.

The problems you have encountered, I encountered as well. The player bin isn't a good way to do the mine for a variety of reasons, the least of which is that it limits you to only one mine, and the variable isn't global. I actually had come up with a lot of potential methods to make them work, all of which failed. Getthingparent() didn't work since it kept getting the player. That had to do with the fact that explosions are automatically assigned their corresponding projectiles parent as their parent as well. I had a 'fire back' method that was semi successful, but wasn't exact enough for my taste. On fleshhit it would create a projectile facing the opposite direction which would hit the mine from which it came and create a small triggering explosion on impact. But one can obiously see there is a large potential for error there.

Its been awhile since I edited so I can't really remember exactly how it was implemented...since I don't have any of my stuff on this school computer. But it did make use of the removed message, and a special projectile that created an explosion on fleshhit only I believe. However, I don't think that was all there was to it...since I remember struggling with it more from there. I'll have to dig through my files when I get home.
2002-09-09, 12:26 PM #7
Okay, Good. That verifies it. I wasn't sure if I fuggered a command or check somewhere, or if it was really grabbing the player with the GetThingParent. Good, its not my fault that time [http://forums.massassi.net/html/wink.gif]

Well, I'm glad someone managed to get that working. Lemme know when you release that project, I can't wait to slaughter someone with a tripmine!
2002-09-09, 2:02 PM #8
For a full description of thing parents and how they work, read the DataMaster's section notes for Thing Property Verbs.

[This message has been edited by SaberMaster (edited September 09, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-09-19, 2:03 PM #9
The easiest way of doing this is to use the sequencer cog and tweak it. Remove the proximity and the timer and have it so that when you touch a laser beam, it will trip the mine. Make the laser beam template a ghostthing so that you dont stop moving when you touch it.

Works for me [http://forums.massassi.net/html/biggrin.gif]
2002-09-19, 7:16 PM #10
...

I understand that much. The problem is how to tell WHICH Mine to trigger when you hit a laser. If yours works so well, care to explain how you pulled that off? I still haven't been able to get that one to work yet.
2002-09-20, 3:46 AM #11
It has to be a limited number.
Code:
Fire: message area
mine = FireProjectile(bla,bla,bla);
i = i + 1;

Down in touched: message

DestroyThing(mine[GetSenderRef()]);


Kinda like that, I guess.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-20, 9:38 AM #12
Or you could use something like:

Code:
SetThingUserData(laserThing, mineRef);


That way each laser projectile would know which mine it was fired from. And Pilot, using DestroyThing(mine[GetSenderRef()]); will crash.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-09-20, 1:23 PM #13
GetSoucreRef() then, right? Or does that kind of thing just crash?

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-20, 2:21 PM #14
I cant do the UserData thing. The laser never does anything, its the 'explosion' generated when it collides with something. I'd have to somehow set the UserData on the 'glow' or laser explosion itself.
2002-09-21, 4:03 AM #15
Try something like this: the player fires a mine. The player will be the parent of the mine and kills from the mine's explosion will go to that player. The mine creates a laser and sets the laser's userdata to its thingref. The laser will be its own parent, and the laser's explosion things will be able to find the laser with GetThingParent(). Once you have the laser, you can get the mine from its userdata and the mine's class cog.

That method is complicated, and there will no doubt be problems implementing it, but it's worth a try. [http://forums.massassi.net/html/wink.gif]

Pilot, the problem with your code is that you're trying to use a thing number as an array index number. If, for example, the thing number was 140, then the cog would attempt to find mine[140] in the symbols, and that would crash. To find out which mine in the array was touched, you have to search through the mine array looking for the touched message's senderref.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!