Page 1 of 1

Add FireArms to HandWeapons?

Posted: Wed Jul 27, 2011 7:29 am
by Swaffy
How I got the idea:
I've seen the bayonetted rifles [from Road to Rome], and how they have an added FireArms as its Alt fire. I looked at the coding, and the bayonet is simply an addTemplated FireArm set to AltFire.

The issue:
Is there a way I can add a FireArms (such as the bayonet), but have it use the primary fire along with the normal gun instead of alternate fire? [Thus having two FireArms for the primary fire instead of the main gun on left-click and the added FireArms as right-click.] I have already tried to "rem" out the "ObjectTemplate.setInputFire c_PIAltFire" line of code for the second FireArm, and all my gun did was fire the first (main) FireArm.

What I'm trying to do:
- Add two more FireArms to one of my guns.
- Add a .4 second fire delay to the first new FireArm, and .8 second fire delay to the second new FireArm (to create a 3-shot burst effect).
- All three FireArms will have the same mag size, number of mags, reload time, etc. in order to make the burst effect work correctly.
- Cause one shot of the gun to count as 3 shots (ObjectTemplate.setBlastAmmoCount 3) in order for the "burst" to count as three shots instead of one, while still using a standard 30-round mag. Without setBlastAmmoCount being set to 3 (instead being 1), the gun would have to have a 10-round mag in order to shoot 30 bullets total. Leave this up to me to work out, just focus on getting an added FireArms to work with the main gun.

Is this possible? [Do I need to reword what I'm asking?]

Re: Add FireArms to HandWeapons?

Posted: Thu Jul 28, 2011 1:18 pm
by freddy
Swaffy wrote: The issue:
Is there a way I can add a FireArms (such as the bayonet), but have it use the primary fire along with the normal gun instead of alternate fire? [Thus having two FireArms for the primary fire instead of the main gun on left-click and the added FireArms as right-click.] I have already tried to "rem" out the "ObjectTemplate.setInputFire c_PIAltFire" line of code for the second FireArm, and all my gun did was fire the first (main) FireArm.
the only way i know how to make two weapons fire at the same time with the same input trigger is to put them on the same bundle

(shortened example code)

Code: Select all

ObjectTemplate.create RotationalBundle StationaryMG42PointRotation
ObjectTemplate.networkableInfo Stationary_mg_TurretInfo
rem -------------------------------------
ObjectTemplate.addTemplate MG42_unlimited
ObjectTemplate.setPosition 0/0.09/0.2
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.addTemplate Browning_unlimited  <----------------
ObjectTemplate.setPosition 0/0.29/-0.1
ObjectTemplate.setRotation 0/0/0
dont know if its possible to do something like this with soldier weapons

Re: Add FireArms to HandWeapons?

Posted: Fri Jul 29, 2011 1:25 am
by Swaffy
Yeah, but a HandWeapon is a FireArm. I'm not sure if [or where] a bundle can be used without leaving out the important stuff such as animations and deviation. Would I just add all three FireArms to a bundle and addTemplate that bundle to the weapon kit?