View unanswered posts | View active topics It is currently Fri Dec 27, 2024 11:14 am



Reply to topic  [ 7 posts ] 
 Somewhat realistic gun idea. 
Author Message
User avatar

Joined: Thu Jul 15, 2010 1:52 pm
Posts: 165
Reply with quote
Post 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.


Mon Nov 01, 2010 11:59 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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


Mon Nov 01, 2010 6:23 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Somewhat realistic gun idea.
I'm pretty sure you can't change ShakeRange with Lua.


Mon Nov 01, 2010 7:02 pm
Profile
User avatar

Joined: Tue Dec 12, 2006 3:10 pm
Posts: 495
Location: Uncertain quantum state
Reply with quote
Post Re: Somewhat realistic gun idea.
How on earth would you run that script either?


Mon Nov 01, 2010 7:06 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Somewhat realistic gun idea.
CaveCricket48 wrote:
I'm pretty sure you can't change ShakeRange with Lua.


Damn. Ah well, I tried.


Mon Nov 01, 2010 7:15 pm
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post 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 155 times
Thu Nov 04, 2010 5:33 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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.


Thu Nov 04, 2010 8:01 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.035s | 14 Queries | GZIP : Off ]