OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Doolittle 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
-
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
-
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:
-
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
-
Oook... ;)
It should be possible!
Shilka addEventHandler ["Fired","[Shilka] exec "Script.sqs"]
And then
script.sqs
_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
-
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.
-
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
-
Doolittle, it was over internet, and we were... hmm, I think we were five or six people.
-
Ok.. I got it to work 8)
Check out the attachment ;)