Sign in to follow this  
Guest JeffB

Would someone help me?

Recommended Posts

I'm creating a Python file and cannot get it to run.I modified a script created by Rich and placed it in the "C:Program FilesTerminal RealityFly! IImodulesscriptsglobal" directory. I've placed other scripts created by Rich, unmodified here as well.I'm patched to 2.40 and the pydll.dll is located in the "systemsmodulespc" directory.I cannot get it to work; I get no error messages when running Fly! II; I do not get any files with the .pyc extension (meaning they compiled)What am I overlooking?Again, I've also used standard, unmodified .py files created by Rich and no luck.Surely, someone has run into this...Jeff

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Try putting it in the modulepcscenario folder--I believe. Download my program, autoweather.zip , and read the instructions. You might get some pointers as to how to make your script work.tony

Share this post


Link to post
Share on other sites

Jeff,Just as a sanity check -- when Fly! is running, press Ctrl+T. This should bring up a task manager of all tasks running. Make sure the pydll is showing as an active task.Can you post the script here?Rich

Share this post


Link to post
Share on other sites

Thanks Rich and Tony,I'm out visiting relatives at the moment, but stole a chance to check this thread. I knew there was a way to check for running applications (Control T), but I couldn't remember the keystrokes.I'm sure I'm doing something wrong and I thought about all the possibilities on the way here (about a hour and a half). I finally thought about these possibilities:1. pydll.dll is not running...this is unlikely, but I'll check using the 'Control T' keystroke.2. It did not compile, but I believe I'd receive compilation errors and I did not.3. I've stored the programs in the wrong path. I've doubled checked this and mentioned the paths in my original thread. So, I don't think this is it.3. My python program is not correct. This seems to be the most likely case. I'm intercepting a keystroke (SHIFT C) as I want to replace the cockpit views. Anyway, I'm going to download your program Tony, and double check my program and whether the pydll.dll is running when I get home.I really appreciate your help Rich and Tony,Jeff

Share this post


Link to post
Share on other sites

Hi Rich,When I press 'Control T', I see many DLL's running and I do see the Python Embedded Interpreter 2.01.229 12/15/01 running (however, I do not see pydll.dll specifically). In the Script Module window, I do not see anything. I've got the skyswap.py and testsky.ini in the "C:Program FilesTerminal RealityFly! IImodulespcglobal" directory.I do not see skyswap.pyc anywhere. Where will this compile to? I'm guessing to the 'modulespcglobal' directory.Do I need to doing anything other than start Fly2.exe to compile?Thanks again,Jeff

Share this post


Link to post
Share on other sites

No. I vaguely remember that if a py file is in the global folder , it will not compile properly. I'll send you my py so that you can play with it. I remember I had to switch folders before I could create a pyc file.tony

Share this post


Link to post
Share on other sites

Thanks Tony,Here's my email address: jburke@autopkg.comTake care,Jeff

Share this post


Link to post
Share on other sites

I want to correct my posting above.I did put the testsky.ini in the 'system' directory, not the 'modulespcglobal' directory.But, I still get the same results.Take care,Jeff

Share this post


Link to post
Share on other sites

Hi Tony,Thank you for the files. I followed your instructions and all compiled and worked as expected. The compilation did not occur until I added the FSBuild adventure within Fly! II.After adding the adventure while running Fly! II, I pressed 'Control T' and noticed the Python Embedded Interpreter had 1 object running, which must be the adventure file.Based on this, I'm guessing I must do something within Fly! II to initiate the global compilation.Anyway, thanks for your help. Now to fly that adventure!Jeff

Share this post


Link to post
Share on other sites

Here's a test Python file. A couple of things:1. It will not compile if placed in the Global directory.2. It WILL compile if associated with an Adventure.3. DefineKeyEvent does not appear to work for me.Here's the source:NOTE: The indentations are there, but the posting does not show this.from fly import *NoticeToUser("Begin Script.", 5.0)DefineKey(ID('cjef'),"Jeff's Test",KB_KEY_F3,KB_MODIFIER_ALT)DefineKeyEvent(ID('cjef'), "Test")View = 0def Init(): View = 0 NoticeToUser("Inside Init.", 5.0)def Test(): NoticeToUser("Inside Test.", 5.0) if View == 0: View = 1 NoticeToUser("View Closed", 5.0) elif View == 1: View = 0 NoticeToUser("View Open", 5.0) else: NoticeToUser("View Else", 5.0)def Main(dt): global ViewCan anyone see what am I doing wrong?Best Regards,Jeff

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this