Jump to content
Sign in to follow this  
Fall_guy

f.a.o TonyC

Recommended Posts

Hi Tony,Do you happen to know....... if I can access a .pyc file. I can access a .py file no problem, but I'm not sure about a .pyc.I'm suspecting that the .pyc may be coded and you can only open .py files.Thank again for your helpJohn

Share this post


Link to post
Share on other sites
Guest HeliFLYer

Hi John,pyc is the compiled version of a py file.Everytime FLY!2 is started Python looks into the folder modulesscriptsglobals (where you have to put your *.py scripts in) and compiles the py-script if a) no pyc exists :( a change in the py is detected.Most of the developers give only the pyc with their work (corduan, lfhu ..) because they want to hide their know-how.But if you want to find some samples, have a look into - fly2sdksamplesscriptsskyswap.py (Rich Harvey)- fly2howtofly2scriptingdocumentation.pdf (275 pages!), I learned a lot of it- fly2adventurestakingchances.py- ...............takingchances2.py- ...............takingchances3.py- there is also another script "lesson1.py", you might do a search for it in the FLY! folderThese scripts are very important samples if you really want to code with Python and FLY!. You should try to understand them.I would advice you to start with very simple tasks, here one example I made for me. As FLY! does not simulate the very dangerous settling with power (Vortex state), I made a simple *.py script for me:-------------------------------------------------------------------from fly import *sfx = 0 def CheckVortex(): global sfx vrate = UserAltitudeRate() if vrate < -500.0: sfx = PlaySound("VortexWarn.WAV", TRUE) NoticeToUser("Vortex Ring State Possible",3.0) def Main(dt): global sfx if IsSimulating() == 1: if sfx <> 0: if IsSoundValid(sfx) == 0: sfx = 0 if sfx == 0: if AirspeedCheck(1, 15, 15) == 1: CheckVortex()-------------------------------------------------------------------If you want to try it, you must have any short soundfile in the sound folder called "VortexWarn.Wav" AND you must be slower than 15 knots and have a descendrate of more than 500 ft/min.Hope that helped a littleRegardsGeorg HeliFLYer EDDW

Share this post


Link to post
Share on other sites

Hi Georg,Thanks for taking the time to post that, it will be very helpful and thats a neat little script you've written.I've just started to read fly2scriptingdocumentation.pdf so hopefully I'll understand a little bit more shortly.Thanks again for your time and helpregards John

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...