Jump to content
Sign in to follow this  
Guest andrewluck

Python and SendMessage function

Recommended Posts

Guest andrewluck

Just started looking at Python to see what I can do with it. Checking the Scripting manual from TRI, p64, which describes the SendMessage function refers to Appendix B which should contain 'A complete list of system and data tags'. Unfortunately, this appendix is missing. Is this information available from anywhere else?ThanksAndrew Luck18 miles SW EGSH

Share this post


Link to post
Share on other sites
Guest tonyc

Andrew, try looking at Yackster's source code. Although written for FLyscripts, it might have some lines that provide some clues. Also,I remember vaguely that the SDK has similar functions. It may also provide some cluses. I've been studying ways to use python also, and find it very exciting. tony

Share this post


Link to post
Share on other sites
Guest andrewluck

TonyThanks for the hints.I'm thinking that PMDG must have gathered a quantity of design notes and documentation from Rich in the process of building their projects. Maybe a note to them.Andrew Luck18 miles SW EGSH

Share this post


Link to post
Share on other sites
Guest tonyc

Lefteris is always around. I am sure he's got the answers.tony

Share this post


Link to post
Share on other sites

Thanks for that, Tony ;-).In fact, Chris Wallace had posted something to that effect (he was to publish a collection of all systems and datatags that he knew of).I am not sure if he did publish them or not - an email to him would actually be the best solution...Cheers,


Lefteris Kalamaras - Founder

www.flightsimlabs.com

 

sig_fsldeveloper.jpg

Share this post


Link to post
Share on other sites
Guest andrewluck

LefterisAhhh! as always, a man with the answers :-). Thanks for that.While I have your attention I'd like to thank you for the contribution that you've made to Fly! over the years. The 757 is awesome.Andrew Luck18 miles SW EGSH

Share this post


Link to post
Share on other sites
Guest andrewluck

TonyDecided to start by looking at the Taking Chances scripts, figure out how they're supposed to work and then try to find what's stopping them from working correctly.At least Python now appears to compile Adventure scripts OK, not sure about global ones yet. Today has been a steep learning curve looking mainly at Taking Chances 2. At the moment I'm trying to debug why the OK buttons on the dialog boxes don't function. The event handler procedure is being called OK but nothing happens when the button is depressed.Hopefully I'll have some time during the week to take this further.Andrew Luck18 miles SW EGSH

Share this post


Link to post
Share on other sites
Guest tonyc

Careful, Andrew. Verify that you can convert py files into pyc when you place them in the global folder. Some people had difficulty getting FLY2 to do it( bug?). I don't remember if it makes a difference, once you have a pyc file. Anyway, make sure you can work with global, assuming that you will not be using the "scenario"--this is where a pyc file is placed for the "adventure" mode.tony

Share this post


Link to post
Share on other sites
Guest andrewluck

TonyAt the moment I'm working with Adventure files and most of the time they convert to pyc files just fine. If they don't then you can just delete the pyc file and it'll recompile next time you enter the adventure. I haven't tried global scripts recently, haven't got a use for them at present.Taking Chances 2 is mostly working, I've got some problems with the UI. Also, half-way through all systems are supposed to be restored to working order, however, once I didn't get the electrical system back and another time didn't get the GPS. I'd be interested in your experiences with this one.Andrew Luck18 miles SW EGSH

Share this post


Link to post
Share on other sites

Andrew-you are certainly welcome! :-)Believe me, my contribution is peanuts compared to some other developers around here... I won't name names. They all know who they are...Even though I've switched to "the dark side", I'm still around for those who need my assistance...


Lefteris Kalamaras - Founder

www.flightsimlabs.com

 

sig_fsldeveloper.jpg

Share this post


Link to post
Share on other sites
Guest tonyc

Andrew,Unfortunately, I did not work with taking chances at all, so I can't help you. when I decided to write Autoweather, I simply spent some time studying Python and the rest became easy. Perhaps, you want to state what you want to do, and some of us, especially the Python community can help you. Keep in mind that the Python community is very active and responds immediately to programming questions. I know I had to do it when I could not figure out some database editing issue. They quickly hit me with dozens of wonderful code samples that helped me complete the program quickly.tony

Share this post


Link to post
Share on other sites
Guest andrewluck

TonyIs the code for AutoWeather available? I'd like to take a look.At the moment, the buttons on the UI don't work. Some work last night appears to indicate that the window ID fed to the event handler doesn't match that produced by ID('introwindow') so it's a Fly! interface problem rather than a Python one.Can you run the Taking Chances 2 adventure and let me know what it does on your system?Andrew Luck18 miles SW EGSH

Share this post


Link to post
Share on other sites
Guest tonyc

Andrew, I've just uploaded Autoweather 1.02, which has the source code as well. Any questions, let me know. I'll try Taking Chances2 and let you know.tony

Share this post


Link to post
Share on other sites
Guest andrewluck

Work continues on the 3 Taking Chances scripts as and when I have the time.I've solved the problem with the UI buttons. The EventHandler function is passed the window ID that's contained within the window template file, not the ID that the window was created with via he OpenWindow function. Also, these scripts all use window id's that contain more than 4 letters. Understanding this has got the initial window OK button working in all three scripts.The third script has a timer window with the code commented out. Enabling this code causes Fly! to crash when loading the scenario. The problem here appears to be that you can't open two UI windows at once. Commenting out the other window means that you can use the timer window. I tried moving the timer window code to the event handler (after the first window closes) but this causes Fly! to lock solid when you try and close the first window. I'm still looking for a solution to this.Many people have commented that the first script doesn't do a lot. This is because the code to turn off the main fuel shutoff valve doesn't work. I've still to find the solution to this although I can kill the engine by turning the ignition switch off.This is an interesting learning experience as I haven't previously used Python. It is pretty intuitive. Any comments / solutions are welcome.Andrew Luck18 miles SW EGSH

Share this post


Link to post
Share on other sites
Guest tonyc

Does this mean that you got it to work in the global directory?tony

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...