Data Realms Fan Forums
http://45.55.195.193/

A few questions
http://45.55.195.193/viewtopic.php?f=1&t=31433
Page 1 of 2

Author:  SavaGhost [ Fri Jul 13, 2012 12:31 am ]
Post subject:  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.

Author:  4zK [ Fri Jul 13, 2012 1:09 am ]
Post subject:  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.

Author:  SavaGhost [ Fri Jul 13, 2012 1:25 am ]
Post subject:  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.

Author:  Asklar [ Fri Jul 13, 2012 1:41 am ]
Post subject:  Re: A few questions

Do you mean firing three as if it was a shotgun?

You need to change the ParticleSpreadRange.

Author:  SavaGhost [ Fri Jul 13, 2012 1:50 am ]
Post subject:  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.

Author:  David Rodrigov [ Fri Jul 13, 2012 1:59 am ]
Post subject:  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

Author:  SavaGhost [ Fri Jul 13, 2012 2:01 am ]
Post subject:  Re: A few questions

Im sorry if i am being amateurish here but how do i add it to the gun?

Thanks!

Author:  SavaGhost [ Fri Jul 13, 2012 2:04 am ]
Post subject:  Re: A few questions

And i don't see a variable here that defines how many bullets it should fire.

Thanks.

Author:  David Rodrigov [ Fri Jul 13, 2012 2:19 am ]
Post subject:  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.

Author:  SavaGhost [ Fri Jul 13, 2012 2:23 am ]
Post subject:  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!

Author:  Kettenkrad [ Fri Jul 13, 2012 2:29 am ]
Post subject:  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

Author:  SavaGhost [ Fri Jul 13, 2012 2:53 am ]
Post subject:  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.

Author:  Bad Boy [ Fri Jul 13, 2012 4:30 am ]
Post subject:  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

Author:  SavaGhost [ Fri Jul 13, 2012 5:40 am ]
Post subject:  Re: A few questions

Im afraid it doesn't work. Thanks though.

Author:  SavaGhost [ Fri Jul 13, 2012 6:01 am ]
Post subject:  Re: A few questions

Any ideas?

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