View Single Post
Old 03-12-10, 12:38 AM   #68
maerean_m
Captain
 
Join Date: Mar 2007
Location: Bucharest, Romania
Posts: 529
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith
I'm trying to implement AOB, Range, Speed, and Heading dials for the UZO and periscope and have ran into a ro*******. See here: http://www.subsim.com/radioroom/show...&postcount=352

What I can't get are the dials to accept commands. When I click on them or try to rotate the dial or hand it does nothing. I noticed that the application is controlling the dials though - heading moves when I move my periscope or uzo, range doesn't seem to be working quite right, speed registers nothing even when I lock onto a target. AOB works correctly as the application is controlling it.
Now what I want to do is to take manual control of these dials and input my solution into them. This is what I can't get to work. I've done this before in SH3/4, it was a snap, but I think the TAI or this new 'arcade' style solution is screwing it all up. I don't like the current way the game computes the solution for me. I want to have to track the ship and figure out it's speed, couse, AOB, etc. and manually input them into the TDC for a firing solution. Is this possible?

Here's a link to my files for this if you would be so inclined to have a look: http://www.filefront.com/15805903/Ol...DarkWraith.7z/


TheDarkWraith
I've looked in the archive and I can give you a big hint: python scripts only use tabs as indentation at the beginning of the line. Any spaces in that part make the script to behave unpredictably. That's why is very advisable to use the game's Script Manager. And most of all because of the word-auto-complete feature that is also aware of the game's SDK (exported classes, enums, properties, methods and events).
Copying python scripts from the forum is one cause for all the very bad spaces.

Now back to your mod:
The TDC page is still in the game (100% intact), you can see it the Menu Editor too. Just create an "empty" script (like the one in "Page obs periscope.py") with the same name of the ini file (Page TDC.py for Page TDC.ini) and you'll the have full access to all the menu items in the TDC page.
And from the Menu.PageActivated you hook on (+=) in every periscope's script you can bring that page on screen for the player.

Code:
#Page obs periscope.py
from menu import *
def InitializeScript():
	Menu.PageActivated += Menu_PageActivated
	Menu.PageDeactivated += Menu_PageDeactivated
def UnloadScript():
	Menu.PageActivated -= Menu_PageActivated
	Menu.PageDeactivated -= Menu_PageDeactivated
def Menu_PageActivated( page ):
	if page == Pageobsperiscope:
		from PageTDC import PageTDC
		PageTDC.Visible = True
def Menu_PageDeactivated( page ):
	if page == Pageobsperiscope:
		from PageTDC import PageTDC
		PageTDC.Visible = False
And you do the same for the attack periscope and the UZO.

Remember, copying python scripts from the forum is one cause for all the very bad spaces. Make sure you replace the spaces with tabs.


Also, you can also bring back the notebook:
__________________
Kilroy was here
maerean_m is offline   Reply With Quote