Proximty mine.

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Euphoric Beaver

impeccably groomed
Apr 19, 2001
3,158
0
0
Great Britain
www.euphoric-beaver.me.uk
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

我是康
Jun 18, 2001
2,043
0
0
43
void
www.vovoid.com
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

Whats a FireSlash?
Feb 3, 2001
4,300
0
0
39
Central Ohio
www.unrealannihilation.com
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

whatever
Jun 2, 2001
1,793
0
0
That, or I suppose you could have it do a ForEach in tick, but the collision radius is easier.
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
43
void
www.vovoid.com
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

whatever
Jun 2, 2001
1,793
0
0
Yeah, a ForEachVisibleActors (or something like that). It also makes it so you can't detonate it through walls.
 

FireSlash

Whats a FireSlash?
Feb 3, 2001
4,300
0
0
39
Central Ohio
www.unrealannihilation.com
hmm, yeah. i see where the cylinder comes into trouble. use the looped foreach, it will work a considerable amount better.
Code:
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.
 

TaoPaiPai

Commisaire Van Loc
Jun 13, 2000
1,626
0
0
Matnik
Visit site
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

Whats a FireSlash?
Feb 3, 2001
4,300
0
0
39
Central Ohio
www.unrealannihilation.com
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

Harry Goz (1932 - 2003)
Nov 27, 2000
834
0
0
43
unrealdev.net
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

我是康
Jun 18, 2001
2,043
0
0
43
void
www.vovoid.com
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

Whats a FireSlash?
Feb 3, 2001
4,300
0
0
39
Central Ohio
www.unrealannihilation.com
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

我是康
Jun 18, 2001
2,043
0
0
43
void
www.vovoid.com
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
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
43
void
www.vovoid.com
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... :(
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
43
void
www.vovoid.com
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