View Single Post
Old 03-21-10, 06:33 PM   #147
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by reaper7 View Post
Ok, I have been trying to create a new Page into the editor with not much luck, and need some advice.

I have created a Copy basically of the TDC page and Called it Page TDC2 in the editor as a test.
This creates the relevant ini page in the Pages Folder (Page TDC2.ini). Ok.

I then Create a new script called Page TDC2.py
And edit it like the following : (My tabs are not showing up in the scripts when I paste them into forum)

def InitializeScript():
pass
def StartGame():
pass
def EndGame():
pass
def UnloadScript():
pass

Now as I want the Periscope to bring this page up in the game I edit the Page attack periscope.py file like this:

#Page attack periscope.py
from menu import *
def InitializeScript():
Menu.PageActivated += Menu_PageActivated
Menu.PageDeactivated += Menu_PageDeactivated
def StartGame():
pass
def Menu_PageActivated( page ):
if page == Pageattackperiscope:
from PageTDC2 import PageTDC2
PageTDC2.Visible = True
def Menu_PageDeactivated( page ):
if page == Pageattackperiscope:
from PageTDC2 import PageTDC2
PageTDC2.Visible = False
def UnloadScript():
Menu.PageActivated -= Menu_PageActivated
Menu.PageDeactivated -= Menu_PageDeactivated
def EndGame():
pass

These are placed into the correct folders and the game is launched.
Game loads ok, but when I activate the periscope the game freezes with the following script error.



Can anyone tell me what I'm doing wrong. I've no scripting experience but this appears to be the method as shown earlier in this thread.
The no module named TDC2 is baffling me, how do you create a module?
I see what you're trying to do and it won't work. The C++ code only allows dials on pages that already had dials on them. Sure you can add a dial to Page Default Hud but when you try to tie it to the the dial in the file dials.cfg it won't work. The game will not update the dial. It will be just a static bitmap. If you want to do TDC stuff then you have to keep the dials on PageTDC or use another page that already has dials on them.

Last edited by TheDarkWraith; 03-21-10 at 07:07 PM.
TheDarkWraith is offline   Reply With Quote