Claymore mines?


(gonzoboi) #1

I’m thinking about changing the landmines to Claymore landmines. You know: rectangular little thingies that spray shrapnel forward when a hidden cable is tripped or with some other means of detonation .

I guess i could modify the landmine code to make it ‘shoot’ bullets when activated, but I’d like to implement the tripwire thing, and i’m clueless about it. do the gurus have any hint about how to do it?

i wish q3 engine had ‘linedefs’ like good old doom had.

:moo:


(Spark) #2

What do you mean with “this tripwire thing”? What exactly should it do, how would a player place it?


(gonzoboi) #3

hmm yes my wording did suck, sorry.

What i meant is, Claymore mines are usually activated by someone walking through a hidden wire, you know, put between 2 trees in a road or between 2 sides of a door threshold. But i don’t know enough about the engine stuff to determine if player is between 2 walls etc to determine whether the claymore can be placed or not.


(Spark) #4

Yes, that should be the most complicated part of this. But before you can think about possible code to solve this problem, you should think about how it should behave exactly. For example would the player have to stand right between the two walls? Would the walls need to have a certain angle or would any world object do? Etc… When I think about this problem, it seems to me that this is more of a logical problem (or a “user interface” problem), than a code problem.
In the most simple case, something like this could work:

  1. Do a short trace to the left of the player, if it hits world geometry, then
  2. do a short trace to the right of the player, if it hits world geometry, then
  3. place the mine in front of the player
  4. place a tripwire entity to the left trace position and make it point to the right trace location, link this entity with the mine
  5. make the tripwire entity do a trace into the direction it’s pointing at each frame, if it hits a player, make it’s parent entity (the mine) explode.
    Of course you’d have to check that the planter leaves the area first, so the mine doesn’t go off instantly.

(gonzoboi) #5

That sounds reasonable. I’m digging into it now.

How do i point an entity to a particular vector?


(Spark) #6

In this case you could just make it point to the right of the player.


(gonzoboi) #7

Yes, but how exactly?

Right now I’m just trying to make the claymore fire a burst of shrapnel right forward of it. But i can’t seem to find the way to do it.

From g_missile.c, in G_ExplodeMissile:

// we don’t have a valid direction, so just point straight up
dir[0] = dir[1] = 0;
dir[2] = 1;

as i understand that, it makes the explosion point upwards. What would be the way to make the mine shoot X bullets in the opposite direction of the engineer who planted it? Once i understand how to set the blast direction the rest should be easy.


(gonzoboi) #8

Mwahaha, i got an alpha claymore system now :banana: :banana:

Am i evil :clap:


(senator) #9

a possible problem I see with this design: These mines should display a tiny wire so that players can avoid them if they are carefull but it will be mighty difficult to render this wire equally visible under different screen resolutions.


(Hydra) #10

Since ‘linedefs’ are static they would be totally useless for tripmines.


(jamez) #11

claymore mines!? i see no problem with landmines anyway since the way ur working this out landmines would be more effective, whatabout a jumping jack i think it was called when it gets triggered it jumps up and fires shrapnel all around it
now that would be not only cool and easier to do but it would have an actual purpose


(Fusen) #12

ya jamez idea is nice and you have to think about playabiltiy on tripwires I means on long thin corridors your basically making it impossible for attacks


Iolite Vaporizer


(bani) #13

afaik there were no claymores in ww2, you’re thinking of vietnam. :moo:

fwiw the mine model in ET is an M16 bounding mine, aka bouncing betty. when triggered its supposed to jump about a meter into the air and explode. SD were going to make them jump but never got around to it :frowning:


(gonzoboi) #14

Gah, the mod i’m making is not set in ww2, it’ll prolly be set to 2001 or so… i want to use some of today’s guns and explosives but i don’t like all the fancy props like night vision, homing missiles, etc. i want to keep the gameplay similar but a bit more realistic (higher weapon damage, etc).

I just found about Urban Terror today, i never was into quake3 so i didn’t know about it, but after a quick check i noticed it’s sort of CS ported to quake which is not what i want.

And regarding the claymores, i ended up ditching the tripwire thing and came up with something really really funny. Stay tuned… :banana:


(sniser) #15

Maybe something that jumps, hysterically laughs, then explodes?


(Fusen) #16

maybe a jack-in-the-box which has a timer then explodes :E


Mercury monterey picture


([RW]FRED) #17

Tripmine code is present in ET, search for all sources WP_TRIPMINE terms and uncomment them.

In Realistic War Mod I did this and it’s work fine.

Regards


(Pie stealing dingo) #18

u mean like those proximity mines in the Chaos mods (for quake2 and UT afaik) that also follow u when u get near?