Log in

View Full Version : Linear Dial Help


reaper7
04-15-11, 11:22 AM
Hi Guys need some help with getting a linear dial working.

I wish to create a linear dial like the hard-coded compass dial.
This is what I have in Dials Config


[Dial116]
Name=reaper7_Bearing Dial
Type=24; DIAL_SOL_BEARING
Dial=0x26000000
CrtVal=0x26000010; My New Bearing Graphic
NewVal=0x0
DialVal=0,360
RealVal=0,360; degrees
Circular=No

I can get it to rotate by turning the Periscope, but here is where the problem is:
The Linear dial move up/down and not left/right which is the direction I need it to go (Like the stock Bearing Compass).
Any suggestions how to achieve this :06:

Hans Witteman
04-15-11, 01:10 PM
Hi mate,

Have you try rotating your needle in paint program then adjust value?

Also negative number in dial can change orientation.

There is many ways to adjust those needles:up:

Best regards hans

reaper7
04-15-11, 05:39 PM
Hi mate,

Have you try rotating your needle in paint program then adjust value?

Also negative number in dial can change orientation.

There is many ways to adjust those needles:up:

Best regards hans

Hi mate, dial is not circular. Need to do a rectangular dial like the compass bearing at attack scope ;).

But linar dials in Sh3 seem to only work in the up/down plane (eg the Fuel Gauge) but I need to make a linar dial that rotates left/right like the hardcoded compass bearing :yep:.
Haven't managed to get it working this way :damn:.

Hans Witteman
04-15-11, 05:50 PM
Hi mate,

Have you tried to disable circular to no instead of yes in dials.cfg:


[Dial40]
Name=Fuel level
Type=34; DIAL_FUEL
Dial=0x0
CrtVal=0x3F300001
NewVal=0x0
DialVal=195,17
RealVal=0,1; normalized
Circular=No

I know it could also been control via menu_1024_768 just have a look at it sorry if my memory is not fresh enough because last year i play a lot whit menu and dials and after awhile i don't remember how i did some.

Best regards hans

Madox58
04-15-11, 06:04 PM
If you mean go from left to right or right to left?
Create a Dummy Node and attach it to that.
Then rotate the Dummy Node.
That should work.

Hans Witteman
04-15-11, 06:10 PM
If you mean go from left to right or right to left?
Create a Dummy Node and attach it to that.
Then rotate the Dummy Node.
That should work.

Yep another way around, there is so many way to do stuff in that game that why so many get confused because there is no absolute prcocedures for some aspect of modding.

Best regards Hans

Madox58
04-15-11, 06:23 PM
They don't call them 'Dummy' nodes for nothing you know.
:03:
:har:

reaper7
04-15-11, 07:55 PM
Will this work for the 2d User Interface dials or is this method for 3d model.
I'm looking to do a Interface Linear dial that need to work just like the Periscope bearing ie: rotate 360 degrees in relation to the periscope. ;)

Madox58
04-15-11, 08:06 PM
Ah, That's different.
Only one I could think to ask is danlisa.
PM him and say I suggested you contact him so if he gets upset?
He can come crab at me.
:haha:

Hitman
04-16-11, 03:04 AM
Hi Guys need some help with getting a linear dial working.

I wish to create a linear dial like the hard-coded compass dial.
This is what I have in Dials Config

Code:
[Dial116] Name=reaper7_Bearing Dial Type=24; DIAL_SOL_BEARING Dial=0x26000000 CrtVal=0x26000010; My New Bearing Graphic NewVal=0x0 DialVal=0,360 RealVal=0,360; degrees Circular=No
I can get it to rotate by turning the Periscope, but here is where the problem is:
The Linear dial move up/down and not left/right which is the direction I need it to go (Like the stock Bearing Compass).
Any suggestions how to achieve this :06:What are you trying to use the dial for? Just a repeater of where the optics are trained at, or are you willing to link it to another indicator like fuel, battery or whatever? Also on which screen do you want to put it? Or in the menu bar?

makman94
04-16-11, 05:20 AM
....
I'm looking to do a Interface Linear dial that need to work just like the Periscope bearing ie: rotate 360 degrees in relation to the periscope. ;)

can't help you with a linear dial (as i tried it at past but had only big fails) but a workaround that you can do and have a 'fake' linear dial is :

create a VERY VERY BIG rounded image with the bearings's numbers at the 'edge' of it and make it rotate as a usal rounded dial . cover it and let only a small 'window' to show you the current value that you want. this rounded dial seems and behave at the end like a fake linear one

you can see examples of this trick at 6-feeling dials (the bearing on the upper side of rudder dial) and at OLC,ACM,MaGui 's compass (the one that shows at the left bottom side of console)

reaper7
04-16-11, 05:58 AM
What are you trying to use the dial for? Just a repeater of where the optics are trained at, or are you willing to link it to another indicator like fuel, battery or whatever? Also on which screen do you want to put it? Or in the menu bar?

Its actually for my UI in SH5, but if I can get it to work it will also work in SH3/4 as well.
Its needed for both Obs and attack scope stations, and need to be linked to the following dial type Type=24; DIAL_SOL_BEARING so yes its basically a copy of the Periscope Compass Bearing but will not be showing the compass bearing but a graphic of my own design that will work in the same way as the compass bearing.
But will achieve an effect not seen in Silent Hunter yet in the Imerssion side.

Basically if I can pull it of will achieve a 3d effect within the 2d User Interface - giving a whole lot more atmospheric to the Periscope stations :D.

can't help you with a linear dial (as i tried it at past but had only big fails) but a workaround that you can do and have a 'fake' linear dial is :

create a VERY VERY BIG rounded image with the bearings's numbers at the 'edge' of it and make it rotate as a usal rounded dial . cover it and let only a small 'window' to show you the current value that you want. this rounded dial seems and behave at the end like a fake linear one

you can see examples of this trick at 6-feeling dials (the bearing on the upper side of rudder dial) and at OLC,ACM,MaGui 's compass (the one that shows at the left bottom side of console)

I had though of this to but due to the positioning it needs with regard to the Periscope optics - a circular dial is out of the question.
The worst part is while the gave us linear dials (Fuel dial) they only move up/down - that are in the dials.cfg, they made linear dials that move left/right (compass bearing) hardcoded :damn:

Hitman
04-16-11, 06:51 AM
But why not simply make a clone copy of the existing bearing dial??

reaper7
04-16-11, 07:12 AM
But why not simply make a clone copy of the existing bearing dial??

Not sure how you clone an object, can it have the same ID ??

For example the compass in the Attack scope has an ID of: 0x26000004
Its graphic is bearing.dds in data/menu/gui (1024x16) but displays only a portion of that (88x16). So when you rotate the scope the graphic scrolls thru that 88x16 window.
There is no entry for the Compass in the dials.cfg so the ID 0x26000004 is being rotated by Hardcode.

If I make a copy of the compass it will get a new ID which will not be touched by the hardcode, so in turn will not rotate it.

Can one fool the game into having 2 same ID's (Clone as you mention) or will that cause CTD.
I haven't tried to have the same ID for both items as SH5's Menu Editor does not allow for 2 same ID's, but I could edit the attack_scope.ini file to make them the same if cloning works :06:


EDIT: Nope giving them the same ID didn't work - both the original and clone didn't rotate :(

reaper7
04-16-11, 08:13 AM
Ok this is what I'm trying to achieve, hopefully its possible.
I wish to get a panoramic type rotating of the Conning tower behind the periscope in the Attack Scope and a panoramic background of the control room at the Obs Scope.

Based on this http://www.kolumbus.fi/mika.ajomaa/Panorama_2_files/1.swf

http://www.u-boot-hahd.com/ubootwebsite/wp-content/gallery/2011/04/Hole.jpg

As you can see in the Pic above I need to create 2 Compass like dials both sides of the periscope.

It copies the same principle as the Compass Bearing Dial found in the Attack scope etc.
But without a left/right linear dial in the dial.cfg menu I don't know how to get it to rotate properly. (As I said I've got it to rotate up/down but not left/right when configured as a linear dial :wah:).

The concept is sound and will work if there is a method to rotate left/right like the hardcoded compass.

Hitman
04-16-11, 01:44 PM
Ha ha I was starting to suspect that due to your hints, and was already thinking myself "amazing idea from Reaper7" :yeah:

Anyway ...

I think you can actually clone the dial and give it a duplicated identity as long as you rename it, since we can clone the TDC dials with no problems

BUT

there is an alternative solution to what you want to do:D, which might work well meanwhile:

Simply, do your background and put along the top of it the bearing dial, all in one single graphic, then make all the scope screen background transparent at the sides AND at the bearing dial position of the scope. Both background and vernier will rotate together, though since you will only see the background (Lower 95% or so of the screen) and the vernier in the periscope, the effect will be achieved :up:

Magnific idea Reaper, I really love this alternative thinking, kudos to you :yeah::yeah:

reaper7
04-16-11, 03:37 PM
Ha ha I was starting to suspect that due to your hints, and was already thinking myself "amazing idea from Reaper7" :yeah:

Anyway ...

I think you can actually clone the dial and give it a duplicated identity as long as you rename it, since we can clone the TDC dials with no problems

BUT

there is an alternative solution to what you want to do:D, which might work well meanwhile:

Simply, do your background and put along the top of it the bearing dial, all in one single graphic, then make all the scope screen background transparent at the sides AND at the bearing dial position of the scope. Both background and vernier will rotate together, though since you will only see the background (Lower 95% or so of the screen) and the vernier in the periscope, the effect will be achieved :up:

Magnific idea Reaper, I really love this alternative thinking, kudos to you :yeah::yeah:

Cheers Mate, some nice suggestions :up:
Will give them a try and see if the effect can be achieved :D Had no luck with my first attempt at cloning all 3 of the dials (Original and 2 clones stopped moving).
But will try a few more variants of it, I have another Idea to do it, but would only work in SH5.
I could via script use two of the compass bearings from say the Obs and UZO to make the side conning tower dials and import them into each station as needed, that should work (But is a last resort - as I want to get this working for SH3 also).

Going to try your second suggestion now :up:




EDIT: Ok Using a compass is a no go. Didn't count on the side effect, As the compass ID is hardcoded to simulate glow in the dark graticules.
This has the effect of the Graphis I use for the Dial being transparent black during the day and visible with a green hue at night :)
Also the compass is hardcoded to be always on top so the layer displays above the scope and not behind it.

Back to the drawing board on this one :(

reaper7
04-17-11, 10:52 AM
No luck getting this to work :damn: What should have been easy has turned out near impossible.
Wouldn't mind but If i could have gotten it to rotate left/fight, I found a method to also move it up/down also. So if for example you entered the obs scope the background would have moved down as the scope was raised then rotated with the scope bearing and finally the background would have moved up as the scope was lowered.

So close but so far away :wah: