Home » MODDING HQ 1.13 » v1.13 Coding Talk » Under Barrel Weapons [Implemented by Flugente]
Re: [WIP] Under Barrel Weapons[message #315895] Mon, 04 March 2013 01:16 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
You are pretty much correct. However, as DepressivesBrot stated, the lack of animations is what is holding bayonets back.


Re: [WIP] Under Barrel Weapons[message #315896] Mon, 04 March 2013 01:21 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3807
Registered:July 2009
While that's certainly true, you don't actually need a gun to be a melee item if you're designing a new mechanic anyway. You can just infer the needed values from handling and weight e.g.
Btw, the OSV-96 was carried over from stock 1.13


Re: Under Barrel Weapons [Implemented by Flugente][message #317151] Sun, 07 April 2013 02:24 Go to previous messageGo to next message
grim

 
Messages:319
Registered:July 2006
Location: France
I love this feature and what has been done with it by Wil473.
Thank you very much for implementing it.

However, i have a problem:
As i reported about DL 1.13, i have experienced great differencies in accurency between the main gun and its underbarrel weapon. Exemple: main weapon Scar-H, Underbarrel Masterkey, in 1.13 (5882 & 1610)
Using NCTH, while having a narrow aim (up to a green cross), the main gun shoots accurately, but the UB weapon shoots all over the place. It seems all aiming variables and main weapon stats aren't passed to the UB weapon, or something like that.
Re: Under Barrel Weapons [Implemented by Flugente][message #317153] Sun, 07 April 2013 02:42 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
It is not just shooting mechanics, but also the ammotype loaded into the underslung weapon does not seem to be "effective" either. ie. I load a lockbuster, or more visibly, an exploding 12gauge shell into an underslung shotgun and the round does not seem to have its intended in-game effect when it does hit the intended target. Something I've mentioned in my own threads, but haven't gotten around to posting here until someone else was seeing similar results.

[Updated on: Sun, 07 April 2013 02:43] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #317154] Sun, 07 April 2013 02:48 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
Hmm. That's rather grim news. Does that occur in OCTH also, or is it only in NCTH? Does it also happen in the trunk GameDir, or only in DL/AFS?


Re: Under Barrel Weapons [Implemented by Flugente][message #317157] Sun, 07 April 2013 03:24 Go to previous messageGo to next message
grim

 
Messages:319
Registered:July 2006
Location: France
Grim news aren't necessarily bad news Wink But this time you are right Sad
I'm sorry for the rather inaccurate report, as it's more about feelings than math.

I didn't test it with OCTH, however i had the issue on both DL 1.13 latest version (on 5882 & 1610) and JA 1.13 alone (on 5882 & 1610 and newer versions), both with NCTH.

DL 1.13: tested some weapons with 12g and .223 Remington dual mechanisms. 12g as main was logically accurate, .223 Remington as UB was inaccurate

JA 1.13: tested Scar-H with Masterkey. Masterkey seemed less accurate than main gun, hard to say in what extend, but shots missed a lot more than the scar-H or a full shotgun. I will try to test it further.
Re: Under Barrel Weapons [Implemented by Flugente][message #317158] Sun, 07 April 2013 03:29 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
Try to test wether the ammotype applies correctly if possible (does buckshot shoot multiple pellets?). For accuracy I'll have to debug to see wether all boni apply correctly.


Re: Under Barrel Weapons [Implemented by Flugente][message #317159] Sun, 07 April 2013 03:33 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
SCI_Unstable_Revision_5986_on_GameDir_1639
AFS v4.3x development (no changes to items used in test since v4.32 was released)

New game with OCTH selected. Static has two gearkits with under barrel weapons, took him on a day trip with the Commando/Masterkey kit and found that both primary and under barrel weapons could hit things quite easily (too easily though I may have just gotten used to NCTH). Using cheat codes I gave him some 12 gauge grenade rounds and found they did not explode on impact with enemy or with the ground.

EDIT: just saw your post.

Detached the Masterkey, still loaded with FRAG-12 shells and got the expected explosion when I shot the ground in front of Static.

[Updated on: Sun, 07 April 2013 03:35] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #317169] Sun, 07 April 2013 15:28 Go to previous messageGo to next message
grim

 
Messages:319
Registered:July 2006
Location: France
I reloaded my save shortly to test the scar-H + Masterkey on JA2 1.13 (5962 and 1631).

The masterkey is loaded with flechette ammo and shoots pellets (but in a very wide pattern).
I spawned a red shirt for testing purposes, and shot him at approximately 10 tiles. The NCTH with a x7 scope was narrower than the size of a head. The scar-H hit 9/10, while the masterkey hit 1 or 2/10. Misses were very far from the target.

I couldn't make screenshots, but will try!

EDIT: Another test session, a few screenshots to illustrate the problem:

My shooter's stats and his weapon:
http://i50.tinypic.com/xkn903.jpg
http://i49.tinypic.com/6jmv7d.jpg

The shooting range and NCTH indicator:
http://i47.tinypic.com/zteplj.jpg

Two wild shots:
http://i48.tinypic.com/29xzywz.jpg
http://i45.tinypic.com/2d7a63m.jpg

Precisions:
* I removed the masterkey from the scar-H and unloaded it to see the ammotype: It was as intended Flechette ammo (that i used to shoot the bad guy)
* This time, more shots hit the target, but generally, the accuracy was far from what the NCTH indicated, and far from the accuracy of the main weapon (Scar-H)

[Updated on: Sun, 07 April 2013 23:01] by Moderator

Re: Under Barrel Weapons [Implemented by Flugente][message #317183] Sun, 07 April 2013 23:30 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
Alright, comitting testing. Using SCAR-H SV with Masterkey, ammo is flechette with added explosive effect (so I can easily see wether ammo is correct). Using r5987 exe on AFS 4.31.

So far, with both OCTH and NCTH, explosions happen on hit, wether or not the Masterkey is attached. I set 1 and 1 in the ammotype. Are your settings any different?


Re: Under Barrel Weapons [Implemented by Flugente][message #317184] Sun, 07 April 2013 23:45 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
Try setting 2 as this activates the "real" in-game explosion effect. 1 is the original Jagged Alliance 2 HE ammunition effect which produced an animation, but no area effect ("real" explosives).

should point to an index in Explosives.XML, not sure what 1 is in stock (what's the 2nd grenade/bomb in-game?)


Sorry, skipped over you using AFS. Try the FRAG-12 round, they are only a few ALT-W down from the 4x 12g ejected by the Masterkey.

[Updated on: Sun, 07 April 2013 23:50] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #317185] Sun, 07 April 2013 23:53 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
Okay. Whe exactly is the SCAR-H SV a sniper rifle? I get what the SV stands for, but shouldn't this be an AR? One gets a severe cth drop if one uses it and isn't a sniper...

Edit: Okay, found the error with the non-occuring explosions. I used

AmmoTypes[MercPtrs[ubOwner]->inv[MercPtrs[ubOwner]->ubAttackingHand ][0]->data.gun.ubGunAmmoType].explosionSize

instead of
AmmoTypes[(*MercPtrs[ ubOwner ]->GetUsedWeapon( &MercPtrs [ ubOwner ]->inv[MercPtrs[ubOwner]->ubAttackingHand] ))[0]->data.gun.ubGunAmmoType].explosionSize
for the explosion size. How dumb of me. Easily readable code ftw :blah: :gaga:

Committed in r5988.

Also, are you using any scope with the SCAR? I have no idea which one to pick, and it would be good if we all had the same for testing...

[Updated on: Mon, 08 April 2013 00:46] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #317186] Mon, 08 April 2013 00:43 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
In AFS, the SV's are classed as sniper rifles specifically due to the "SV." Perhaps it may be better to use a straight up assault rifle for the Master Key tests, like the M16. Again using the cheat code it is only a few ALT-W's away from the Colt Commando that I've given Static's gear kits in AFS.


Re: Under Barrel Weapons [Implemented by Flugente][message #317188] Mon, 08 April 2013 01:07 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
I'm now using a M16A3 with a 4x Battle Scope. On OCTH, the difference in CTH seems to come from the difference in accuracy and range of the gun - which is how it should be. Now to NCTH...

Edit: Weird behaviour. On NCTH (firing with Bob, standing, on a soldier 17 tiles away) the CTH for both M16A3 and the underbarrel M26 is almost the same (54% to 52%). However, the M26 seems to over- or undershoot very much. Can you acknowledge that? It seems to me the shots don't go that much to the side, but most fall short or go way behind the target.

One factor of this the -tag, which seems to have a much bigger effect than the -tag in OCTH...

[Updated on: Mon, 08 April 2013 01:51] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #317200] Mon, 08 April 2013 14:01 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
Yes I was seeing under barrel shotguns shooting too far. I don't remember undershooting that much.

In NCTH the handling (how hard it is to aim a gun) is usually the dominant value when it comes to landing hits. I've got a thread discussing NCTH tags with input from ChrisL who implemented it here: http://www.bears-pit.com/board/ubbthreads.php/topics/290175/NCTH_Discussion_on_What_Exactl.html#Post290175 Note, this is how NCTH was implemented, not necessarily how Headrock envisioned it, that's a different discussion.

[Updated on: Mon, 08 April 2013 14:04] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #317206] Tue, 09 April 2013 00:19 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
Ha, think I found it. It seems that when using both underbarrel weapons and scope modes, some NCTH functions looked for the sighs/scopes/lasers on the underbarrel gun instead of the main gun. Seems to work fine after fixing that.

Fixed in r5990.


Re: Under Barrel Weapons [Implemented by Flugente][message #317209] Tue, 09 April 2013 01:45 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
Thank you Flugente. I'll have some time to test this on Wednesday.


Re: Under Barrel Weapons [Implemented by Flugente][message #317211] Tue, 09 April 2013 02:30 Go to previous messageGo to next message
grim

 
Messages:319
Registered:July 2006
Location: France
The explanation seems pretty pertinent, nice catch Flugente!
Re: Under Barrel Weapons [Implemented by Flugente][message #317213] Tue, 09 April 2013 03:05 Go to previous messageGo to next message
Gambigobilla

 
Messages:718
Registered:July 2008
Flugente went from "Coding Spree" to "Fixing Spree" and doing a damn fine job as his implemented features was. Two thumbs up.

Maybe we'll see a new stable version in the near future. May 6000 be a magic number.
Re: Under Barrel Weapons [Implemented by Flugente][message #317251] Tue, 09 April 2013 21:35 Go to previous messageGo to next message
Headhunter

 
Messages:266
Registered:November 2009
Location: Sweden
Gambigobilla
Maybe we'll see a new stable version in the near future. May 6000 be a magic number.


Yeah, I'm dying for Arulco Revisited with all the latest goodies...
Re: Under Barrel Weapons [Implemented by Flugente][message #317314] Thu, 11 April 2013 11:13 Go to previous messageGo to next message
Strohmann

 
Messages:288
Registered:August 2011
Location: Division Thought Crimes
I get a crash with 5990 when i try to fire an underbarrel weapon loaded with explosive ammo. Same with standalone xm-25. Before that the explosions didn't occur with the oicw ub launcher, but i could at least fire the weapon.

*Link*

Edit: Scratch that, trying to fire ANY weapon breaks the game, unrelated to UB weapon, explosive ammo or OCTH/NCTH etc. Works fine up to 5986, though.

[Updated on: Thu, 11 April 2013 11:28] by Moderator

Re: Under Barrel Weapons [Implemented by Flugente][message #317319] Thu, 11 April 2013 14:00 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
Yes, I can confirm the crash on firing any weapon with exploding ammo.

SCI_Unstable_Revision_5990_on_GameDir_1641
AFS (as stock v1.13 does not have any exploding ammo)
new game

Hired Static with the Commando/Masterkey gearkit, Alt-W cheat code to convert one of his 4x 12g shells to 4x 12g FRAG-12. Able to replicate the crash with the Masterkey attached and not attached.

In Strohmann's testing, if he is using AFS' XM-25 (or a mod based on it), it also uses exploding ammo as it is not a launcher in AFS.

EDIT: just checked Strohmann's 1.13 Stock Data Overhaul thread, yes his mod has the XM-25 implemented as a gun instead of launcher too. I'm guessing it is his mod, instead of AFS but its the exploding ammo that seems to be the bug.

EDIT2: also confirmed exploding ammo does not crash under the 5986 exe. Unfortunately DepressivesBrot doesn't have a 5988 to be able to directly confirm if the exploding ammo fix earlier in this thread is related.

[Updated on: Thu, 11 April 2013 14:13] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #317330] Thu, 11 April 2013 20:41 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
Ah. Perhaps I should have mentioned that. I managed to add a serous bug in 5990, fixed it yesterday in 5992, and was hoping nobody would notice... apparently not. Sorry, my fault.

5990: BAD. 5992: GOOD.


Re: Under Barrel Weapons [Implemented by Flugente][message #317374] Fri, 12 April 2013 21:37 Go to previous messageGo to next message
Strohmann

 
Messages:288
Registered:August 2011
Location: Division Thought Crimes
Ok, i got them to work with 5996, but is there a way to control the enviromental damage of the explosive ammo? It's strange seeing single 20 and 25mm grenades breaking down house walls and destroying rock formations while 40mm he from the conventional underbarrel launchers doesn't scratch them.

Current settings:
Toggle Spoiler
Am i missing something/a setting or is this not possible/hardcoded etc.?
Re: Under Barrel Weapons [Implemented by Flugente][message #317416] Sun, 14 April 2013 15:05 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
Afaik this happens if explosionsize > 1.


Re: Under Barrel Weapons [Implemented by Flugente][message #319550] Mon, 13 May 2013 21:48 Go to previous messageGo to next message
Taro_M

 
Messages:297
Registered:November 2008
Just one thing: can I strap a flamethrower to a gun? And if not, then why? Its a genius idea. Razz
Re: Under Barrel Weapons [Implemented by Flugente][message #319565] Tue, 14 May 2013 00:16 Go to previous messageGo to next message
Flugente

 
Messages:3416
Registered:April 2009
Location: Germany
Yes.


Re: Under Barrel Weapons [Implemented by Flugente][message #329017] Sun, 15 December 2013 21:03 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
Testing my own projects with SCI_Unstable_Revision_6690_on_GameDir_1891, and I noticed that presently reloading a weapon (which I remember was working to swap ammo) is now subject to the unlimited ammo from under barrel gun bug/exploit.

I've been able to replicate the issue using a new Data-1.13 game (not one of my mods) under SCI_Unstable_Revision_6690_on_GameDir_1891.

Save Game.

Trying to swap ammo on the attached MasterKey result in the production of the appropriate mag/remaining rounds but does not change what is actually loaded. In the save game there are 4 rounds of buckshot loaded - trying to reload the Master Key with lockbuster while it is attached produces a 4rd mag of buckshot (as expected in an ammo swap) but appears to leave the Master Key with the original 4rd of buckshot. Now I thought the bug/exploit didn't affect ammo swaps, only the unload button, but it appears to have spread.

EDIT: not in the save game but easily replicated, the number of rounds in the attached gun stays the same, if an attached Master Key has 3/4 rd of buckshot in it the only way to change the number of rounds in it (without detaching it) is to fire it.

[Updated on: Sun, 15 December 2013 21:07] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #331760] Tue, 15 April 2014 16:39 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
It has been a while so I decided to check on the reloading bug (and double post), the save game from last year is usable under SCI_Unstable_Revision_7141_on_GameDir_2007 and the bug is still present: when attached, the under barrel weapon's loaded rounds cannot be modified unless fired

- manually reloading same or different ammo results in what looks like a swap out of the previously loaded ammo item, but nothing happens to the actual ammo stats in the under barrel weapon.
- oddly enough if the under barrel weapon is empty and you try to fire, it will reload properly (meaning if you want to change ammotype, you have to drop all other ammotypes for the under barrel weapon, empty the under barrel somehow, and fire so the under barrel draws from only choice you've given the game)

ie. in the save game supplied above, empty the rounds from the Masterkey and try to reload while the Masterkey is still attached, you will see that the game takes your reload ammo item, but the Masterkey remains empty. Fire the Masterkey while attached and it reloads from inventory just fine.

I'm not sure if I submitted a bugzilla for this one, but I'll do so today if I haven't.

EDIT: Got a Bugzilla number for it 663

Additionally, I think I found a own workaround, swap still working from the merc's inventory screen - the under barrel weapon has be selected but it looks like ammo is being swapped successfully when the new ammo is dropped on the base weapon.

http://www.bears-pit.com/board/gallery/80/full/406.jpg
Reloading, unloading, swapping ammotype does not actually cause a change to the actual ammo stats of the attached under barrel weapon from this screen.


http://www.bears-pit.com/board/gallery/80/full/407.jpg
...however you can reload and swap ammunition in the under barrel weapon while in this screen (as long as the base weapon is in hand and set to UB fire mode)

[Updated on: Tue, 15 April 2014 18:26] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #331767] Tue, 15 April 2014 21:20 Go to previous messageGo to next message
anv

 
Messages:232
Registered:March 2013
@wil473: Fix:
Toggle Spoiler
Static type of Object2 was blocking changing attachment data.


Re: Under Barrel Weapons [Implemented by Flugente][message #331769] Wed, 16 April 2014 05:24 Go to previous messageGo to next message
Wil473

 
Messages:2833
Registered:September 2004
Location: Canada
anv
@wil473: Fix:
Toggle Spoiler
Static type of Object2 was blocking changing attachment data.


Thank you Anv... that wasn't even 6 hours. Does this fix mean that we can now finally unload attached under barrel weapons? The original bug, before it seemed to get worse, was that the attached weapon would never clear when the bullet icon was clicked to unload - leading to the exploit of a potential unlimited source of FRAG-12 and Incendiary shells (in my mods).

Cannot wait to give the next .exe a spin... time permitting.

[Updated on: Wed, 16 April 2014 05:26] by Moderator



Re: Under Barrel Weapons [Implemented by Flugente][message #332207] Tue, 06 May 2014 11:11 Go to previous message
RoWa21

 
Messages:2039
Registered:October 2005
Location: Austria
Fix is committed.


Previous Topic: {idea} AIM/Merc Gear Kits by progress/coolness
Next Topic: Help needed: set up very specific STI libraries
Goto Forum:
  


Current Time: Tue Oct 23 04:15:06 EEST 2018

Total time taken to generate the page: 0.01174 seconds