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



Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
 A few questions 
Author Message

Joined: Mon Jun 25, 2012 2:43 am
Posts: 17
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post 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
Profile

Joined: Mon Jun 25, 2012 2:43 am
Posts: 17
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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
Profile

Joined: Mon Jun 25, 2012 2:43 am
Posts: 17
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Jan 25, 2010 11:35 pm
Posts: 675
Reply with quote
Post 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
Profile

Joined: Mon Jun 25, 2012 2:43 am
Posts: 17
Reply with quote
Post 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
Profile

Joined: Mon Jun 25, 2012 2:43 am
Posts: 17
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Jan 25, 2010 11:35 pm
Posts: 675
Reply with quote
Post 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
Profile

Joined: Mon Jun 25, 2012 2:43 am
Posts: 17
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Oct 25, 2010 5:51 am
Posts: 1198
Location: Sydney
Reply with quote
Post 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
Profile

Joined: Mon Jun 25, 2012 2:43 am
Posts: 17
Reply with quote
Post 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
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post 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
Profile

Joined: Mon Jun 25, 2012 2:43 am
Posts: 17
Reply with quote
Post Re: A few questions
Im afraid it doesn't work. Thanks though.


Fri Jul 13, 2012 5:40 am
Profile

Joined: Mon Jun 25, 2012 2:43 am
Posts: 17
Reply with quote
Post Re: A few questions
Any ideas?


Fri Jul 13, 2012 6:01 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 21 posts ]  Go to page 1, 2  Next

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.124s | 14 Queries | GZIP : Off ]