Data Realms Fan Forums
http://45.55.195.193/

Multiple weapon attachments
http://45.55.195.193/viewtopic.php?f=73&t=31463
Page 1 of 1

Author:  god froggy [ Wed Jul 18, 2012 11:47 pm ]
Post subject:  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 336 times

Author:  Coops [ Thu Jul 19, 2012 1:08 am ]
Post subject:  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.

Author:  god froggy [ Thu Jul 19, 2012 1:15 am ]
Post subject:  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.

Author:  Azukki [ Sat Jul 21, 2012 6:20 am ]
Post subject:  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.

Author:  god froggy [ Sat Jul 21, 2012 12:00 pm ]
Post subject:  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.

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