SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SHIII Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=195)
-   -   Reduced Merchant Ship Crew Visuals (https://www.subsim.com/radioroom/showthread.php?t=251674)

John Pancoast 01-23-22 01:07 PM

Reduced Merchant Ship Crew Visuals
 
Old news but if anyone doesn't know how to do this, here you go. NYGM has an aspect I like of various AI visual nodes for various objects in the game. I.e., aircraft, escorts, merchants each have their own visual capablities vs. the "one size fits all" of stock and some other mods.
The one size fits all approach means, i.e., that merchant "crews" have the same spotting capability as an escort crew. I agree with NYGM in that a merchant crew shouldn't have the same capabities as an escort crew and modded my installs as such per the NYGM example.
If you'd like to add it to your install(s) it is very easy and very tedious to do.
Very Easy part:
- Simply open the "AI_Sensors.dat" file and add a visual node for the merchants.
Copying NYGM's work, that means add a node called "X"_Visual" in the same format as the standard "AI_Visual" node already present in your AI_Sensors.dat file. You can call this new node anything you want, but it's name has to also be entered in each ship's .sns file per below, so the simpler the name the easier and less time consuming that is to do.
Make it's sensors MaxRange at least half of your environment size. I.e., 16k env. would have an 8k meter range, 20k would be 10k, etc. You can make it whatever range desired if felt that even half range is to much, etc.
Very Tedious part:
- each merchant ship in your install than has to have it's .sns (sensors) file visual node changed to reflect the above. The visual node is usually the first one listed in the .sns file.
With dozens of merchant ships in most installs you can see how this is tedious. I imagine Teddy Bar made a program to do this quickly for the NYGM work but most of us will have to do it by hand, one at a time.
Long ago in the dos days there were commands to do this all at once too but I can't remember what happened last week let alone that far back. :)

I've attached a link to show an example of what needs to be done., using a ship from IABL's MFM mod and the stock AI_Sensors.dat file
Now you can have merchant crews have their own visual ability (or lack thereof).
You can even reduce the range even more to try to simulate the "inside the convoy" night attacks various Commanders actually did, which can be hard to do in most installs due to the shared visual abilities.
But be careful doing this; you don't want them completely blind. :)


Last but not least, apply via JSGME.

FUBAR295 01-23-22 07:32 PM

John,

Thanks for posting this. :salute: I felt some of the merchant had too good of an eye. That's some of the reason I play NYGM a lot more than some of the other supermods.

Now I have some more tweaking and mod making to do. :doh: :haha:

Good hunting,
FUBAR295

John Pancoast 01-23-22 09:34 PM

Yes, that's why I did it for other installs. I don't use any one megamod but bits and pieces from them and stock both.

Fifi 01-24-22 03:02 AM

Good tips John, and what you described for merchant visual, we can do exact same for planes in data/air :up:

John Pancoast 01-24-22 05:39 AM

Quote:

Originally Posted by Fifi (Post 2789541)
Good tips John, and what you described for merchant visual, we can do exact same for planes in data/air :up:


Exactly ! You can do it for anything desired.

Mister_M 01-24-22 07:20 AM

Would be cool to post the NYGM values of each X_visual sensor (or your own version), along with the Sensors.cfg and Sim.cfg (in data/Cfg folder).

:Kaleun_Wink:

John Pancoast 01-24-22 07:55 AM

Quote:

Originally Posted by Mister_M (Post 2789556)
Would be cool to post the NYGM values of each X_visual sensor (or your own version), along with the Sensors.cfg and Sim.cfg (in data/Cfg folder).

:Kaleun_Wink:

I don't have a way to post photos/screenshots but here are the files needed from a base NYGM install. S3D or Timetraveler's program are needed to view the ai_sensors.dat file, the relevant nodes are at the top of the list.
In terms of my own the only one I've ever been interested in is the merchant visual ability, so I just use the NYGM values as is for a 16k env. or halve the range for an 8k env.
I don't worry about different install sensors or sim.cfg settings in using a merchant node; I'm just interested in reducing it and a simple range and/or MaxBearing change will do that regardess. Fine adjustments not needed in other words in my opinion.
But if desired, one would look at the sim.cfg file vs. the sensors.cfg file; the sensors.cfg file is for one's crew, etc. whereas the sim.cfg file affects the ai visuals, etc.

Mister_M 01-24-22 01:37 PM

Quote:

Originally Posted by John Pancoast (Post 2789558)
I don't have a way to post photos/screenshots but here are the files needed from a base NYGM install. S3D or Timetraveler's program are needed to view the ai_sensors.dat file, the relevant nodes are at the top of the list.
In terms of my own the only one I've ever been interested in is the merchant visual ability, so I just use the NYGM values as is for a 16k env. or halve the range for an 8k env.
I don't worry about different install sensors or sim.cfg settings in using a merchant node; I'm just interested in reducing it and a simple range and/or MaxBearing change will do that regardess. Fine adjustments not needed in other words in my opinion.
But if desired, one would look at the sim.cfg file vs. the sensors.cfg file; the sensors.cfg file is for one's crew, etc. whereas the sim.cfg file affects the ai visuals, etc.

Thanks ! :up:

Jeff-Groves 01-24-22 05:43 PM

This is where the Scripting ability of 010 Editor would be VERY handy.
:03:

You tell it to search the cfg files for a given Type,
if found open the sns file and replace the O01 line with the new sensor.

A Complete install adjusted in probably less then a minute!

Jeff-Groves 01-24-22 07:14 PM

Here's a quick example on how to do it.

Code:

//------------------------------------------------
//--- 010 Editor Script File
//
//      File: Silent Hunter AI Adjuster
//  Authors: Jeff Groves
//    E-mail: Privateer@GMX.US
//  Version: 1
//  Purpose: Script to change the AI Sensors on Merchant Ships
//  Category: Change Code for SH3/4
//  History:
//  1    2022/1/24 Jeff Groves
//------------------------------------------------
    int i, X;
    char Y[20];

    X = InputRadioButtonBox( "Select your search", "You are about to Find all Merchent Ships", 0, "Abort", "Merchant Ships");
   
    if( X != 1)
      {
        Y = "Abort";
        End;
      }

      else

      { 
        Y = "UnitType=101";
      }

    Printf( "You searched for %s\n", Y );

    TFindInFilesResults r = FindInFiles( Y, InputDirectory( "Select Folder to search", "C:\\" ), "*.cfg" );
 
      for( i = 0; i < r.count; i++ )
      {
          Printf( "%s\n", r.file[i].filename );
      }

OutputPaneSave( "C:\\temp\\data2.log" );

Easy to add Else if statements for all Merchant Types.

Jeff-Groves 01-24-22 07:37 PM

Once you have the Merchant identified?
You just tell 010 to open it's .sns file and replace the O01 line then close the .sns file.

FUBAR295 01-24-22 08:15 PM

Wow Jeff, thanks !:yeah:

John Pancoast and I were just discussing this very thing in a PM. Add mind reader to the list of talents you have.

Again, thank you very much!!!

Good hunting,
FUBAR295

Jeff-Groves 01-24-22 08:28 PM

The Scripting ability of 010 is why I push it so much!
I rarely program a full exe now days because of it's open abilities!
Sure it costs a few bucks but it is HANDS DOWN the best thing since sliced bread!
:haha:

You see how fast I did a simple example Script?

That Script is actually just an edited Script I had on hand for finding the Shadow objects in the dat files.
So once you have a Script? It's easy to modify them for other needs!

I have to spend a few days in a Motel so I may try to do a complete Script for you to whack the files in one swoop.
No promises but I'll see what happens.

Now. Since ALL Merchants are Types 100 to Type 105?
You could Wild Card the Search to keep from doing multiple Else If statements.

John Pancoast 01-24-22 08:51 PM

Thanks Jeff ! :up:

Jeff-Groves 01-24-22 08:52 PM

A WildCard search on a Stock SH3 shows 23 Units.
:03:
Stock GWX shows 72
Easiest is just search a UnitType=10.
That will pop them all.

NOW! Right here is where We can change things up!


for( i = 0; i < r.count; i++ )
{
Printf( "%s\n", r.file[i].filename );
}


Here is where We can grab file names and direct 010 to open the sns file and change things.
I'll strip the cfg extension and tell 010 to open the ShipName.sns file. Then have it find the O01 line and change it.
then it will simply close the file with the changes made.


All times are GMT -5. The time now is 08:45 PM.

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