View unanswered posts | View active topics It is currently Fri Apr 19, 2024 9:56 am



Reply to topic  [ 5 posts ] 
 Multiple weapon attachments 
Author Message

Joined: Mon Dec 27, 2010 3:45 am
Posts: 33
Reply with quote
Post Multiple weapon attachments
Hi, I am making a weapon which is actually 2 weapons in one but I can't find out how to change RateOfFire and FireSound in this script, which is basically a copy of a vanilla Coalition grenade launcher. It switches between a shotgun and an SMG but when I switch to SMG mode it has the magazine of an SMG but the sound and fire rate of a shotgun.

What should I add into the script to change this?

Attachment:
ShotgunPie.lua [736 Bytes]
Downloaded 314 times


Wed Jul 18, 2012 11:47 pm
Profile
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: Multiple weapon attachments
As far as I'm concerned, it's impossible to change the rate of fire through lua, same with the fire sound.

You've got two workaround options though.

Make two separate weapons and replace one another when switching fire modes.

or

Having firing the weapon and emitting the bullets and firing sounds all through lua.


Thu Jul 19, 2012 1:08 am
Profile

Joined: Mon Dec 27, 2010 3:45 am
Posts: 33
Reply with quote
Post Re: Multiple weapon attachments
Coops wrote:
As far as I'm concerned, it's impossible to change the rate of fire through lua, same with the fire sound.

You've got two workaround options though.

Make two separate weapons and replace one another when switching fire modes.

or

Having firing the weapon and emitting the bullets and firing sounds all through lua.


Okay thanks, I reckon I'll go with the first option.


Thu Jul 19, 2012 1:15 am
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: Multiple weapon attachments
It's probably too late, now that you've probably worked based on misinformation for three days, but anyways...

You can very easily change rate of fire with Lua.
gun.RateOfFire = whatever should work.

Changing the firing sound directly can't be done, but you can use the script-spawned-emitter workaround.


Sat Jul 21, 2012 6:20 am
Profile

Joined: Mon Dec 27, 2010 3:45 am
Posts: 33
Reply with quote
Post Re: Multiple weapon attachments
Azukki wrote:
It's probably too late, now that you've probably worked based on misinformation for three days, but anyways...

You can very easily change rate of fire with Lua.
gun.RateOfFire = whatever should work.

Changing the firing sound directly can't be done, but you can use the script-spawned-emitter workaround.


Well thanks then, it's fine because I haven't done it because I haven't been working on my mod as much as before recently.


Sat Jul 21, 2012 12:00 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.102s | 16 Queries | GZIP : Off ]