One Shot Counts as [two or more] Shots?

Ask questions, discuss ideas, get answers
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

One Shot Counts as [two or more] Shots?

Post by Swaffy »

From my tests, the BlastAmmoCount (ObjectTemplate.setBlastAmmoCount 1) is an "on or off" type of boolean. In other words, if its number is set to 1 or above, it will count the blast as only one single shot. Leaving out that line causes the game to use more than one round of ammo per shot, but only if there are multiple FireArmsPositions on that FireArm (so three FireArmsPositions will use up three ammo rounds in the FireArm if they fire at the same time).

But here's my issue.

I want to have only one shot coming from that FireArm at a time, not multiple shots (as in only one FireArmsPosition), but it will use up three rounds in the mag. I've tried using "setBlastAmmoCount" line with the "addFireArmsPosition" line, but I can't seem to make it do what I want. The only way to make it use up two rounds in the mag is to add a second FireArmsPosition, but that requires my FireArms to fire two projectiles at the same time, which isn't my desired outcome.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
exe
Posts: 60
Joined: Wed Feb 08, 2012 10:04 pm

Re: One Shot Counts as [two or more] Shots?

Post by exe »

Hmm and what about setting the 2nd (and 3rd) FireArm out of bounds? Like this:

Code: Select all

ObjectTemplate.addFireArmsPosition 0/0/0 0/0/0
ObjectTemplate.addFireArmsPosition -1000/-1000/-1000 0/0/0
ObjectTemplate.addFireArmsPosition -1000/-1000/-1000 0/0/0
Not really a "clean" solution but should work.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: One Shot Counts as [two or more] Shots?

Post by Swaffy »

My only real problem with that is that the FireArm is on an airplane, and airplanes can be rotated in any way.

I was thinking about having three addFireArmsPosition lines set to 0/0/0 0/0/0 and using the tracer settings to skip two shots and fire the projectile on the third shot. So basically the other two FireArmsPositions would not shoot anything. Unfortunately, I just came up with this idea and haven't tested it yet.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: One Shot Counts as [two or more] Shots?

Post by freddy »

I dont really grasp what your after, but you can cycle the firearms positions if thats what you want

Code: Select all

ObjectTemplate.setAsynchronyFire 1
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: One Shot Counts as [two or more] Shots?

Post by BotHunter »

you could add three more like this:
Apache Thunder wrote: It is possible to addTemplate a FireArm object to handweapons. I have in the past been able to fire things from them despite them being a child object of a handweapon. What you could do is addTemplate a firearm object to your handweapon and use that for your rotating minigun mesh.
And make two of them harmless projectiles (Like knife projectile)
Walk quietly and carry a sniper rifle
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: One Shot Counts as [two or more] Shots?

Post by Swaffy »

So add a FireArm to a FireArm is what you are saying? I don't quite grasp it.

I have three FireArms on my Corsair aircraft and also on my P-51. like this:
Image

Each FireArm has "ObjectTemplate.setAsynchronyFire 1" so that it fires one projectile at a time.

But the ammo icon only shows the ammo count for one of the FireArms, not all three combined. Therefore, I have an evil plan to multiply the MagSize by three (MagSize of 200 would become 600) and make it use up three rounds per shot instead of one so that it appears as if the game is showing the ammo count for all three FireArms.

Damn, I'm confusing people. XD
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: One Shot Counts as [two or more] Shots?

Post by BotHunter »

What I meant was to add two firearms and make them fire harmless projectiles. so every time you fired, it fired the real weapon and the two harmless weapons. Then it would take three shots off every time you fired.
Sorry if I'm confusing you :)
Walk quietly and carry a sniper rifle
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: One Shot Counts as [two or more] Shots?

Post by Vilespring »

Are you saying firearms can fire different projectiles at different firearm positions? Adding multiple useless firearm bundles will do nothing if they fire nothing.
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: One Shot Counts as [two or more] Shots?

Post by Swaffy »

Though this is an older thread, I found a solution. Originally I wanted one bullet to use up 3 rounds in the magazine. But I decided on a different setup for my Corsair's guns.

Here's how my corsair is intended to work. The idea is that there are 6 guns total, 3 per wing. The right 3 guns fire (one FireArm bundle), then the left 3 (other FireArm bundle). So it goes back and forth between the wings. Left, right, left, right, etc. This means that three bullets are used at a time due to there being three addFireArmPositions per FireArm. My Corsair originally had 3 FireArms, shown in the picture I posted earlier in this thread, and it was not going to work.

So I used BotHunter's idea, to use a Dummy projectile. For a FireArm, the first three bullets would be the "real" bullets then the next three would be "dummy" bullets. So technically the FireArm was always firing bursts of 3 but the second burst is the dummy bullets. The second FireArm has this backward so that firing all of them results in the left-right-left-right action.

FireArms1 fires normal first then the dummy.
FireArms2 fires dummy first then the normal.
Both FireArms fire at the same time.

Two FireArm gun setup:

Code: Select all

rem ----- [Corsair Guns] -----

rem * Right Wing Guns
ObjectTemplate.create FireArms CorsairGuns
ObjectTemplate.setNetworkableInfo PlaneFireArmInfo
ObjectTemplate.loadSoundScript Sounds/F4U_Gun1.ssc
ObjectTemplate.aiTemplate CorsairMachineGun
rem --------------------------------
ObjectTemplate.visibleBarrelTemplate e_MuzzHeavy
rem --------------------------------
ObjectTemplate.projectileTemplate Browning_ProjectileTracerAir
ObjectTemplate.setTracerTemplate CortanaIsProbablySexy CRD_NONE/2/0/0
ObjectTemplate.projectilePosition 0/0/2
rem ObjectTemplate.setAsynchronyFire 1
ObjectTemplate.setMinDev 0.05
ObjectTemplate.magSize 900
ObjectTemplate.numOfMag 1
ObjectTemplate.velocity 400
ObjectTemplate.roundOfFire 10
ObjectTemplate.AmmoType	10

ObjectTemplate.addFireArmsPosition 2.429/-0.245/2.6 -0.9/0/0
ObjectTemplate.addFireArmsPosition 2.229/-0.245/2.6 -0.9/0/0
ObjectTemplate.addFireArmsPosition 2.029/-0.245/2.6 -0.9/0/0
rem ObjectTemplate.setBlastAmmoCount 6


rem * Left Wing Guns
ObjectTemplate.create FireArms CorsairGuns2
ObjectTemplate.loadSoundScript Sounds/F4U_Gun2.ssc
rem --------------------------------
ObjectTemplate.visibleBarrelTemplate e_MuzzHeavy
rem --------------------------------
ObjectTemplate.projectileTemplate CortanaIsProbablySexy
ObjectTemplate.setTracerTemplate Browning_ProjectileTracerAir CRD_NONE/2/0/0
ObjectTemplate.projectilePosition 0/0/2
rem ObjectTemplate.setAsynchronyFire 1
ObjectTemplate.setMinDev 0.05
ObjectTemplate.magSize 900
ObjectTemplate.numOfMag 1
ObjectTemplate.velocity 400
ObjectTemplate.roundOfFire 10
ObjectTemplate.AmmoType	10

ObjectTemplate.addFireArmsPosition -2.429/-0.245/2.6 0.9/0/0
ObjectTemplate.addFireArmsPosition -2.229/-0.245/2.6 0.9/0/0
ObjectTemplate.addFireArmsPosition -2.029/-0.245/2.6 0.9/0/0
rem ObjectTemplate.setBlastAmmoCount 6
Here is my dummy projectile:

Code: Select all

rem ----- [Dummy Projectile] -----
ObjectTemplate.create Projectile CortanaIsProbablySexy
ObjectTemplate.createNotInGrid 1
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 0
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.timeToLive CRD_NONE/0/0/0
rem ObjectTemplate.material 213
The only bug that I have is that when the guns fire the "dummy" projectile, the muzzle flash still happens. If anyone has an idea let me know. (When the FireArm fires the three "dummy" projectiles it still makes the muzzle flash)
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: One Shot Counts as [two or more] Shots?

Post by Vilespring »

Ha, I would have done something sad like this! :lol:
there would be 3 fire arm bundles. and they are set synced. Then the counter would fire nothing in blast of 3s.
Oh, if you are firing dummy bullets of of a firearm, can't you just remove its effects? Because I understand you having two fire bundles asynchronized with each other.

I hate messing around with dummy bundles, like the double barreled laser tank in area 51 that had a 1 second charge before it fired. That was a nightmare.
They can make cool things though, I have a belt-fed T-34 that fires rockets, and the belt visually decreases.
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
Post Reply