PDA

View Full Version : Proximty mine.


Euphoric Beaver
25th Oct 2001, 05:39 PM
Okay I'm not hot at coding, but I'm sort of wanting to learn because I'm playing Deus Ex and would love to make new stuff in my maps.
Anyway I thought I'd start with making a Proximity mine. :D

Now I'm still at the stage of cutting and pasting code to get effects. I managed to make the balls on the secondary fire of the shock rifle bounce off walls. :D And made the Enforcer take clips. (Needed some help on that)

Anyway back to the Proximty mine.
I haven't checked it all out yet but this was what I was thinking.

Look into the code from the trigger and see how it works out if any pawns are within it's collision distance.
Then spawn some rocket explosions if any pawns are within it's distance.

Is it really this simple to make?

Papapishu
25th Oct 2001, 06:10 PM
It's quite simple acctually, but if it's a trigger, you might wanna use it in a map...
If you want a weapon, you'd have to make a weapon that can shoot out a projectile, that, on impact, spawns a trigger...
Or just that the projectile itself is proximity sensitive...

FireSlash
25th Oct 2001, 06:17 PM
why not just set the collision cylinder to be larger? if the collosion cylinder is say 5 timers wider than the mine, if anyone comes within X distance of it, it will blow up (just code the bugger like a standard land mine)

Smoke39
25th Oct 2001, 08:05 PM
That, or I suppose you could have it do a ForEach in tick, but the collision radius is easier.

Papapishu
25th Oct 2001, 10:56 PM
That could cause trouble like the player, or projectiles collíding with the mine at that distance.
Maybe you can't shoot through it with a scan hit weapon...
Personally I'd preffer a for-loop like visibleactors or so and then do a vsize between bomb and player...

Smoke39
25th Oct 2001, 11:26 PM
Yeah, a ForEachVisibleActors (or something like that). It also makes it so you can't detonate it through walls.

Euphoric Beaver
26th Oct 2001, 04:18 AM
Damn. Thought this would be easy.
I dont even know what your talking about. :(

FireSlash
26th Oct 2001, 07:45 AM
hmm, yeah. i see where the cylinder comes into trouble. use the looped foreach, it will work a considerable amount better.

foreach VisibleCollidingActors(class<actor> BaseClass, out actor Actor, optional float Radius, optional vector Loc);

Iterates through all actors visible to this actor which have collision enabled; this is much faster than VisibleActors.

Postal
26th Oct 2001, 04:22 PM
reloading enforcers are easy, but often dont work too well, I would suggest against bothering

yea, proxy mines would be easy

TaoPaiPai
26th Oct 2001, 05:40 PM
A foreach radius inside a tick ...Hmm..I wouldn't go for that.
I'd prefer the collision rdius thing + easy tests in the touch function to see if it is a pawn who touched (or can be activated if the actor reaches a definite mass.).Then spawn a hurt radius+ effect.

FireSlash
26th Oct 2001, 06:13 PM
Originally posted by TaoPaiPai
A foreach radius inside a tick ...Hmm..I wouldn't go for that.
I'd prefer the collision rdius thing + easy tests in the touch function to see if it is a pawn who touched (or can be activated if the actor reaches a definite mass.).Then spawn a hurt radius+ effect.
the collision cylinder is still a colliding object, projectiles wouldebt be able to pass it, i think. i was thinking more like a foreach on a timer, its a bit less stressful than tick, and if your in its field less than a second your not gonna get hurt anyway ;)

SoSilencer
27th Oct 2001, 03:01 AM
foreach RadiusActors(class'classtype', i, radius)

That's what I used in a 0.05 timer and it worked great. Depending on the circumstances you could use a much slower timer (I used 0.05 because the actor calling this function moves at 6144 speed). With a stationary proximity mine that only detects player pawns (ie slow stuff) you could REALLY slow that timer down.

Papapishu
27th Oct 2001, 08:39 AM
In fact Tao is right about the foreach loop, There are faster ways.
You could use a normal for loop to itterate through all pawns instead.
It would in fact go faster even if the pawns isn't vsible...
There's always ways to tell if the pawn is visible and if there's a short distance between them...
Then BOOM!

There's never more than 16 pawns altogether (I know there can be more, but...)

I also thingk that the mine's gonna stick to the walls or ceiling or wherever you put it and that should react to damage, so that it explodes if shot at.

FireSlash
27th Oct 2001, 10:49 AM
Originally posted by SoSilencer
foreach RadiusActors(class'classtype', i, radius)

That's what I used in a 0.05 timer and it worked great. Depending on the circumstances you could use a much slower timer (I used 0.05 because the actor calling this function moves at 6144 speed). With a stationary proximity mine that only detects player pawns (ie slow stuff) you could REALLY slow that timer down.

visiblecollidingactors is much faster than radiusActors. as it skips such things as lights, and other non-colliding actors.

Papapishu
27th Oct 2001, 12:22 PM
It doesn't really matter since it takes only a specific class, like pawn, so it skips lights and other stuff anyway...
But a pawn itterator is faster.
Pawns have a nextpawn propertie, which points to the nexdt pawn in the pawnlist and it's used for high-speed applications

Lemoni
27th Oct 2001, 12:45 PM
down load agent x code it got a proxy in ther you can play with

Euphoric Beaver
27th Oct 2001, 01:28 PM
Originally posted by Postal
reloading enforcers are easy, but often dont work too well, I would suggest against bothering

yea, proxy mines would be easy

Remember I've only just started so it was big to me. :)
And the Enforcer works well. It holds 30 in a clip, but fires a bit faster. Alt-fire reloads it.

Papapishu
27th Oct 2001, 07:57 PM
Hey ciced, the word on the strees has it that they wan't a proximity mine in the BuF pack.
Waddya say, you want help making it? ;)

If you want to, maybe you can scetch out how it looks because, honestly, I can't recall... :(

Euphoric Beaver
28th Oct 2001, 06:02 AM
Thanks pap but it turns out my mod team are turning it into a sp. So I'll have to do some more mapping. Appreciated though. :D

Looks like the BuF pack will give us lot's of reference material anyway. :)

Papapishu
28th Oct 2001, 06:28 PM
Oh, right, But I'm still in right?
Anyway, here's timeset proximity mine as I see it, one that you can attach to any suface and you set a timer so that you can get out of there before it starts.
It's gonna use animated textures to show whether the device is on or off...

http://cloud.prohosting.com/gunmaker/images/proxymine.jpg
(download it yourself, the server sux...)
And while I was at it, I remembered the film Saving private Ryan (or Saving Ryans privates, as the porno-industry like to call it :D)
They used "sock-bombs" to stop the tanks.
They filled a sock with dynamite and a fuse, then they dipped it in thick oil or tar to make it stick to the tank-bands.
I thought that it micht be fun, if you throw it, it will stick to wherever it lands, and when the fuse have burned out, BOOM!
Then if you hit a pawn, you can use the same technique as when attaching the flag.
You hit them and they panic, running for their live, but there's no salvation... HEHEHE:D
Here's a pic.
It's got blue background because it was hard to see with all the tar... :)
http://cloud.prohosting.com/gunmaker/images/sock.jpg

EasyRaider
30th Oct 2001, 05:13 PM
Yep, making a proximity mine should be easy. Heck, even I could do the coding!

I once made a "smart" grenade for the Unreal Eightball. It would bounce around like normal and explode if hitting a pawn. When reaching a certain speed, it would become armed, after which it would explode when close to a pawn. But it would never explode if the owner was too close, it could hurt you, but not much, so it was pretty safe.