Home   Help Search Login Register  

Author Topic: camCreate Shilka shots?  (Read 1176 times)

0 Members and 1 Guest are viewing this topic.

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
camCreate Shilka shots?
« on: 22 Sep 2003, 18:03:59 »
Just an idea....what if you attached a fired event to a Shilka & every time it shot, you nearestObject grabbed the "bullet" and deleted it, then in its place you camCreate the bullet and send it on its way.  Only one client would of course see this in multiplayer...but if the camCreated bullet hits anything, it will take damage.  Would this reduce lag when a Shilka opens up on enemies??  Or would it require too much processing power?

Thoughts?

Doolittle

Offline SickSidewinder

  • Members
  • *
  • I hump llamas
    • My New Site
Re:camCreate Shilka shots?
« Reply #1 on: 23 Sep 2003, 03:39:48 »
more lag, cuz instead of just using the bullet tragentory already encoded for the shilka, its now using an external script.  im no expert, but that sounds right to me
My site
call Marge.
Re: Horror

Knut Erik

  • Guest
Re:camCreate Shilka shots?
« Reply #2 on: 23 Sep 2003, 13:34:18 »
Just wondering  :-\

why the heck do you want to do that ??  ???
What is wrong with the shilka shots that are there allready ??

I doesn't have THAT mush experience with camcreating etc..
But if you explain why you want it, I'll be of as mush help as i can  :D
 :thumbsup:

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re:camCreate Shilka shots?
« Reply #3 on: 23 Sep 2003, 16:59:56 »
Well my only thinking is that when the Shilka shoots, the tracer shot flies through the air for a few seconds.  The whole time, its location is being translated to everyone....this makes major lag.  If this "bullet" were turned into a camCreated object...and since camCreated objects are only on the computer that creates them...then this should reduce lag a lot...in theory.

Doolittle

Knut Erik

  • Guest
Re:camCreate Shilka shots?
« Reply #4 on: 23 Sep 2003, 17:13:36 »
Oook...  ;)

It should be possible!

Shilka addEventHandler ["Fired","[Shilka] exec "Script.sqs"]

And then

script.sqs

Code: [Select]
_shilka = _this select 0

_bullet = NearestObject [Shilka,"NameOfShilkaBullet"]
_speed = velocity _bullet
_NewBullet = "NameOfShilkaBullet" setPos [getPos _bullet select 0,(getPos _bullet select 1) + 0.1]
_newBullet setVelocity _Speed
DeleteVehicle _bullet
EXIT

I am REALLY unsure about this... Ain't at home now so I can't check...
But... To find out what the name of the shilka bullet is, but this little code in the init field of a shilka
this addEventHandler ["fired", { hint format ["You fired a shot of %1",_this select 4] }]

Tell me if it works  :D

Offline KTottE

  • Former Staff
  • ****
Re:camCreate Shilka shots?
« Reply #5 on: 23 Sep 2003, 17:28:04 »
I think that depends on the server.

We were playing a mission called West vs East, and at times we had five Shilkas firing at the same time, and no noticable lag because of it.
"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 Doolittle

  • Contributing Member
  • **
  • _this select 0
Re:camCreate Shilka shots??
« Reply #6 on: 24 Sep 2003, 01:39:13 »
Knut....cool beans.  I have no way of testing this though....actually I was asking because I dunno if anyone had been thinking about doing that....I would think it would be massive CPU usage on the firing computer.

KTottE....was this over a LAN?  How many people were playing?

Doolittle

Offline KTottE

  • Former Staff
  • ****
Re:camCreate Shilka shots?
« Reply #7 on: 24 Sep 2003, 10:53:41 »
Doolittle, it was over internet, and we were... hmm, I think we were five or six people.
"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!'"

Knut Erik

  • Guest
Re:camCreate Shilka shots?
« Reply #8 on: 24 Sep 2003, 11:00:37 »
Ok.. I got it to work  8)

Check out the attachment  ;)