Author |
Message |
SavaGhost
Joined: Mon Jun 25, 2012 2:43 am Posts: 17
|
A few questions
Hello,
I have a few questions regarding weapons.
I want to make a laser attached weapon how do i make the laser not be a part of the weapon and not collide with objects? Please give me the script to this.
The other one is i want to make an 'AN-94' Rifle but as you may know AN-94 fires 2 rounds with each hit. How do i make a gun fire 2 bullets at the same time?
Thanks a lot.
|
Fri Jul 13, 2012 12:31 am |
|
|
4zK
Joined: Mon Oct 11, 2010 1:15 pm Posts: 594 Location: Finlandia
|
Re: A few questions
Hi, and welcome to the forums!
If by "laser attached weapon" you mean laser sights, there are a few mods that use quite pretty laser sight scripts. They usually just produce a dot where you aim, but making a beam shouldn't be too much harder. It can be laggy, though. I suppose I could make a script for you. I don't have time to do that now, though.
I suppose you mean in bursts. Firing two bullets at once would require two barrels. Anyway, there is a vanilla script for 3-round bursts, so I think making a 2-round burst script shouldn't be too hard. However, making a gun shoot two bullets at once is extremely easy. Just change the ParticleCount from the round data to 2.
|
Fri Jul 13, 2012 1:09 am |
|
|
SavaGhost
Joined: Mon Jun 25, 2012 2:43 am Posts: 17
|
Re: A few questions
Hello,
Thanks for the reply.
Can you please give me a link to this laser?
And i tried looking into the round but it is already 3 and the gun still fires 1 round.
Thanks.
|
Fri Jul 13, 2012 1:25 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: A few questions
Do you mean firing three as if it was a shotgun?
You need to change the ParticleSpreadRange.
|
Fri Jul 13, 2012 1:41 am |
|
|
SavaGhost
Joined: Mon Jun 25, 2012 2:43 am Posts: 17
|
Re: A few questions
No. im afraid not. I mean 2 shots at the same time. Think of it like an ak47 but it fires two bullets everytime you pull the trigger.
|
Fri Jul 13, 2012 1:50 am |
|
|
David Rodrigov
Joined: Mon Jan 25, 2010 11:35 pm Posts: 675
|
Re: A few questions
I know how an AN-94 fires two shots like that, you're talking about burst fire. Here's a lua script taken from one of the coalition pistols, add it to the gun itself to fire in bursts. It shoots a three round burst, but it shouldn't take too much modification for just two bullets.
Attachments:
Burst.lua [674 Bytes]
Downloaded 237 times
|
Fri Jul 13, 2012 1:59 am |
|
|
SavaGhost
Joined: Mon Jun 25, 2012 2:43 am Posts: 17
|
Re: A few questions
Im sorry if i am being amateurish here but how do i add it to the gun?
Thanks!
|
Fri Jul 13, 2012 2:01 am |
|
|
SavaGhost
Joined: Mon Jun 25, 2012 2:43 am Posts: 17
|
Re: A few questions
And i don't see a variable here that defines how many bullets it should fire.
Thanks.
|
Fri Jul 13, 2012 2:04 am |
|
|
David Rodrigov
Joined: Mon Jan 25, 2010 11:35 pm Posts: 675
|
Re: A few questions
Add this line: Code: ScriptPath = Coalition.rte/Devices/Weapons/Burst.lua under the "Mass" variable of the gun, and of course, write the file paths to the lua file, here's an example. Code: AddDevice = HDFirearm CopyOf = Pistol PresetName = Burst Pistol Description = SavaGhost's burst pistol. Mass = 4 ScriptPath = SavaGhost.rte/Devices/Weapons/Burst.lua And for the number of bullets, I don't know lua coding so I can't answer how to change it, sorry.
|
Fri Jul 13, 2012 2:19 am |
|
|
SavaGhost
Joined: Mon Jun 25, 2012 2:43 am Posts: 17
|
Re: A few questions
Thanks a lot!
Anyone how to change the number of bullets? And The link to the laser would also be much appreciated.
Thanks!
|
Fri Jul 13, 2012 2:23 am |
|
|
Kettenkrad
Joined: Mon Oct 25, 2010 5:51 am Posts: 1198 Location: Sydney
|
Re: A few questions
Hiya! Welcome to modding, etc. To add a script to an object, you can use the following code: Code: [tab] ScriptPath = Mod.rte/Path/Script.lua The script that you're using (from what I can see) uses timers to allow the gun to fire for a certain amount of time before shutting it down to burst again. (I think) you could either lower the weapon's rate of fire to achieve a two-round burst, or shorten the first timer. (Line 16, self.burstTimer:IsPastSimMS(time in milliseconds) EDIT: Ninja'd
|
Fri Jul 13, 2012 2:29 am |
|
|
SavaGhost
Joined: Mon Jun 25, 2012 2:43 am Posts: 17
|
Re: A few questions
Hey! Nice to meet you all too.
@KettenKrad It worked! Thanks a lot!
Now all i need is the laser.
Thanks everyone.
|
Fri Jul 13, 2012 2:53 am |
|
|
Bad Boy
Joined: Fri Sep 10, 2010 1:48 am Posts: 666 Location: Halifax, Canada
|
Re: A few questions
Here's an easy way to put laser pointers on your gun (the first post in the link). Follow the instructions there and you should be fine. viewtopic.php?f=61&t=16863&start=151
|
Fri Jul 13, 2012 4:30 am |
|
|
SavaGhost
Joined: Mon Jun 25, 2012 2:43 am Posts: 17
|
Re: A few questions
Im afraid it doesn't work. Thanks though.
|
Fri Jul 13, 2012 5:40 am |
|
|
SavaGhost
Joined: Mon Jun 25, 2012 2:43 am Posts: 17
|
Re: A few questions
Any ideas?
|
Fri Jul 13, 2012 6:01 am |
|
|
|