SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [TEC] External cargo in SH5 (https://www.subsim.com/radioroom/showthread.php?t=205331)

Rongel 06-24-13 12:11 PM

[TEC] External cargo in SH5
 
Have you ever seen a ship with external cargo on her deck in SH 5? I haven't!

I remember that SH 4 had a pretty good system with this, there were tanks, cars, crates and stuff like that. So I started to investigate this a bit.

http://i1231.photobucket.com/albums/...-24_134124.jpg
http://i1231.photobucket.com/albums/...-24_133909.jpg

As you can see, SH 5 has all that stuff too. Old Silent Hunter veterans know that ships must have a node called cfg#K01_"shipname" to get external cargo to appear. I know only one SH 5 ship that has that, Liberty Cargo. It's easy to test this in custom mission (with that Liberty Cargo ship), just select an item from the external cargo list. I managed to add the same node to other SH 5 merchant ship which had the free space for external cargo, but was missing the cargo-node (the positioning is still bit off!):

http://i1231.photobucket.com/albums/...-24_165320.jpg

I did this by injecting the node to the ships .sim file, not probably the most elegant way but it seems to work. Also it seems that many cargo objects are missing their zones in the .zon file, so they are currently indestructible, but that should be quite easy to fix.

But I just couldn't get the new cargo to appear in game without manually selecting from the mission builder. I'm not so experienced in mission builder, but it seems that if we want to see the external cargo, it needs to be selected when making the campaigns. Like this, :

http://i1231.photobucket.com/albums/...777/cargo1.jpg

If we would like to see more nice stuff in the game, first we need to add the missing nodes to cargo ships, fix the .zon file and then make changes to campaign layers. If this works, no more empty cargo ships!

So if somebody knows more about cargo stuff, or if there is already somekind of mod dealing with this, please tell! I think this might be too much for me to handle alone. Maybe Trevally is interested in this, maybe in the future there will be somekind of patch to OH 2... :D Here is the last proof of concept, it's taken from Memel harbour, in the campaign game, and I have added the external cargo node to the ship:

http://i1231.photobucket.com/albums/...-24_191626.jpg

Phew! :woot:

TheDarkWraith 06-24-13 12:53 PM

this might shed some light on it: http://www.subsim.com/radioroom/show...postcount=2145

Rongel 06-24-13 03:01 PM

Thanks, I also found some old information on the K-nodes by rowi58:
Quote:

as i see, the NGRA has one node for external cargo - the K01 node. That means, SH3 will randomly put some kind of external cargo on this place. A kind of external cargo, that is defined by the CargoDef.cfg. (K-nodes will not work within the EQP file!)
and Tater:

Quote:

Most SH4 ships lack K nodes, but that is easy enough to fix.
I think SH 5 doesn't put a random cargo on a ship, you need to apply it yourself to random convoys and spawn points in mission editor.

I just wonder why the devs didn't use the external cargo, all the models seem to be ready and the game seems to have a system how to get them in the campaign. I hope it was because time restraints, and not because some nasty bug...

gap 06-24-13 03:18 PM

Quote:

Originally Posted by Rongel (Post 2075292)
If we would like to see more nice stuff in the game, first we need to add the missing nodes to cargo ships, fix the .zon file and then make changes to campaign layers. If this works, no more empty cargo ships!

Nice finding Rongel :up:

Adding new external cargo bones and placing them correctly around ship models shouldn't be a big problem using the current version of TDW's GR2 editor; editing cargo damage shouldn't be a big deal either: I guess that giving them damage boxes would be enough as equipments normally can use main unit's collision spheres. As for assigning the appropriate cargo to each ship, I think it can be done through eqp files, as we do with crew and other equipments (LinkName entries), but since ME provides a better and more flexible way to do it, I think we should do it through campaign files :yep:

Quote:

Originally Posted by TheDarkWraith (Post 2075323)

Quote:

Originally Posted by TheDarkWraith (Post 2075261)
Just decoding the reading of the .eqp file's for units and ran across a neat little tidbit of info. Under each [Equipment x] header there can be an entry called CargoType= and LoadOut=. I can't recall seeing these being used in any of the .eqp files :hmmm:

Loadout= entries are used in aircraft eqp files, where different bomb loadouts are defined in unit's main cfg file, and are selected in ME through the "external cargo" property. Note that each loadout set in the cfg file has a Type= entry, which might affect unit's behaviour through AI scripts and/or hardcoded routines. This is to say that using loadout definitions on ships might not be a viable option, unless these "CargoType=" entries that you are mentioning can be used with ships as "Type=" entries do with aircraft :hmmm:

THE_MASK 06-24-13 04:37 PM

If you look at the big Mis file in the SH5 save game folder .

Name=_BR Large Merchant / War supplies (ProxY)#71
Class=KLWarSupplies
Type=102
Origin=British
LayerOperation=0
Side=1
Commander=0
CargoExt=-1 ?
CargoInt=-1
?

Rongel 06-25-13 04:49 AM

Quote:

Originally Posted by sober (Post 2075431)

Name=_BR Large Merchant / War supplies (ProxY)#71
Class=KLWarSupplies
Type=102
Origin=British
LayerOperation=0
Side=1
Commander=0
CargoExt=-1 ?
CargoInt=-1
?

-1 value means "None". It's easy to see in custom missions, where you put several ships with different loadout. Then check the missions .misge-file, and there they are again:

...
Side=2
Commander=0
CargoExt=1
CargoInt=0

Doctrine=0
CfgDate=19391101
...

You can even change the loadouts with text editor, with CargoExt -1 is none, 0 is cargo truck, 1 is fuel truck, 2 is tank etc.

The reason why we don't see cargo in campaign is that the campaign files have also -1 in "CargoExt", and also many ships miss the required K-node. For example, this is the details of one polish convoy unit in Coastal Waters campaign:

[TRAF_POLISH_MERCHANT.ConvoyUnit 1]
Type=102
CountryName=Poland
ExternalCargo=-1
InternalCargo=-1

CrewRating=2
Weapons=0
Sensors=0
Tactics=0
Camouflage=0
Required=false
No=1
SpawnProbability=10
GroupLinkId=0

So just changing that negative number to another value should make a change (if the 102-type cargo ship has the cargo-nodes).

Rongel 06-25-13 09:30 AM

Did some more studying... I found four big cargo ships (type 102) that had the K-nodes: Liberty Cargo, C1-B Type Medium Merchant, C2-S-B1 Hull Large Merchant and Victory Cargo. The reason why other ships don't have them might be that they are too small for the large external cargo. If you put the biggest pile of crates or train carts on a small or medium size cargo ship, it just won't fit, and there will be some ugly clipping (I witnessed this during testing).

And I also looked into campaign files, in OH 2 there are some convoys that have external cargo specified. But it seems that all random traffic is specified to be without cargo. So if I'm right, we should see some cargo just by editing the campaign! Will test this soon-ish!

gap 06-25-13 09:54 AM

Quote:

Originally Posted by Rongel (Post 2075704)
Did some more studying... I found four big cargo ships (type 102) that had the K-nodes: Liberty Cargo, C1-B Type Medium Merchant, C2-S-B1 Hull Large Merchant and Victory Cargo. The reason why other ships don't have them might be that they are too small for the large external cargo. If you put the biggest pile of crates or train carts on a small or medium size cargo ship, it just won't fit, and there will be some ugly clipping (I witnessed this during testing).

And I also looked into campaign files, in OH 2 there are some convoys that have external cargo specified. But it seems that all random traffic is specified to be without cargo. So if I'm right, we should see some cargo just by editing the campaign! Will test this soon-ish!

Setting some new cargo types would be nice. Lesser bulky cargo for smaller vessels, for instance. However going by what you are saying cargo types are indexed, and any cargo category got its own number. Could you find any file where cargo categories are linked to their respective 3D models? :hmm2:

Rongel 06-25-13 01:35 PM

Gap, I think the only file that deals with ships external cargo is CargoDef.cfg, it's located in data/sea.

So currently the situation is that we can get external cargo to these four big ships if the cargo is specified in mission/campaign editor. Basically it's really easy, just select the cargo from the drop-down menu. But most of the ships are small cargo ships, like HogIsland, and these ships don't have the nodes for cargo. But if we make the new nodes to these ships (I tried it with TDW's great GR2 importer/exporter and worked it fine), large cargo won't fit there. I don't see any way that we could tell the game put only small cargo on small cargo vessels, it's linked with the ships type and large and small cargo ships belong to the same 102-type.

So there is two options. We could just put cargo to these big ships that already have the nodes, and enough space for every type of cargo. Downdside is that these ships are relatively rare, and most of the ships would still be empty. The second option is that we could add the nodes to every cargo ship, and only put small cargo items to them. Ofcourse we can still add large items to specified convoys that have big ships that can carry them.

Phew, I hope this is understandable! My option would be the later, add the nodes to every cargo ship and just place smaller crates, tanks and trucks to the ships, every cargo ship can carry them just fine.

Oh, by the way, I added some missing zone boxes and spheres to the cargo.zon file, and it worked great, we can get the cargo to be destroyed in many different ways! Here is one poor truck heading to depths:

http://i1231.photobucket.com/albums/...-24_212324.jpg

gap 06-25-13 03:26 PM

Quote:

Originally Posted by Rongel (Post 2075794)
Gap, I think the only file that deals with ships external cargo is CargoDef.cfg, it's located in data/sea.

Okay, I had a look into the cfg file pointed by you. As far as I can see, by editing it we can even add new cargo types, which is good if we are going to need for more smaller cargo objects. The only settings which I don't fully understand are the CargoType= entries, though I suspect that 1 is used for explosive cargo, and 0 for any other cargo type.

Quote:

Originally Posted by Rongel (Post 2075794)
So there is two options. We could just put cargo to these big ships that already have the nodes, and enough space for every type of cargo. Downdside is that these ships are relatively rare, and most of the ships would still be empty. The second option is that we could add the nodes to every cargo ship, and only put small cargo items to them. Ofcourse we can still add large items to specified convoys that have big ships that can carry them.

Phew, I hope this is understandable! My option would be the later, add the nodes to every cargo ship and just place smaller crates, tanks and trucks to the ships, every cargo ship can carry them just fine.

I agree with you about the second option :up:

Quote:

Originally Posted by Rongel (Post 2075794)
Oh, by the way, I added some missing zone boxes and spheres to the cargo.zon file, and it worked great, we can get the cargo to be destroyed in many different ways! Here is one poor truck heading to depths

Cool!
By selecting wisely the zone type assigned to each damage box, we can get cargo to explode, take fire, etc. If needed, we can also set new cargo zones :03:

Fifi 06-25-13 03:31 PM

Guys, that's a great find :yeah:
Can't wait to download a new sea folder with brand new cargos full of wonderful loads :D

gap 06-25-13 04:34 PM

Just realized that some objects in ship_cargo.GR2 are not set in CargoDef.cfg. They are:

jeep1
Firetruck
Willis

Also note that the Willys MB Jeep is missing its textures. It could be that it didn't get any texture assigned, or that its meshes are missing UV mapping at all :hmm2:

gap 06-25-13 05:30 PM

Quote:

Originally Posted by gap (Post 2075876)
Also note that the Willys MB Jeep is missing its textures. It could be that it didn't get any texture assigned, or that its meshes are missing UV mapping at all :hmm2:

Okay, I had a closer look into the MB Jeep. It is UV mapped, and texture is assigned in the GR2 file. There is just one problem: the texture file that was supposed to be mapped on the meshes, is missing from the texture folder... yet another blunder by devs :nope:

Now it is a matter of rebuilding the texture starting from the UV mapping...

Fifi 06-25-13 08:41 PM

Might sound stupid, but is the Willis really needed?...tanks and trucks are already nice :hmmm:

Rongel 06-26-13 05:33 AM

Quote:

Just realized that some objects in ship_cargo.GR2 are not set in CargoDef.cfg. They are:

jeep1
Firetruck
Willis
I did a test and added these to the cargodef.cfg as new entries, like this:

[CargoEntry 14]
NodeName=Jeep
LinkName=jeep1
StartDate=19380101
EndDate=19451231
CargoType=0

[CargoEntry 15]
NodeName=Firetruck
LinkName=Firetruck
StartDate=19380101
EndDate=19451231
CargoType=0


And it worked! I could select them from the mission editor, and they appeared in game also. Yep, the jeep is missing textures, and the Willis-car could maybe use better textures, looks a bit ugly to me. But I don't know anything about the UV-stuff (and I don't want to know :D).

I did another test as well, I think the most important test so far. I modded the Coastal Waters campaign, so that all the random traffic cargo ships have some external cargo. I added k-nodes to HogIsland ships and started a new campaign. While patrolling near Poland I met this one HogIslander, and yes it had external cargo! So this is a random ship, I haven't placed manually any cargo to it.

http://i1231.photobucket.com/albums/...-26_130910.jpg

Everything seems to work so far!


All times are GMT -5. The time now is 10:55 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.