Log in

View Full Version : Slide rule: Modder's help needed for adding a neat tool to the nav map!


lambda*sqrt(u*x)
02-03-08, 03:37 PM
Erm... I'm a geek when it comes to calculating stuff in combat sims. I really appreciate the OLC GUI for adding a nomograph and the U-Jagd tools...

...but I want something a bit more flexible. I feel the urge for having a plain slide rule, basically a ruler with a logarithmic scale embracing a sliding tounge with exactly the same scales aligned. When you slide the tongue, you add up or subtract logarithms, and the scales' index numbers actually represent multiplications or divisions. Usually, a slide rule also sports a transparent sliding window with at least one line for just helping you out as a "numeric memory", and several other lines that represent basic unit conversions.

For anyone interested, please contact me, I will provide the graphics, if you provide me
_the config file entries and the how-to to manually add it to any mod or version of SH3_.

Feel free to add your thoughts here, I'm not going to take more credit than scanning an original slide rule (got a 1940's one) for the one who helps turning this into a mod.

First thoughts: I _guess_ this can only be achieved by adding 3 separate draggable items (ruler, tongue and window), I have not seen a draggable item with subsequent moving parts yet.

onelifecrisis
02-03-08, 04:45 PM
I thought a slide rule was added to U-Jagd in v1.3? :hmm:

lambda*sqrt(u*x)
02-03-08, 04:49 PM
I thought a slide rule was added to U-Jagd in v1.3? :hmm:
You mean the circular "back" of the whiz-wheel? Now tell me one can use U-Jagd together with your GUI???

EDIT: I mean a linear one, a plain scientific slide-rule

joegrundman
02-03-08, 06:07 PM
There is no difference between a linear sliderule and a cricular sliderule except that one is linear and the other circular. Circular sliderules, however, are possible to make in SH3 while linear ones are more difficult...although you could maybe do it with a slider function I guess.

At present if you want to incorporate the sliderule into OLCGUI you'll have to do it yourself. If you are serious about it i can tell you how to do it.

lambda*sqrt(u*x)
02-03-08, 06:13 PM
There is no difference between a linear sliderule and a cricular sliderule except that one is linear and the other circular. Circular sliderules, however, are possible to make in SH3 while linear ones are more difficult...although you could maybe do it with a slider function I guess.

At present if you want to incorporate the sliderule into OLCGUI you'll have to do it yourself. If you are serious about it i can tell you how to do it.
Yes, I am serious about! I would love to see the B-Side of the Attack Disk in my OLC/GWX/RealNav environment!

EDIT: Just for a start... would it be possible to add a draggable item with two child items that would move with the main one and could be moved on their own (dependent on where you click)?
More basic: How can I add a draggable item?

joegrundman
02-03-08, 06:46 PM
There are two versions of the sliderule available.

The one that is bundled with U-jagd is modelled on the American SACF, which I find more versatile. For that one you'll need to download the entireU-jagd mod and find the relevant files yourself. Easier is to use the version of Hitman's sliderule to act as the B-side (in fact there is no real B-side, the sliderules were entirely separate) as the image files for that come as a separate download.

I'll assume you want to do the latter - it's much simpler.

Go to my filefront and download and extract the files called

U-jagd_alt_sliderule2.7z

Now you need to open it and copy the file called U-jagd.

Now go to the OLC mod folder. Make sure OLC GUI mod is uninstalled using JSGME.

Go to data/menu in the OLC mod and click paste.

You should now see a folder called U-jagd.

Now in the data/menu folder, you should see a cfg file called menu_1024_768.
Back it up as a safety measure. Then click on it to open it.

IF YOU HAVE MADE ANY OTHER ADJUSTMENTS TO OLCGUI, SUCH AS THE LARGE COMPASS ADD ON OR THE DRAGGABLE CHRONO, DO NOT PROCEED - TELL ME AND I"LL TELL YOU WHAT SHOULD BE DONE.

Also note that this version does not include the small KMcentreknob image. If you want it then you should get it from the main U-jagd download and paste it into the U-jagd folder you have just created.

Go to the end and paste in the following section

;;;;;;;;;;;sliderule;;;;;
[G3F I387]
Name=sliderule
Type=1026;Menu group
ItemID=0x3F070010
ParentID=0x3F070000
Pos=-600,630,600,600
Color=0xFFFFFFFF
VertSlide=-720

[G3F I388]
Name=sliderule centreknob
Type=1031;Stat bmp array
ItemID=0x3F070015
ParentID=0x3F070010
Pos=279,-276,46,46
Materials=1
Display=0
Mat 0=data/menu/U-jagd/kmcentreknob.tga
MatFlags=0x29
TexFmt=0x9
BmpState=0
NeedFocus=true
SelOne=false
IDGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

[G3F I389]
Name=sliderule zeitrad
Type=1031;Stat bmp array
ItemID=0x3F070011;3B200001
ParentID=0x3F070010;3B200000
Pos=144,-1,316,596
Materials=1
Display=5;Linear&Rotation
Mat 0=data/menu/U-jagd/sliderulezeitrad.tga
Crop 0=0,0,1,1
MatFlags=0x29
TexFmt=0x9
BmpState=1
NeedFocus=true
SelOne=false
IDGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

[G3F I390]
Name=sliderule zeitrad user
Type=1031;Stat bmp array
ItemID=0x3F070012;3B200002
ParentID=0x3F070010;3B200000
Pos=144,-142,316,316
Materials=1
Display=2
Mat 0=data/menu/U-jagd/bkgr.tga
Crop 0=0,0,1,1
MatFlags=0x1
TexFmt=0x0
BmpState=1
NeedFocus=true
SelOne=false
IDGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

[G3F I391]
Name=sliderule Peilung wheel
Type=1031;Stat bmp array
ItemID=0x3F070013;3B200003
ParentID=0x3F070010;3B200000
Pos=73,-73,454,454
Materials=1
Display=0; no stretch
Mat 0=data/menu/U-jagd/sliderulepeilungwheel.tga
Crop 0=0,0,1,1
MatFlags=0x29
TexFmt=0x9
BmpState=1
NeedFocus=true
SelOne=false
IDGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

[G3F I392]
Name=circularsliderule
Type=1031;Stat bmp array
ItemID=0x3F070014;3B200004
ParentID=0x3F070010;3B200000
Pos=0,0,600,600
Materials=1
Display=5;Linear&Rotation
Mat 0=data/menu/U-jagd/circularsliderule.tga
Crop 0=0,0,1,1
MatFlags=0x29;21
TexFmt=0x9
BmpState=1
NeedFocus=true
SelOne=false
IDGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

[G3F I393]
Name=circularsliderule user
Type=1031;Stat bmp array
ItemID=0x3F070015
ParentID=0x3F070010
Pos=0,0,600,600
Materials=1
Display=2
Mat 0=data/menu/U-jagd/bkgr.tga
Crop 0=0,0,1,1
MatFlags=0x1
TexFmt=0x0
BmpState=1
NeedFocus=true
SelOne=false
IDGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

;;;;;;;;;;;;;;;;End U-jagd tools;;;;;;;;;

Save and close the file

Now open the folder labelled cfg in the OLC mod file and backup and open the file named Dials.cfg.

At the top of the page alter the following line

DialsNo=74, change to, DialsNo=76

Now go to the end of this file and paste in the following section

;;;;circularsliderule
[Dial74]
Name=zeitrad
Type=42; DIAL_TGT_ANG_ON_BOW
Cmd=Set_tgt_sel_value
Dial=0x3F070012;3B200002
CrtVal=0x3F070011;3B200001
NewVal=0x0
DialVal=-180,180
RealVal=-180,180; degrees
Circular=Yes
CmdOnDrag=Yes
RelativeDrag=Yes

[Dial75]
Name=circularsliderule
Type=16; DIAL_TORP_DEPTH
Cmd=Set_torpedo_depth
Dial=0x0x3F070015
CrtVal=0x0x3F070014
NewVal=0x0
DialVal=0,360
RealVal=5,5.2; meters
Circular=Yes
CmdOnDrag=Yes
RelativeDrag=Yes

;;;;;u-jagd sliderule

That's it.

To activate it, you must FIRST click on the weapon officer and SECOND drag the mouse cursor to the bottom centre of the screen.

NOTE: I haven't tried this. Let me know how it goes

Good luck

joe

joegrundman
02-03-08, 06:50 PM
EDIT: Just for a start... would it be possible to add a draggable item with two child items that would move with the main one and could be moved on their own (dependent on where you click)?
More basic: How can I add a draggable item?

Yes of course it is. It's easy in fact.

To do it at the bottom of the parent object entry in the menu_1024_768 file you add the line

Draggable=Yes

Study the entries for the ubiquitous mod "Jonz draggable chrono" for exactly how it can be done.

joegrundman
02-03-08, 06:56 PM
OK Belatedly i realise you have already combined OLC with Real Nav.

You need to do the following correction to the menu_1024_768 entries.

Go to the bottom of the menu_1024_768 file. Click at the bottom of the file to move teh cursor there.

Go to Edit->find.

Select Up.
Type into the search field G3F.

Look at the line

[G3F I386] for example (this is what it should be in the unmodded OLC file)

Not what this number is exactly

Now for each of the entries I told you to add, you must make it such that the line

[G3F I...] follows the previous one.

So if in your search you find the number [G3F I389], then the first entry of the sliderule should be [G3F I390] and so on to the end.

Those are the only changes you should need to make

Joe

lambda*sqrt(u*x)
02-04-08, 10:43 AM
EDIT: Just for a start... would it be possible to add a draggable item with two child items that would move with the main one and could be moved on their own (dependent on where you click)?
More basic: How can I add a draggable item?
Yes of course it is. It's easy in fact.

To do it at the bottom of the parent object entry in the menu_1024_768 file you add the line

Draggable=Yes

Study the entries for the ubiquitous mod "Jonz draggable chrono" for exactly how it can be done.

Thank you for this excellent hint. I will try that later, that's about what I was looking for!

Thank you for the instructions on how to add the circular slide rule from the U-Jagd tools.
I have to remind you though that your advice was not completely correct:

You told me to download the alternative slide rule files, but your instructions to edit menu...cfg used the filenames and positions of the original U-Jagd slide rule.
But when I follow your instructions in your post, and then paste the changes you mention in the readme file of the alternative sliderule, it works, just one change needs to be made:

Find this entry and change the highlighted line:
[G3F I...]
Name=sliderule
Type=1026;Menu group
ItemID=0x3F070010
ParentID=0x3F070000
Pos=106,630,600,600
Color=0xFFFFFFFFVertSlide=-720

to

Pos=-600,630,600,600

My assumption is that the ParentID of the circular slide rule somehow is the weapon commander's icon or his command icons, which are on the right hand side on the screen in OLC GUI, not on the left hand side in "stock" menus.
Making my addressed changes moves the slide rule to the horizontal center of the screen again as it should be.

Thank you for taking the time to work out a solution for me, I'm just about to enjoy having the slide rule :)

joegrundman
02-04-08, 06:22 PM
Thank you very much for the feedback and the correction, I'll edit the above post in case anyone else wants to try it.:D

Joe

lambda*sqrt(u*x)
02-05-08, 03:34 PM
Thank you! In the meantime I worked out a rudimentary linear slide rule... maybe I'm going to spice it up...

latemail
02-05-08, 04:56 PM
Thank you! In the meantime I worked out a rudimentary linear slide rule... maybe I'm going to spice it up...


Hi lambda,

iŽam very interested in your solution (especially in the "RelativeDrag=Yes"-part), even when itŽs rudimentary, it would be a fine extension for my modding-tutorial .... and it would be helpfull for the next FF as well :up:

if you like to share, pls post or PM the code

CU
Latemail

Puster Bill
02-05-08, 08:10 PM
I know this might be considered heretical, but why not just go ahead and use a real slide rule instead of a virtual one?

I carry a 6" Pickett N200ES Trig linear rule for when I need to be 'discrete' about playing (I use a laptop), otherwise I use Hitman's wheel (a physical version).

I picked the Pickett up on Ebay for a reasonable amount. I also have a plastic Sterling I got for $5 at an antique store.

Sometimes I even plot contacts on paper using a cheap ruler and protractor I bought.

Using a virtual slide rule is like kissing your sister: The motions might be the same, but it certainly doesn't feel the same.

joegrundman
02-05-08, 09:18 PM
Hi PB
You got some pix yet of your new circular slide rule?

Puster Bill
02-05-08, 09:43 PM
Hi PB
You got some pix yet of your new circular slide rule?

Sorry! I just got busy with things, and forgot to post one.

Here is a picture of it:

http://img524.imageshack.us/img524/8233/picture054qg3.jpg

I've used it a couple of times.

I ran out of transparencies, so I had to make the small wheel with the indicator arm out of cardstock.

I'm not entirely happy with it though, for a couple of reasons.

First, my printer seems to 'drag' when I feed it cardstock. Whenever I print out one of these things on cardstock and then cut them out, they aren't exactly round. It's more of an aesthetic problem then an accuracy one, but it's annoying nonetheless (although I must mention that it did cause an accuracy problem when I made a large circular slide rule).

Second, I don't think I centered the wheels as carefully as I normally do. I did it quickly in the evening one night, and I was hurrying.

It is accurate enough, though. I've used it to sink a couple of tramp steamers.

I'm thinking about getting a DVD drive for my home machine so I can put SHIV on it, and make a really good version of the US SACF/IS-WAS, which of course this wheel is based upon. I made a mini version of the Omnimeter side, which works quite well:
http://img178.imageshack.us/img178/5346/picture055fa7.jpg

You can see that it is smaller than the German version, and in fact is less than 5 inches in diameter.

Excuse the crappy webcam pics, by the way. The good camera needs batteries.

lambda*sqrt(u*x)
02-05-08, 11:55 PM
Thank you! In the meantime I worked out a rudimentary linear slide rule... maybe I'm going to spice it up...


Hi lambda,

iŽam very interested in your solution (especially in the "RelativeDrag=Yes"-part), even when itŽs rudimentary, it would be a fine extension for my modding-tutorial .... and it would be helpfull for the next FF as well :up:

if you like to share, pls post or PM the code

CU
Latemail

Is there a RelativeDrag=xx option? If yes, I will try to get some results with these...

latemail
02-06-08, 04:44 AM
Thank you! In the meantime I worked out a rudimentary linear slide rule... maybe I'm going to spice it up...

Hi lambda,

iŽam very interested in your solution (especially in the "RelativeDrag=Yes"-part), even when itŽs rudimentary, it would be a fine extension for my modding-tutorial .... and it would be helpfull for the next FF as well :up:

if you like to share, pls post or PM the code

CU
Latemail

Is there a RelativeDrag=xx option? If yes, I will try to get some results with these...


Hmmmm, I dinŽt follow the instructions of joegrundman in detail, but he mentioned that you have to add something like the following to the Dials.cfg:

[Dial75]
Name=circularsliderule
Type=16; DIAL_TORP_DEPTH
Cmd=Set_torpedo_depth
Dial=0x0x3F070015
CrtVal=0x0x3F070014You
NewVal=0x0
DialVal=0,360
RealVal=5,5.2; meters
Circular=Yes
CmdOnDrag=Yes
RelativeDrag=Yes

You obviously found another way if I get you right .... and IŽam really interested in the "How-To-Do"!!

To get it clear for me:
- you made an object (Slide rule) which is moveable (as a MenuGroup I suppose)
- you add two objects (tongue, transp. window) to it
- you can adjust the tongue and window on the slide rule like in reality
- if you move the slide rule, the added objects keep their relativ position to it

then I have two questions:
1. how do you restrict the movemant of the added objects to a linear one?
2. how did you mange the relativ movemant of the whole group?

on my first attempt yesterday I can build only these two versions;
first - menu moving, objects fixed to the menu, but not moveable
second - menu moving, objects moving, but not together :damn:


CU

joegrundman
02-06-08, 05:33 AM
Hi Latemail

I'm not sure that you fully understand what's been said above.

I suggest you download and install the U-jagd tools mod to see what it is that has been created and how it works (although i thought you were familiar with the OLC GUI which incorporates most of the U-jagd tools).

This sliderule which we are talking about is a circular slide rule. It looks like the one in the pictures posted by Puster Bill. Lambda.... is also referring to a linear (straight) sliderule, but this is a different project.

The circular sliderule is not draggable as a whole. It uses the slideout function.

The command to make things draggable is Draggable=Yes in the menu file, and that is how the Jonz draggable chrono works, the draggable Navmap reference sheets by FLB Sale, and the draggable nomograph.

What you have seen is RelativeDrag=Yes in the dials.cfg. This is related to the property of how circular dials drag. If Relative drag =No, then the "top" position of the dial will always snap to where you click with the mouse (like the AOB notepad tool)

If RelativeDrag=Yes then the dial will rotate as you grab the dial with the mouse and drag it, like the range dial in the TDC.

klar?

However, it could be possible to make the complete dial draggable instead of slideout. I'll have a go at making that.

@ Puster Bill - nice work! The middle wheel doesn't need to be clear, just the indicator arm. You could just glue any scrap of convenient trtansparent material to it for that purpose

joe

latemail
02-06-08, 06:02 AM
Hi Latemail

I'm not sure that you fully understand what's been said above.

I suggest you download and install the U-jagd tools mod to see what it is that has been created and how it works (although i thought you were familiar with the OLC GUI which incorporates most of the U-jagd tools).

This sliderule which we are talking about is a circular slide rule. It looks like the one in the pictures posted by Puster Bill. Lambda.... is also referring to a linear (straight) sliderule, but this is a different project.

The circular sliderule is not draggable as a whole. It uses the slideout function.

The command to make things draggable is Draggable=Yes in the menu file, and that is how the Jonz draggable chrono works, the draggable Navmap reference sheets by FLB Sale, and the draggable nomograph.

What you have seen is RelativeDrag=Yes in the dials.cfg. This is related to the property of how circular dials drag. If Relative drag =No, then the "top" position of the dial will always snap to where you click with the mouse (like the AOB notepad tool)

If RelativeDrag=Yes then the dial will rotate as you grab the dial with the mouse and drag it, like the range dial in the TDC.

klar?

However, it could be possible to make the complete dial draggable instead of slideout. I'll have a go at making that.



Klar, THX for your explanations, due to my "dusty" English IŽam sometimes not really sure if I get the content right. But in this case I understand the two different projects, and I would like to solve lambdaŽs problem as well. As I wrote:

- made an object (e.g. Slide rule) which is moveable (a MenuGroup with Drag=true) - easy, DONE
- add two objects (e.g. tongue, transp. window) to it - easy, DONE
- you can drag the tongue and window - easy (Drag=true), but how to limit the movemant to a linear one?
- if you move the Group, the added objects keep their relativ position to it - no idea, didnŽt see anything like that before!!

But maybe " ... with a little help from my friends ... " :smug:

lambda*sqrt(u*x)
02-06-08, 08:10 AM
Klar, THX for your explanations, due to my "dusty" English IŽam sometimes not really sure if I get the content right. But in this case I understand the two different projects, and I would like to solve lambdaŽs problem as well. As I wrote:

- made an object (e.g. Slide rule) which is moveable (a MenuGroup with Drag=true) - easy, DONE
- add two objects (e.g. tongue, transp. window) to it - easy, DONE
- you can drag the tongue and window - easy (Drag=true), but how to limit the movemant to a linear one?
- if you move the Group, the added objects keep their relativ position to it - no idea, didnŽt see anything like that before!!

But maybe " ... with a little help from my friends ... " :smug:

Thank you joegrundman for making clear. latemail, I did not yet try it as a menu group, that's the next thing to try for... As of now, I'm just using three separate and only separately draggable items (the slide rule, its tongue, and its window), and their movement AFAIK can't be restricted to linear... that's how far my understanding goes, and I'm really new to modding, so I hope to find some new ideas and some help...

joegrundman
02-06-08, 09:14 AM
The way the U-jagd tools works is to take existing dials and give them different images.

It occurs to me that you could try using a sliderbar like you find on the message box. You have one fixed background of part of the sliderule, one slider image you replace with the second part of the sliderule and you could maybe fit a third sliderbar with the pastic indicator.

Look at this entry for the message sliderbar. there's lots to here to get you started

[G3F I149]
Name=MsgSlider
Type=1034;Slider
ItemID=0x3F040003
ParentID=0x3F040000
Pos=2,-32,15,84
Materials=8
Display=0;No stretch
Mat 0=data/menu/gui/layout/m_back.tga
Mat 1=data/menu/gui/layout/m_back.tga
Mat 2=data/menu/gui/layout/m_back.tga
Mat 3=data/menu/gui/layout/m_back.tga
Mat 4=data/menu/gui/layout/m_slide.tga
Mat 5=data/menu/gui/layout/m_slide.tga
Mat 6=data/menu/gui/layout/m_slide.tga
Mat 7=data/menu/gui/layout/m_slide.tga
MatFlags=0x1
TexFmt=0x9
SliderValue=1
SliderNumSteps=1
Vertical=true
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

Anyway it's just an idea, it may not work.

latemail
02-06-08, 09:22 AM
Thank you joegrundman for making clear. latemail, I did not yet try it as a menu group, that's the next thing to try for... As of now, I'm just using three separate and only separately draggable items (the slide rule, its tongue, and its window), and their movement AFAIK can't be restricted to linear... that's how far my understanding goes, and I'm really new to modding, so I hope to find some new ideas and some help...


Ok, so I will stay in touch, maybe we find a solution, would be very helpfull for other tools too .........

lambda*sqrt(u*x)
02-06-08, 10:54 AM
The way the U-jagd tools works is to take existing dials and give them different images.

It occurs to me that you could try using a sliderbar like you find on the message box. You have one fixed background of part of the sliderule, one slider image you replace with the second part of the sliderule and you could maybe fit a third sliderbar with the pastic indicator.

Look at this entry for the message sliderbar. there's lots to here to get you started

[G3F I149]
Name=MsgSlider
Type=1034;Slider
ItemID=0x3F040003
ParentID=0x3F040000
Pos=2,-32,15,84
Materials=8
Display=0;No stretch
Mat 0=data/menu/gui/layout/m_back.tga
Mat 1=data/menu/gui/layout/m_back.tga
Mat 2=data/menu/gui/layout/m_back.tga
Mat 3=data/menu/gui/layout/m_back.tga
Mat 4=data/menu/gui/layout/m_slide.tga
Mat 5=data/menu/gui/layout/m_slide.tga
Mat 6=data/menu/gui/layout/m_slide.tga
Mat 7=data/menu/gui/layout/m_slide.tga
MatFlags=0x1
TexFmt=0x9
SliderValue=1
SliderNumSteps=1
Vertical=true
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

Anyway it's just an idea, it may not work.
Hm... a good thing to look into - but why are all those Mat x's quadruple-referenced? Do you know a documentation about all those entries?

EDIT: OK... got an answer for this one... thanks latemail (Deutsch ist meine Muttersprache) for the menu...ini tutorial!

latemail
02-06-08, 11:31 AM
EDIT: OK... got an answer for this one... thanks latemail (Deutsch ist meine Muttersprache) for the menu...ini tutorial!


:up: :up: gut zu wissen :up: good to know that :up: :up: