Forgotten Hope Public Forum

Forgotten Hope 2 => Modding => Topic started by: robbob42 on 14-04-2018, 19:04:47

Title: Where does AntiTank Winchester shotgun come from??
Post by: robbob42 on 14-04-2018, 19:04:47
Looked thru a dozen pages of posts, and did a search, but can't find this topic/problem.

I'm new to modding, and have successfully replaced a few weapons in some of the kits (i.e. m1903a1 with springfield03a4scope in UW_Ranger_Scout.inc, etc).

Wanted to replace Winchester shotgun in US AntiTank kits, so I looked in the init.con file for a few levels (Bastogne, Brest, Omaha) to see what AT kits they use. When I look in those AT kit inc files in objects_server.zip they all list a Colt1911 (or some derivative). No shotgun in any of them. Yet in-game the AT class comes up with the Winchester Model 12. No pistol. All the other in-game AT weapons seem to match the kit inc - just not the Colt. There must be some kind of override going on(?), but I've looked every place I can think of and can't find it.

Including, but not limited to:

1. ClientArchives and ServerArchives.com within a level (where existed - Advance on Foy). Some additional kits were loaded via WaW archives, but no ATs.
2. tmp.con within the level
3. various other archives (common_client, common_server, objects_client, object_weapons_client, etc, etc)
4. the con & tweak files for the Colt1911 (and derivatives) and Winchester.

Some levels come up with the "correct" AT weapon list in-game (i.e. Eppeldorf), but they seem to use the UW_TankHunter_GarandGrenade kit as opposed to the UW_Antitankassault (and its derivatives).

I found a few grenade overrides (FewerGrenades.inc) in objects_server.zip\Common, so I assume it's something similar, but nothing for a Winchester/shotgun that I can find. I even manually unpacked several archives so I could do a file-content search for the words "Winchester" or "shotgun" within the inc, con, & tweak files. "Winchester" pops up in a couple of UW_Pickup... kits, but otherwise nothing.

I'm at a loss. If anyone has any insight I'd GREATLY appreciate it! Thanks!!

Other notes: we play exclusively coop.
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: Ts4EVER on 14-04-2018, 19:04:53
The winchester is only placed in the at kits in singleplayer and coop (because it is historically inaccurate). TBH I don't know how it is replaced, my guess is that it is automatically done by some python file outside the map folder.
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: robbob42 on 14-04-2018, 20:04:03
Thanks for the quick reply, Ts! I was starting to think it was going to be something like that. Unfortunately, I don't know anything about python, so I might be out of luck.  :P

Do you happen to know if the entire kit is replaced that way? Or just the Colt weapon itself? Wondering if I could just add the desired weapon to the kit (in addition to the Winchester) vs replacing it(?).
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: robbob42 on 15-04-2018, 21:04:37
OK, I was able to add the weapon I wanted to the UW_Antitankassault kit (using index #7), rather than have it replace the Winchester. So now I have both the Winchester and the new weapon (an iron sight G3 I ported from another source - mainly for kicks for my nephew who has one).

HOWEVER....
Everything seems to "work" (animations, it fires, reloads, can switch to iron sight, etc) except it does no damage. You don't get that little flash indicating a hit, no bullet holes on a wall, nothing. It's like it's shooting blanks. What am I missing? I assume I missed setting up the proper projectiles and/or damage, but not sure where to start with that....

Thanks!
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: Stubbfan on 15-04-2018, 22:04:09
Compare the new rifle tweak file with one of Fh2.

You are probably looking at the projectiletemplate row.
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: robbob42 on 16-04-2018, 04:04:53
Dead on, Stubbfan! The projectileTemplate line in the G3 tweak file specified a "762_51_g", which didn't exist in FH2. I replaced that with FH2's "7,62x54mmProjectile" (which for this purpose I figure is close enough). Boom - I got real bullets.

The last 2 things (and I can live without either if they're too complicated to get running):

1. That yellow, 4-pointed "star" doesn't flash when your shot scores a hit. Can't tell if I hit someone or not unless they drop. I know that's actually more realistic, but we're kinda used to (spoiled by?) that little indicator. Done a lot of comparing files between the Garand and the G3 and can't seem to figure that one out.

2. The original HUD and HUD\Selection images that came with the G3 are tga files, which FH2 doesn't seem to like. Get crashes to desktop. Tried an online file converter to convert them to dds but that made no difference. Maybe it's the image size or something else? For now I'm just using FH2's images for the STG44, which technically works, but isn't real accurate.

Thanks for all the help!! We're gathering to play Monday night and I think my nephew will be pretty geeked when he sees the G3! ;-)
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: GeoPat on 16-04-2018, 05:04:39
There is a UP_Engineer_shotgun kit in the cmp-minimod in levels. 
I think it is used on some Pacific maps.
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: Stubbfan on 16-04-2018, 14:04:40
Check the guiindex for the damage cross.


Not sure why the tga wouldn't work. Can you run in windowed mode and see if you get an error?
If you save as dds, use format 8,8,8,8 argb32 no mipmaps.
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: robbob42 on 16-04-2018, 20:04:56
Thanks for reply Ts. Sadly I'm not sure what guiIndex is or how it works. I changed it from the 210 it was to 52 (same as the M1 Garand - and an online reference said 52 was "hit indication"), but it made no difference.
CORRECTION: the hit indicator (guiIndex 52) works! Swore I was hitting people before, but maybe not(?).

I actually have been running in window mode pretty much all thru this process. I put the tga file back in for hud/selection. Everything works fine until I scroll the mouse wheel to bring up my weapon selection menu. Then it instantly crashes to desktop and is completely gone (not still running on the taskbar). No error msg.

What do you recommend for creating/modifying a dds? All I had done was try to convert the existing tga to dds via an online converter, but they give no details on the file/graphic format they converted it to.
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: Stubbfan on 17-04-2018, 13:04:28
Use Photoshop dds plugin to save in correct format
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: robbob42 on 17-04-2018, 17:04:15
Thanks, Stubbfan. Any (free?) alternatives for those of us who don't have Photoshop? I'm not likely to get that deep into modding that I would need to purchase something that.

BTW, we played last night and the G3 was a big hit! It was quite a surprise and everyone loved it (not just my nephew). So thanks to all for your assistance!!
Still hoping to get a proper weapon selection icon in place. Even tho the others didn't seem to mind that the STG44 I'm (temporarily?) using wasn't correct, I don't like to leave a project this "incomplete". Just the way I roll I guess...
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: Ts4EVER on 17-04-2018, 17:04:39
You can also use gimp with a dds plugin.
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: robbob42 on 18-04-2018, 00:04:03
OK, probably the long way around (sorry, didn't see the Gimp suggestion until too late), but I got a working G3 dds icon:
1. Found a transparent PNG image of a G3A3.
2. Used FastStone Viewer to resize/crop it to 150x46. I suspect IrfanView, etc, would do the same as long as it preserves transparency.
3. Uploaded that to https://pixlr.com/editor (pixlr's online editor). Pixlr preserves transparency. Slid weapon image to the right edge if its transparent "frame", then added "G3 iron sight" label (in white) to lower-left. Saved.
4. Uploaded that to https://online-converting.com/image/convert2dds. This one has options to set 8,8,8,8 argb32 (or "A8R8G8B8 (32 bits)" as they call it), and no mipmaps. Clicked "Convert file".
5. Copied resulting dds to menu_client.zip\HUD\Texture\Ingame\Weapons\Icons\Hud\Selection.

Presto! A working icon with no crashes! I was not able to figure out the exact font used for other FH2 weapon labels, but 11pt regular Bahnshrift SemiBold came pretty close.
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: Mayhemic.MAD on 18-04-2018, 12:04:19
Not 100% sure, but DIN1451 is used for a lot of things in FH.
https://en.wikipedia.org/wiki/DIN_1451
Title: Re: Where does AntiTank Winchester shotgun come from??
Post by: robbob42 on 18-04-2018, 15:04:14
I believe you're spot on, Mayhemic. The "4" in particular (in other weapon labels - such as the STG44) is quite distinctive, along with the lower-case "L" with the slight curl at the bottom, and DIN1451 seems to match both. Will give it a try. Thanks!