![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
![]() |
#2 | |
Seasoned Skipper
![]() Join Date: Aug 2010
Location: 49°44´N 129°40´E
Posts: 665
Downloads: 124
Uploads: 7
|
![]() Quote:
![]()
__________________
Speed squadron is the speed of the slowest ship ... but only so long as on the trail of the squadron did not sit submarines ... ![]() |
|
![]() |
![]() |
![]() |
#3 |
A-ganger
![]() Join Date: Oct 2010
Posts: 73
Downloads: 55
Uploads: 0
|
![]()
This is great!!
![]() |
![]() |
![]() |
![]() |
#4 |
Seasoned Skipper
![]() Join Date: Mar 2005
Location: UK
Posts: 683
Downloads: 104
Uploads: 1
|
![]()
Does anyone have the original files still?
Im trying to make my own TDC and running into syntax problems with the .py scripts. Im using notepad++ and checking and double checking but alas, I keep having problems with the script to call a basic TDC page on the attack periscope.... Any help would be appreciated. I've removed every space, checked tabs and it all looks fine in notepad++. |
![]() |
![]() |
![]() |
#5 |
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
![]()
Try dropping a message in Reaper7's PM box
![]() |
![]() |
![]() |
![]() |
#6 |
Seasoned Skipper
![]() Join Date: Mar 2005
Location: UK
Posts: 683
Downloads: 104
Uploads: 1
|
![]()
Tracked down in debugger to line15 column 1, looked at some other scripts and figured it out.
# Globals ShowTDC = True #Page attack periscope.py from menu import * def InitializeScript(): [TAB] Menu.PageActivated += Menu_PageActivated [TAB] Menu.PageDeactivated += Menu_PageDeactivated [TAB] Menu_PageActivated( Pageattackperiscope ) def StartGame(): [TAB] pass def Menu_PageActivated( page ): [TAB] if page == Pageattackperiscope: [TAB] [TAB] global ShowTDC [TAB] if ShowTDC: [TAB] [TAB] from PageTDC import PageTDC [TAB] [TAB] PageTDC.Visible = True def Menu_PageDeactivated( page ): [TAB] if page == Pageattackperiscope: [TAB] [TAB] global ShowTDC [TAB] if ShowTDC: [TAB] [TAB] from PageTDC import PageTDC [TAB] [TAB] PageTDC.Visible = False def EndGame(): [TAB] pass def UnloadScript(): [TAB] Menu.PageActivated -= Menu_PageActivated [TAB] Menu.PageDeactivated -= Menu_PageDeactivated should globals be double "tabbed"? it works now but then the TDC stays when I exit station the indentations listed in the tutorial seem wrong to me... Last edited by Jace11; 05-05-13 at 05:36 PM. |
![]() |
![]() |
![]() |
#7 |
Black Magic
![]() |
![]()
the python file layout controls flow of execution. If something is tabbed more or tabbed less than it should be the python execution engine will throw an error. Your example above would throw an error. If the global ___ is to be part of the function block then it needs to be tabbed the same as the function block.
If you've done any coding in C++ or C# think of the tabs as {}s. Think of the : as function header C#: private void myfunction(int a, float b) { a = Convert.ToInt32(b); } In python: def myfunction(a, b): [TAB]a = Convert.ToInt32(b) Last edited by TheDarkWraith; 05-06-13 at 03:03 PM. |
![]() |
![]() |
![]() |
Tags |
dials, editor, scripting, tutorial |
|
|