Home   Help Search Login Register  

Author Topic: Shrapnel... got an idea  (Read 997 times)

0 Members and 1 Guest are viewing this topic.

Rubble_Maker

  • Guest
Shrapnel... got an idea
« on: 17 Dec 2002, 10:50:22 »
Hi!

I recently wrote a script that simulates Hydra rockets with a shrapnel warhead (very effective against infantry). It works fine so far, but I cant create too many shrapnels coz the CamCreate/CreateVehicle is pretty slow. So here's my idea which I'm not sure anybody else thought of already; also not sure if its possible at all: In my mission I keep around a 'bullet pool', i.e. an array of camcreated bullets which is constantly filled up to a certain size (say, 200 bullets). These bullets are camcreated at [0,0,0] so you'll never see them, and they have gravity=0 so you can keep em around for as long as you want. Now when a flechette blows up, it grabs the bullets it needs from the pool and places them at the desired location, also adding velocity vectors to fling 'em around. This will reduces lag as the bullets are camcrated not all at once. Instead a buffer is constantly (slowly) filled in background, which will prolly not introduce any lag at all.

Anyways some thoughts...

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Shrapnel... got an idea
« Reply #1 on: 17 Dec 2002, 17:01:27 »
Okay, here's my opinion:
maybe.
A. First, you have a problem.  Bullets use the simulation ShotBullet.  After two seconds, the simulation terminates, and with it the bullet -- regardless of whether it hits anything.  You _could_ use ShotShell, in which case the simulation lasts 20 seconds, but ShotShell actually draws the shell, which means an even greater poly load.
B. Second, I doubt the juice drain is coming from the camcreates.  More likely, it's coming from the collision detection, graphics engine (maybe) and sound effects.
C. Don't use CreateVehicle for shrapnel.  In multiplayer, you don't have the bandwidth to do this (you don't have the bandwidth to setpos either).
D. When shrapnel was brought up a while ago, I muttered something about claymores.  Now you can get the CoC_Mines addon, and see how Jostapo and I solved many of these problems.  The .pbo will unpack with pbotool, we've doc'd and commented the scripts, and you can use it as long as you give us credit for the code you use and use it only for OFP and only for non-commercial purposes.

E. From our experience, 200 pieces of shrapnel is about the limit
Dinger/Cfit

Rubble_Maker

  • Guest
Re:Shrapnel... got an idea
« Reply #2 on: 18 Dec 2002, 16:30:39 »
Thx for the reply Dinger; thats lotsa new info for me.

You prolly righ about MP; I only tested my scripts in SP so far. So if possible I'd like to use your COC thingy. Where can I DL it?

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Shrapnel... got an idea
« Reply #3 on: 18 Dec 2002, 18:07:19 »
It's bundled with NP2.  It should be downloadable as a separate addon over at www.thechainofcommand.net, but I don't think it's been put up yet.

(Edit: fixed the link)
« Last Edit: 19 Dec 2002, 15:46:03 by Dinger »
Dinger/Cfit

Wolf

  • Guest
Re:Shrapnel... got an idea
« Reply #4 on: 18 Dec 2002, 18:12:54 »
Forgive my ignorance, but what is NP2?
And where else can one get that claymore addon? as that site is not up yet?

Offline KTottE

  • Former Staff
  • ****
Re:Shrapnel... got an idea
« Reply #5 on: 18 Dec 2002, 21:23:52 »
NP2 = Nampack 2.0

A set of Vietnam units made by STT, Ebud, Bibmi and Eviscerator.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Shrapnel... got an idea
« Reply #6 on: 19 Dec 2002, 15:50:04 »
I'll see what I can do to get the things released separately as soon as possible.
Dinger/Cfit