SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 09-02-12, 01:55 PM   #1171
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Now I embark upon the long journey of trying to implement what gap and I discussed here publicly. I will take a baby step approach to this. First order of business is modifying my unit spawner code so that I can specify minimum and maximum spawn ranges (I already have the maximum range coded in just have to add the minimum range). After that I have to figure out how the game keeps track of all units in game (when spawned where are they added to, specifically which function is called that adds them and when despawned what function is called to handle this).
The current version of the patcher allowed for 3 extra words in memory per spawned sub that are currently free and can be used for whatever. One of those words will hold the pointer to the spawned sub when I update the code (this way I can get information from it - depth, speed, number of waypoints, etc.). The other two words are for future use which I currently have no plans for.
After storing the pointer to the spawned sub I should be able to spawn the subs very far out (>=50km maybe even 100km away) and force the player to send status reports frequently which will update the spawned sub's waypoint so they continue heading on the correct course. This all depends on how the game handles waypoints which I'm not well versed in yet (for example when a unit attains a waypoint is that waypoint deleted from memory or is there a pointer that points to the current waypoint and is just updated to point to the next waypoint?) This, ultimately, will decide if I can implement gap's idea. I also have to figure out how to update a unit's waypoint for I will need that for this patch and for some ideas I have for the future.
I also have to figure out how to send the radio messages (the official ones) the game has so I can remove the messagebox one. This is needed again for this patch and for some crazy ideas I have for the future
TheDarkWraith is offline   Reply With Quote
Old 09-02-12, 02:42 PM   #1172
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Now I embark upon the long journey of trying to implement what gap and I discussed here publicly. I will take a baby step approach to this. First order of business is modifying my unit spawner code so that I can specify minimum and maximum spawn ranges (I already have the maximum range coded in just have to add the minimum range). After that I have to figure out how the game keeps track of all units in game (when spawned where are they added to, specifically which function is called that adds them and when despawned what function is called to handle this).
The current version of the patcher allowed for 3 extra words in memory per spawned sub that are currently free and can be used for whatever. One of those words will hold the pointer to the spawned sub when I update the code (this way I can get information from it - depth, speed, number of waypoints, etc.). The other two words are for future use which I currently have no plans for.
After storing the pointer to the spawned sub I should be able to spawn the subs very far out (>=50km maybe even 100km away) and force the player to send status reports frequently which will update the spawned sub's waypoint so they continue heading on the correct course. This all depends on how the game handles waypoints which I'm not well versed in yet (for example when a unit attains a waypoint is that waypoint deleted from memory or is there a pointer that points to the current waypoint and is just updated to point to the next waypoint?) This, ultimately, will decide if I can implement gap's idea. I also have to figure out how to update a unit's waypoint for I will need that for this patch and for some ideas I have for the future.
I also have to figure out how to send the radio messages (the official ones) the game has so I can remove the messagebox one. This is needed again for this patch and for some crazy ideas I have for the future
Keep us informed on any progress you will be doing TDW
gap is offline   Reply With Quote
Old 09-02-12, 03:03 PM   #1173
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Well I just found the function that's responsible for the game radio messages So one down, many to go!

Here's an interesting tid bit of info: while decoding this function call it called out to another function at the start that compared the sub's true depth to -20. The result of that determined whether you received the radio message or not. So 20m depth is the cutoff point where the game says you cannot receive radio messages

This was an important find (function responsible for radio messages) because I need this for some upcoming ideas

EDIT: it appears that if the message is critical then depth is ignored

Last edited by TheDarkWraith; 09-02-12 at 03:15 PM.
TheDarkWraith is offline   Reply With Quote
Old 09-02-12, 03:27 PM   #1174
Mikemike47
Grey Wolf
 
Join Date: Sep 2006
Location: NY
Posts: 995
Downloads: 1078
Uploads: 6
Default

Quote:
Originally Posted by TheDarkWraith View Post
Here's an interesting tid bit of info: while decoding this function call it called out to another function at the start that compared the sub's true depth to -20. The result of that determined whether you received the radio message or not. So 20m depth is the cutoff point where the game says you cannot receive radio messages

This was an important find (function responsible for radio messages) because I need this for some upcoming ideas

EDIT: it appears that if the message is critical then depth is ignored
You have created a depth option in TheDarkWraithUserOptions.py under the Radio button, "Below this depth (in meters) do not receive radio contacts/reports". default is set for 30 presently.
Mikemike47 is offline   Reply With Quote
Old 09-02-12, 04:02 PM   #1175
volodya61
Ocean Warrior
 
volodya61's Avatar
 
Join Date: Feb 2012
Location: Rostov-on-Don, local time GMT+4
Posts: 3,300
Downloads: 374
Uploads: 0


Default

Quote:
Originally Posted by Mikemike47 View Post
You have created a depth option in TheDarkWraithUserOptions.py under the Radio button, "Below this depth (in meters) do not receive radio contacts/reports". default is set for 30 presently.
I think this option configures the radio messages from the NewUI not from the game..
__________________
.
Where does human stupidity end?

.


El sueño de la razón produce monstruos © - and for some people awakening will be cruel
volodya61 is offline   Reply With Quote
Old 09-02-12, 05:08 PM   #1176
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

the things I get into......





Notice that I can spawn official radio messages now (and they are automatically added to the captain log also!) I can make the body of the message be anything I want, looking into how to change the to/from now

Those using my UIs mod the mod will intercept this and reroute it to the radio messages tab of the mod.

Oh and it will adjust the TC level to the appropriate one just like the game does when you get a radio message from it.

Now I need the official statement that Bdu would send to the U-boats for this. We can have multiple statements and I can have the patch randomly choose one if need be.

I'll be updating the Contact report wolfpack patch here in a few

If I can figure out how to change the to/from it will open up a whole world of possibilities and ideas that I have...
TheDarkWraith is offline   Reply With Quote
Old 09-02-12, 05:41 PM   #1177
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
I also have to figure out how to send the radio messages (the official ones) the game has so I can remove the messagebox one. This is needed again for this patch and for some crazy ideas I have for the future
What about friendly units asking for our support?

Quote:
Originally Posted by TheDarkWraith View Post
the things I get into......

Notice that I can spawn official radio messages now (and they are automatically added to the captain log also!) I can make the body of the message be anything I want, looking into how to change the to/from now

Those using my UIs mod the mod will intercept this and reroute it to the radio messages tab of the mod.

Oh and it will adjust the TC level to the appropriate one just like the game does when you get a radio message from it.


Quote:
Originally Posted by TheDarkWraith View Post
Now I need the official statement that Bdu would send to the U-boats for this. We can have multiple statements and I can have the patch randomly choose one if need be.
something like this?

Your request has been processed. U-xx, U-xx U-xx and U-xx are in your area and have received instructions to join your attack. Stay in front of the convoy, keep undetected and send regular position reports while you are waiting for them.

B.d.U
gap is offline   Reply With Quote
Old 09-02-12, 05:44 PM   #1178
TheBeast
The Old Man
 
Join Date: Jan 2010
Location: Lynnwood, WA
Posts: 1,533
Downloads: 886
Uploads: 23


Default

Very nice!

Would these messages be hand written or typed?

Does the game support Script type Font that looks like hand written message?

Regards!
TheBeast
__________________
Fear me! I am, TheBeastBelow

SHIV-MediaFire | SHV-MediaFire
TheBeast is offline   Reply With Quote
Old 09-02-12, 06:06 PM   #1179
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by TheBeast View Post
Very nice!

Would these messages be hand written or typed?

Does the game support Script type Font that looks like hand written message?

Regards!
TheBeast
They are typed. As far as changing the type font it's not possible. The font is dictated in the .ini file for the radio messages (so yes you could change it there via the menu editor included with the game).

I like gap's idea for the reply back from Bdu. Anyone else have any suggestions
TheDarkWraith is offline   Reply With Quote
Old 09-02-12, 06:07 PM   #1180
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Two more

Request of support on convoy attack approved. Be careful. Gain a favourable position in front of the convoy and send regular position reports while waiting for reinforcements.

B.d.U.



U-xx, and U-xx have been dispatched to your patrol area as per your request and will join you briefly. Follow enemy contact from distance and send regular updates on your position.

Befehlshaber der U-Boote



Post your ones guys: variety is the salt of life!
gap is offline   Reply With Quote
Old 09-02-12, 06:10 PM   #1181
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Two more

Request of support on convoy attack approved. Be careful. Gain a favourable position in front of the convoy and send regular position reports while waiting for reinforcements.

B.d.U.
I'll use this one for now. I can always change it later

Actually if you can come up with some that don't include U-xx in them I'll randomize it.
TheDarkWraith is offline   Reply With Quote
Old 09-02-12, 06:15 PM   #1182
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

What about BdU sending us a reminder, if the first U-boat is about to get to its first waipoint and we haven't sent a position report yet?
gap is offline   Reply With Quote
Old 09-02-12, 06:19 PM   #1183
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
I'll use this one for now. I can always change it later

Actually if you can come up with some that don't include U-xx in them I'll randomize it.
Can't you add random U-boat numbers within the text? Would be a cool feature but not a vital one indeed.

You could have reworked yourself the messages I've alredy posted, to fit our needs. They are royalty free
Anyway, since you asked me to do it, you can change the phrase:


"U-xx, U-xx U-xx and U-xx are in your area and have received instructions to join your attack"
to:
"All the U-boats in your area have received instructions to join your attack"

and this one:

"U-xx, and U-xx have been dispatched to your patrol area as per your request and will join you briefly."
to:
"several submarine units have been dispatched to your patrol area as per your request, and will join you briefly."
gap is offline   Reply With Quote
Old 09-02-12, 06:27 PM   #1184
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Can't you add random U-boat numbers within the text? Would be a cool feature but not a vital one indeed.

You can rework the messages I've alredy posted to fit our needs. They are royalty free

for instance, you can change this phrase
"U-xx, U-xx U-xx and U-xx are in your area and have received instructions to join your attack"
to:
"All the U-boats in your area have received instructions to join your attack"

and this one:

"U-xx, and U-xx have been dispatched to your patrol area as per your request and will join you briefly."
to:
"several submarine units have been dispatched to your patrol area as per your request, and will join you briefly."
Yes I could (just have to figure out how to use formatting in assembly via the functions the game exposes)
TheDarkWraith is offline   Reply With Quote
Old 09-02-12, 06:28 PM   #1185
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
What about BdU sending us a reminder, if the first U-boat is about to get to its first waipoint and we haven't sent a position report yet?
That's an interesting idea. I have to figure out the spawning and despawning functions first in order to avoid using a null pointer and causing a CTD
TheDarkWraith is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:05 PM.


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.