Data Realms Fan Forums
http://45.55.195.193/

Somewhat realistic gun idea.
http://45.55.195.193/viewtopic.php?f=75&t=20079
Page 1 of 1

Author:  PvtVain [ Mon Nov 01, 2010 11:59 am ]
Post subject:  Somewhat realistic gun idea.

So. for my request i'd like a gun or a pack of guns whatever you like to do.
This would seem hardcore as I can't do any LUA yet.

A gun that if you lost a leg or something the accuracy will lower so the bullets will have less chance of hitting the enemy. So if you're at 50 health and lets say you have 1 leg missing, the enemy would have a chance to kill you, at first that doesn't sound very nice. But lets say the enemy has a leg missing while he is using the gun, it wouldn't be fair for him.

So would this be possible at all?

Side note: Another idea adding to this gun is you know how the coalition have a helmet?. Well armor attachables would be recognized by the script and change the weapons accuracy accordingly.

TL:DR Version
A gun that changes accuracy depending on the actors health and limbs and if possible armor attachables.

Author:  Roast Veg [ Mon Nov 01, 2010 6:23 pm ]
Post subject:  Re: Somewhat realistic gun idea.

Code:
function Create(self)
startingshake = self.ShakeRange
startingsharpshake = self.SharpShakeRange
end

function Update(self)
for actor in MovableMan.Actors do
self.ShakeRange = (startingshake*actor.Health)/100
self.SharpShakeRange = (startingsharpshake*actor.Health)/100
end
end

Author:  CaveCricket48 [ Mon Nov 01, 2010 7:02 pm ]
Post subject:  Re: Somewhat realistic gun idea.

I'm pretty sure you can't change ShakeRange with Lua.

Author:  findude [ Mon Nov 01, 2010 7:06 pm ]
Post subject:  Re: Somewhat realistic gun idea.

How on earth would you run that script either?

Author:  Roast Veg [ Mon Nov 01, 2010 7:15 pm ]
Post subject:  Re: Somewhat realistic gun idea.

CaveCricket48 wrote:
I'm pretty sure you can't change ShakeRange with Lua.


Damn. Ah well, I tried.

Author:  Azukki [ Thu Nov 04, 2010 5:33 am ]
Post subject:  Re: Somewhat realistic gun idea.

At 1 health, up to half a radian of spread is added. At 100, nothing happens.

If you want to make the effect greater, decrease the 200.
Eg, 100 would cause up to 1 radian of spread.
And vise versa, eg, 400 would cause up to 1/4 radian of spread.

It would be possible to change this so it wouldn't mess up the muzzle flash, but that would be a little more complicated.

Bits of code were taken for this from Abdul's recoil demo.

Attachments:
DeadMiss.rte.rar [796 Bytes]
Downloaded 149 times

Author:  Geti [ Thu Nov 04, 2010 8:01 am ]
Post subject:  Re: Somewhat realistic gun idea.

findude wrote:
How on earth would you run that script either?

Have the gun spawn a dedicated actor positioned at (0,0), pinned and non-colliding that calls thing:Update() on all MOs that have a parent MO (check MOID against RootMOID) or some such workaround.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/