View Single Post
Old 09-04-12, 11:44 PM   #1261
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Hmm..what do we see below



Why it's a message from another unit to us! I didn't have the menu entries added for units to select a random message so I gave it a pointer to the Bdu messages, that's why it's message doesn't make any sense. Now you may ask why it's unit name is VIIC60. Good question! The reason is because when I asked the game for next available unit name it returned VIIC#1. I sent the pointer to that string to my function that changes everything starting at the # sign to random numbers, thus getting VIIC60. Now VIIC60 isn't a U-Boat hull number so I will send that pointer to the string to a new function that will write a random uboat hull number into it. Now this new U-boat hull number will be forever assigned to this unit while it's spawned (thus it may send out more messages over time )

I can send any kind of message now: unit to player, Bdu to player, Bdu to unit, unit to Bdu, unit to unit, etc. This opens up WHOLE new opportunities/possibilities - for one I can add random radio messages from unit to unit and oh by chance the radio operator intercepted it

Today was a very productive day. In addition to the above I can now retrieve the current game time anytime I need it (local and what the game calls base time - if you're using my UIs mod this would be akin to local = nautical and base time = GMT). The game returns the current game time (or base time if I'm asking for that) in two parts - the time part (in 24hr format) and the date part (in year,mo,day format - i.e. 19400101). I can also apply formatting to strings so I will change the Bdu messages to say how many subs are being dispatched to you

Oh and I can't forget the big one - I found the pointer to the player's u-boat hull number. Now I should be able to point that to another string so that you will always have the hull number you want. Trying to find the pointer to the captain's name so I can do the same thing for that!

Something that I find really interesting is the KGrid number displayed - GR21. The game is actually calling a function to retrieve this value - this tells me that the game has a working KGrid map in memory and it knows what grid you are in at all times. Now I just have to figure out why it can't display the overlay on the maps...
TheDarkWraith is offline   Reply With Quote