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)
-   -   SH3 Commander questions (https://www.subsim.com/radioroom/showthread.php?t=247950)

John Pancoast 01-06-21 04:18 AM

SH3 Commander questions
 
In an effort to liven up the brain dead escort behavior and affect some other things I've started to add items to the randomization file.
Can't grasp a few instructions though. Looked at examples in the file, googlized a bunch. Still confused.

1. In the instructions at the top of the randomization.cfg file it states from the "ChooseFrom" section "Set ChooseFrom to equal the number of different sets of data, or a higher number if you want to simulate percentage chance" Percentage chance of what ?

2. Some of the entries will have a header string "X% randomization" along with the "higher number representing a percentage chance" from #1 above.
What does that mean ?

J0313 01-06-21 07:04 AM

Quote:

Originally Posted by John Pancoast (Post 2718861)
In an effort to liven up the brain dead escort behavior and affect some other things I've started to add items to the randomization file.
Can't grasp a few instructions though. Looked at examples in the file, googlized a bunch. Still confused.

1. In the instructions at the top of the randomization.cfg file it states from the "ChooseFrom" section "Set ChooseFrom to equal the number of different sets of data, or a higher number if you want to simulate percentage chance" Percentage chance of what ?

2. Some of the entries will have a header string "X% randomization" along with the "higher number representing a percentage chance" from #1 above.
What does that mean ?

I think Sailor Steve is the guy that needs to see your question. He knows alot about SH3 Commander. IIRC

LGN1 01-07-21 04:50 PM

Hi John,


SH3 Commander chooses with equal probability one number between 0 and the number of choose from. If the number is higher than the numbers you have given values to, then nothing is changed. With this you can adjust the probabilities for the different events.


Here's an example: You have a variable xABCD that has a value of 1 in the game. Now you would like to have that the variable stays equal 1 with a 50% chance, but with 25% probability changes to 2 and with 25% probability to 3.



In this case you set 'ChooseFrom=4' (because then every event has a 25% probability) and


0_xABCD=2
1_xABCD=3


Given this SH3 Commander changes the value to 2 if 0 is chosen, to 3 if 1 is chosen and does nothing if 2 and 3 are chosen.


You could achieve the same with:


0_xABCD=2
1_xABCD=3
2_xABCD=1
3_xABCD=1


I hope this is clear. If not please ask.


Best, LGN1

John Pancoast 01-07-21 05:44 PM

Quote:

Originally Posted by LGN1 (Post 2719454)
Hi John,


SH3 Commander chooses with equal probability one number between 0 and the number of choose from. If the number is higher than the numbers you have given values to, then nothing is changed. With this you can adjust the probabilities for the different events.


Here's an example: You have a variable xABCD that has a value of 1 in the game. Now you would like to have that the variable stays equal 1 with a 50% chance, but with 25% probability changes to 2 and with 25% probability to 3.



In this case you set 'ChooseFrom=4' (because then every event has a 25% probability) and


0_xABCD=2
1_xABCD=3


Given this SH3 Commander changes the value to 2 if 0 is chosen, to 3 if 1 is chosen and does nothing if 2 and 3 are chosen.


You could achieve the same with:


0_xABCD=2
1_xABCD=3
2_xABCD=1
3_xABCD=1


I hope this is clear. If not please ask.


Best, LGN1


Hi LGN1,
Really appreciate the reply; your knowledge will be a big help. Lots of questions.
I understand the examples you made but here's where I get confused. One of the malfunction options, just chosen at random.

[Mal1:data\Library\Cameras.dat]
;1940 10% randomization <---- I take it this is just a comment line ?
ApplyToPeriod=19400101|19411231
ChooseFrom=90 <---How does 90 equate with the 24 items below ? I can't figure it out with the 10% randomization.
RndMidPat=1

0_x2ECD=20 ;Attack Periscope Drops duration[4]
0_x2EE2=20 ;Attack Periscope Blur duration[3]
1_x2ECD=37
1_x2EE2=37
2_x2ECD=60
2_x2EE2=60
3_x2ECD=3600
3_x2EE2=3600

4_x2ECD=37
4_x2EE2=37
4_x2AFC=18 ;Obs Periscope Drops duration[4]
4_x2B11=18 ;Obs Periscope Blur durarion[3]

5_x2ECD=3600
5_x2EE2=3600
5_x2AFC=18
5_x2B11=18

6_x2ECD=20
6_x2EE2=20
6_x302F=1.5 ;Zoom
6_x304E=1.5 ;Zoom

7_x302F=1.5
7_x304E=1.5

8_x302F=6.0
8_x304E=6.0

And as long as I have your attention :), I found this post of yours in my searches and have a question about it too.(and really like the idea/damage report idea vs. hex offsets).

https://www.subsim.com/radioroom/sho...d.php?t=158782

Using this example at random, why does the MnID have to also be used vs. only the Key part of a command ?:

;----------Bold decoy failure begin-----------------------------------
[0:data\Cfg\Commands_en.cfg]
;Bold decoy is not working
;Chance: 10%
ApplyToPeriod=19390101|19450508
ChooseFrom=10
RndMidPat=1

0_Cmd200|MnID= ; Empty MnID
0_Cmd200|Key0= ; Empty command
;No warning. You only know after trying.


[0:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=10
RndMidPat=1

0_Cmd200|MnID= ; Empty MnID
0_Cmd200|Key0= ; Empty command

Hope all is well,
John

LGN1 01-08-21 05:18 PM

Hi John,


yes, a semi-colon at the beginning of a line is for comments.


To understand your example you have to know that you can change more values in a file with one 'set'/'block'. A 'set'/'block' is indicated by the 0_.... 1_.... , ....


You can see the numbers 0_... to 8_... in your example. That means you have nine possible 'sets'/'blocks' which all change more than one variable (up to four variables). Nine (0,...,8) possible choices with ChooseFrom=90 means that every 'set'/'block'/event gets a 10% probability.


As you can see the file is quite powerful. Actually, the only thing that is missing is that you could change parameters in different files in a coordinated/correlated way. That would allow you, e.g., to change values in a *.dat file and change the menu....txt in order to have a message appearing.


I hope this is clear.


Concerning your MnID question: I don't remember exactly, but I guess that I wanted to also disable the button in the GUI so that the player cannot use the GUI to still trigger the order.


Best, LGN1

John Pancoast 01-08-21 06:11 PM

Ah, makes perfect sense now ! My error was thinking in terms of individual lines vs. blocks.
One other: the numbers [4] and {3] in my example after the "Attack Periscope Drops duration", etc. What are they describing ?
Yes, I'm just realizing the powerful ability of the program's functions. Have changed a few minor things in the game already with it but this opens up all kinds of possibilities.
Been using TimeTraveler's old program for the hex offset information.

Also appreciate the information about your commands.cfg editing. Makes sense.

Best,
John

FUBAR295 01-09-21 12:46 AM

Thank you both for a interesting thread. This has inspired me to work on a message project I was thinking about. Some of what is here will be very useful.

Good hunting,
FUBAR295

LGN1 01-09-21 04:44 PM

Hi John,


I don't know why the numbers are there. But since they are part of a comment, they have no effect. Maybe these are the stock values (3 and 4 seconds) so that one has a reference :hmmm:


One word of caution: Finding the correct hex value is not always easy and since S3D adds a comment to the beginning of a file, hex offsets are often different between stock and modified files! I recommend to have a test file with all probabilities equal 100% and then activate the 'no-launch' option in SH3 Commander. This allows you to quickly test your work by opening the modified file with S3D (after SH3 Commander has modified it) and check whether the value has indeed been changed. Using this method I have found quite a few wrong hex offsets...


Best, LGN1

John Pancoast 01-09-21 04:57 PM

Quote:

Originally Posted by LGN1 (Post 2720053)
Hi John,


I don't know why the numbers are there. But since they are part of a comment, they have no effect. Maybe these are the stock values (3 and 4 seconds) so that one has a reference :hmmm:


One word of caution: Finding the correct hex value is not always easy and since S3D adds a comment to the beginning of a file, hex offsets are often different between stock and modified files! I recommend to have a test file with all probabilities equal 100% and then activate the 'no-launch' option in SH3 Commander. This allows you to quickly test your work by opening the modified file with S3D (after SH3 Commander has modified it) and check whether the value has indeed been changed. Using this method I have found quite a few wrong hex offsets...


Best, LGN1

Hi LGN1,
Good idea, thanks ! Makes your command file idea even more appealing. Really appreciate your help.

John

John Pancoast 01-12-21 01:41 PM

Hi LGN1;
I know how to find the hex offset info. in TimeTraveler's mini-tweaker but where do you get that same info. in S3D ?

Best,
John

LGN1 01-12-21 05:13 PM

Hi John,


I don't know whether you can get this information from S3D.


I use a hex editor in combination with, e.g., the information from TimeTraveler, to find the location in the stock files. Then I look for the same hex pattern around the stock location in the modified file and extract the new hex offset. If this offset is wrong (I check with S3D whether the value has been changed correctly), I try different hex offsets 'left' and 'right' of my first guess. Usually, I find it +/-1 offset.


No rocket-science or deep understanding required, just compare patterns and make smart guesses :D


Best, LGN1

John Pancoast 01-12-21 05:30 PM

Quote:

Originally Posted by LGN1 (Post 2720834)
Hi John,


I don't know whether you can get this information from S3D.


I use a hex editor in combination with, e.g., the information from TimeTraveler, to find the location in the stock files. Then I look for the same hex pattern around the stock location in the modified file and extract the new hex offset. If this offset is wrong (I check with S3D whether the value has been changed correctly), I try different hex offsets 'left' and 'right' of my first guess. Usually, I find it +/-1 offset.


No rocket-science or deep understanding required, just compare patterns and make smart guesses :D


Best, LGN1

Got it, thanks ! I figured I was as usual missing something staring me in the face so thats a relief. :haha:


All times are GMT -5. The time now is 11:15 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.