lua stopped x plane 11 что это

Discussion: Lua stopped

Outils de la discussion
Rechercher dans la discussion
Affichage

Lua stopped

J’ai trouvй. C’йtait dans » XPRealistic» / XPRealistic.lua» qui йtait mal placй.

Je rencontre aussi maintenant Lua stopped en haut а droite en rouge.
Dans le fichier log j’ai ca :

FlyWithLua Error: The DataRef «sim/private/controls/water/fft_amp1» does not exist.
FlyWithLua Error: The DataRef «sim/private/controls/water/fft_amp2» does not exist.
FlyWithLua Error: The DataRef «sim/private/controls/water/fft_amp3» does not exist.
FlyWithLua Error: The DataRef «sim/private/controls/water/fft_amp4» does not exist.
FlyWithLua Error: The DataRef «sim/private/controls/water/fft_scale1» does not exist.
FlyWithLua Error: The DataRef «sim/private/controls/water/fft_scale2» does not exist.
FlyWithLua Error: The DataRef «sim/private/controls/water/fft_scale3» does not exist.
FlyWithLua Error: The DataRef «sim/private/controls/water/fft_scale4» does not exist.
FlyWithLua Debug Info: Sorry, no debug Info on stack.
FlyWithLua Debug Info From Plugin: SystemPath «C:\X-Plane 11/»
FlyWithLua Debug Info: Debug file written to «C:\X-Plane 11/FlyWithLua_Debug.txt»
FlyWithLua Debug Info: Plugin Main directory = C:\X-Plane 11/Resources/plugins/FlyWithLua
FlyWithLua Debug Info: Script directory = C:\X-Plane 11/Resources/plugins/FlyWithLua/Scripts/
FlyWithLua Debug Info: Internals directory = C:\X-Plane 11/Resources/plugins/FlyWithLua/Internals/
FlyWithLua Debug Info: Modules directory = C:\X-Plane 11/Resources/plugins/FlyWithLua/Modules/
FlyWithLua Debug Info: Debug file written to » >/FlyWithLua_Debug.txt».

Quelqu’un saurait m’expliquer mon problиme car je ne comprends rien moi.

Pour info je suis restй sur la version 11.41 xplane pour le moment.
Merci d’avance

Dans les sripts de FlyWithLua tu dois avoir un script qui ne fonctionne pas
Apparemment c’est un script qui doit concerner l’eau
Il suffit de le supprimer dans le dossier «script» et tu n’auras plus le message
Te resteras а en trouver un autre qui fonctionne par la suite

Fais de ta vie un rкve, et d’un rкve, une rйalitй. ( A de Saint Exupйry )

Источник

Lua stopped x plane 11 что это

% Some simple explanations for beginners % Carsten Lynker % December 2013

First steps programming FlyWithLua

This is more a cooking book than a real in-deep tutorial. It will give some fresh ideas to beginners, helping to find the golden thread to run successful through a Lua scripting adventure. So don’t forget to study the manual, especially as a reference to all the functions used in this book.

When are my scripts running?

Start X-Plane and start a text editor (like Notepad++ or VIM). Then write the file «hello world.lua» into the «Scripts» directory. Fill the file with these Lua code:

You can see, your little script does its work once during its run.

Setup start parameters

You can use this behavior to setup some start conditions. This can be done, as FlyWithLua automatically runs the scripts when you change your plane or location. So if you want to always start with cold&dark setting in X-Plane, but have the orange beacon on by default, write a script like this:

The most exiting thing programming with FlyWithLua is, that you can read and write DataRefs. These are X-Plane’s internal variables, representing much more than the commands can reach. Take a look at this web page:

So let’s try the same procedure as before. Change your little script to this:

And again, all your action in X-Plane starts with beacon lights on (to be correct, it will start the beacon when you switch the battery on). You must be careful when using a DataRef. Not all of them can be set by a plugin. If they are writable or not can be found in the fourth column of the official DataRef listing.

Event driven programming

You can’t only do things once when the script loads. There are Lua functions, that allows to react on simulator events. For example when the mouse scroll wheel is moved. Write a new script «no more zooming.lua» and fill it with this code:

Hey, this disables the zoom on the mouse wheel. In fact this little piece of software, a tiny one-liner, does nothing on a mouse wheel event, but resumes the event. So the SDK’s event handler stops action and scroll wheel info never gets to X-Plane.

Doing some action on wheel movements

As killing the zoom only is a little bit boring, we will add some action. The mouse wheel movement is represented by the variable MOUSE_WHEEL_CLICKS. We can use this info to move the trim wheel with the mouse wheel. Use this code:

This is a little bit more complex. We first define a DataRef connection to a variable, that allows writable access. Then we define a function, to not have too many code to write inside the do_on_mouse_wheel() function. This is not really a problem, it’s more a sort of ugly code.

We want to see the movement of the trim when we use the mouse wheel. To show something with Lua, it must be done with the do_every_draw() function. So we add the code above:

This will show an info onto the screen. We use OpenGL functions, that are implemented into FlyWithLua’s Lua dialect. But one thing is still stupid, the info is shown all the time. We want it to disappear after 5 seconds. Let’s modify the code again:

Now we use the Lua function os.clock() to get the time in seconds the simulator is running. We add five to this value, to get the time in five seconds, and store this value in a local variable. The variable must be set (and defined as local) before the function to display it is defined and connected to the simulator’s drawing loop. Else the first run in the drawing loop crashes the script as the variable is unknown.

As we didn’t know if an other script set’s the OpenGL graphic state wrong for our output, we set it to the default value with the XPLMSetGraphicsState() function. If not, it can end in some strange behavior, if am other script disables alpha for example.

Understanding custom commands

A very important feature of FlyWithLua are custom commands. Commands are procedures offered by X-Plane or additional elements like a plane you are using.

Every command has a unique name and a (not forced unique) description. The description is shown in the dark info area beneeth the command’s name.

Creating a custom command

This is working, but it still has a lot of disadvantage in it.

We will examine the code first. In line no. 1 the script loads the module radio, if it isn’t present (otherwise it will do nothing). This will define some DataRef variables like OBS1 we need here.

Much more important are line 3 to 7, the create_command() function provided by FlyWithLua. This function needs five arguments. All arguments need to be strings (Text surrounded by quotes).

The second argument is the description of the command. Make sure to provide a short and precise description, as the user will only have these descrition (and the name) to guess what the command is doing.

The third argument is a string containing Lua code. This code is executed once, when the command starts. You can see that the example command will increase the value by one every time you press the assigned button.

The fourth and fifth argument are strings containing Lua code, that is executed while the button (or key) is hold down (fourth argument), or when the command ends (button or key is released). In this first example both are empty. You must give empty strings to the function, if you want to do nothing, or you will get an error message about missing arguments.

The last two arguments are more important as you might guess. Let’s play around with the example in deep. If you press the assigned button again and again, you will get higher values than 360°. This is not what you want. If you reach 360°, it should swap to 0° to make a clean run around the OBS instrument. Values above 360° are not usefull.

So we can use the last argument, to clean up when the command stops.

The % does a modulo division and gives back the rest of the division, so 360° will result in 0° and the next turn around the instrument can start.

Is this super clever? No!

You loose the ability to make small steps, as you can’t press as short as only one frame. You will have to implement a better solution.

Wow, what’s that? First we define two local variables. This makes a script more fast and less conflicty to other scripts. We use 1 as a random value, as a value is necassary, but not known at this moment.

Then we use the Lua function os.clock() (yes, it’s pure Lua, not FlyWithLua). The function os.clock() gives back the time in seconds the Lua engine is running.

When the command starts, we will store the actual value and the time into the local variables. Please note the special character backslash with n inside the string. It will make a new line character to seperate the two lines of code. If you let it away, FlyWithLua will promt an error message and stop working.

Then, with every frame the button or key is hold down, we will increase the value of OBS by the time in seconds multiplied by 5. You can change the value of 5 to make it fit your own needs.

Five per second is too slow? It can get even better:

Now we have an if statement to check if two seconds are passed. If so, we will increase with a value multiplier of 10 (or whatever you want). The two seconds are added when the command starts (the third argument). This helps to reduce the math needed.

If you have an axis that delivers jumping values, it may disturb your X-Plane experience. So it’s time to smooth the input. Let’s see how.

Looking for the real values

First we want to see the real values coming from the hardware. Say we have an axis that is jumping. The axis no. is 12 (see X-Plane’s menu for joystick configuration to get the right axis no.).

We will use this code to display the real values. A visible string position is more convenient that looking at naked values in DRE.

In the code we position the text to an x-value of 0 up to 1500, as the values delivered by X-Plane are float values from 0.0 to 1.0. You may change the value of 1500 depending on your X-Plane window’s width.

Simple Moving Avarage

To smooth the signals coming from the axis, we use a simple moving avarage calculation. The following code should be added:

On the screen we see a more stable text «smoothed value», as it’s position is calculated as the mean of the last 10 values. If you use one pysics calc run on one graphical run, then this is about half a secound when FPS is 20. If you choose more physic calculations or use a faster hardware (CPU/GPU), then the time period for the mean calculation may be shorter.

Creating a helper module

As the method above isn’t very smart code, we now create a module to be used by a script. The module file must start with this line:

As Lua has no classes we can create instances from, we need a function that creates functions by executing strings. Call it some kind of pure-mans-OOP.

You find the code as an example delivered with FlyWithLua.

The script itself shrinks to this:

The modules’s function create_SMA() will create the dataref variable real_axis_ plus the number of the axis given by the first argument. It will also create the function to calculate the smoothed value and calls it every frame loop. So everything you have to do after this line:

Is to use the value of the new created variable axis_ plus the number, as shown in the last line of the example script.

Источник

Lua stopped x plane 11 что это

FlyWithLua for X-Plane 11

lua stopped x plane 11 что это

This is the official source code repository for the FlyWithLua plugin project.

FlyWithLua offers Lua scripting to X-Plane since X-Plane 9.

Discussions to general topics should be opened on the official forum at x-plane.org.

You will find a binary version ready to use in X-Plane 9 or 10 in the download area of x-plane.org.

The new versions are X-Plane 11 only and the binary is also in the download area of x-plane.org.

If you want to grab a most nightly binary, just download FlyWithLua_plugin.zip from the most recent GitHub Actions build and unpack it into your X-Plane’s plugin folder.

Copyright (c) 2012 Carsten Lynker

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the «Software»), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Building FlyWithLua from source

Install required software using Chocolatey using admin command prompt:

You can also install the same programs manually if you prefer.

Checkout and configure the project:

Build the project and copy the plugin DLL into the appropriate directory:

Install required software:

Checkout and configure the project:

Build the project and copy the plugin DLL into the appropriate directory:

Install XCode, Git, CMake (Homebrew can be convenient for this).

Checkout and configure the project:

Build the project and copy the plugin DLL into the appropriate directory:

Note: this is documented just in case, but generally is not recommended. Using native builds and/or GitHub Actions workflow is more convenient and less prone to errors and bugs.

Install cross-compiling toolchains:

At that point you should be able to build FlwWithLua.

At that point you should be able to build FlyWithLua.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *