View Single Post
Old 04-06-09, 07:26 PM   #1
bobchase
Torpedoman
 
Join Date: Jan 2008
Location: Pearland, Texas
Posts: 118
Downloads: 21
Uploads: 0
Default Working Gyrocompass Vernier

I came home sick from work, got bored, and I was playing around with the idea of making a vernier dial on the Gyrocompass work today. I was Semi-successful because I don't do photoshop well and I only partially understand the links in the files.

1st - I run a stock version of the game (1.4b) with various mods I added or copied.

I copied the following section of the dials.cfg

[Dial20]
Name=SpeedFdbk
Type=1; DIAL_SPEED
Cmd=Set_speed,Crew
Dial=0x3F1B0001
CrtVal=0x3F1B0002
NewVal=0x3F1B0003
DialVal=-150,150
RealVal=0,10.3; knots
Circular=Yes

Then I put the copy at the end of the file and made the following changes:

[Dial52]
Name=Add_CompassVernier
Type=12; DIAL_GYROCOMPASS
;Cmd=Set_course,Crew
Dial=0x3F1D0001
CrtVal=0x3F1D0005
;NewVal=0x3F1D0003
;DialVal=-180,180; degrees original
DialVal=-6480,6480
RealVal=-180,180; degrees original
Circular=Yes
Dynamic=Yes

We don't need the 'cmd' or the 'NewVal' sections because we arn't going to click on this dial. The new 'DialVal' is 360 / 10 * 180 = 36 * 180 = 6480. This gives us 10 turns of the dial for every 10 degrees of course change.

The last thing we need to do with the dials.cfg file is to increment the number of dials allowed up at the top of the file by one.

[DIALS]
;DialsNo=52
DialsNo=53

Now we open the menu_1024_768.ini file and find the following entry.
[G3F I67]

Name=Center
;Type=1030;Static bmp (original)
Type=1031;Static bmp array
ItemID=0x3F1D0005
ParentID=0x3F1D0000
Pos=20,-35,61,61
Materials=1
;Display=0;No stretch (orginal)
Display=5;Linear&rotation
Mat 0=data/menu/gui/layout/dialsfdbbob4.tga
;Crop 0=0.878906,0.757813,1,1; (original)
;Crop 0=0.878906,0.757813,0.12,0.24; good
;Crop 0=0.878906,0.757813,0.118,0.232 better
MatFlags=0x9
TexFmt=0x9
Drag=false
BmpState=1
NeedFocus=true
SelOne=false
IdGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

I changed the dial 'Type' to 1031 and change the 'Display' to 5. And that's where the problems started. I played with the 'Crop' settings to get the original dialsfdb.tga to work and I was fairly successful at getting that to work. However, the Vernier dial has lighting effects that are very noticeable when the dial starts spinning. So I made my own file with no lighting effects and that is why all of the 'Crop' elements are rem'ed out in the example below. (I'm using the file in a one-to-one import.)

You may have noticed that your officer will say 'New course is 257 degrees' while the printed words in the message area say '254 degrees'. Well, the vernier is about as accurate as that is. It's about +/- 3 degrees from actual, depend on what you deem 'actual'. So if you call for a course of 010 degrees and the vernier shows the numeral 1 or 2 at the top, you are working well within the allowances of the game. (But it is fun to watch it spin around when you are making turns!)

I'll put the three files up on my FileFront page if you want to play with them. If any of you 'uber modders' want to incorporate this into your designs, it's just fine with me, and no credit is needed or desired. All I did was find the path - you can do the hard lifting of making it look pretty!

Have fun,

Bob
bobchase is offline   Reply With Quote