![]() |
Try dropping a message in Reaper7's PM box :03:
|
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... |
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) |
Quote:
Thanks. |
check your \documents\sh5\data\cfg\main.cfg file. There a header called Modding. There's an entry called MenuEditor. This needs to be set to true.
|
Got it thanks. Wow, you guys have it easy over here with menu edits. I was hoping it was an external .exe file that I could use in sh3 as well.
|
Hi!
I`m trying to find as much information on modding SH as possible. This thread is very interresting to me. But the links to the .pdf and archive seems to be broken ( I would be very grateful if you could share these files. P.S. Sorry for my English :oops: |
All times are GMT -5. The time now is 12:47 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.