Scripts LUA utiles

Frédéric, je dois être un peu fatigué après mon footing, mais je ne comprends pas pourquoi ton copain s'étonne qu'une variable/table qu'il demande comme "local", reste local?...:p
Ou alors, j'ai loupé quelque chose???...:poop:
S'il veut qu'elle soit globale, il lui suffit de la définir comme telle en tête de son script. Celle-ci restera vivante durant toute la durée du Thread.
Sinon, elle va restée vivante uniquement durant la durée de vie de la "function". C'est la définition même de la "Portée" d"une variable...
C'est quelque chose qui est constant quelque soit les langages.

J'ai juste lu ce dernier Thread, j'ai peut être loupé un élément de compréhension???...:p
 
Dernière édition:
SimBrief Simple Operational Flight Plan v0.3b4

0.3b4 2021-11-29
-2021-11-29 - In the Flight Log AFOB insert button "I" would insert the actual fuel on board in KG, but now fixed it to show lbs. if your SimBrief units are set to LBS.

0.3b3 2021-11-27
-2021-11-27 - The calculation for the ABRN from the last fix if you missed all way-point without recording the AFOB and the ABRN it will not loop back correctly and get the right numbers, it will reach till the 2nd way-point after the Airport only, so I have fixed it so it will check it one by one reaching till the first point which is the airport.

To upgrade just copy SIMBRIEF_SIMPLE_OFP.lua to FlyWithLua Scripts directory
 
ACA-LightPanel.lua 1.0.0
23 juille 2022

FlyWithLua script to interface a light panel to the ZIBO B738.

The switches and rotaries of the hardware panel are connected to a LeoBodnar card (XP sees them as joy buttons).

It uses FLW create_switch function when possible otherwise DataRefs or commands.
The synchronization of the hardware panel to the ZIBO is performed once per second to avoid impacting performances.

Handles the engine starter buttons

1658578447421.png
 
Script double commandes xp11 - xp12

Un petit script pratique , quand on a un cockpit à 2 sièges , pour contrôler un des 2 yokes ou sidesticks :


1667686774816.jpeg
 
Dernière édition:
Switch Airport Lights

J'ai modifié ce script pour XP12 afin de pouvoir allumer les pistes à une distance d'environ 18/20 Mn

airport_light_level = 50 au lieu de 1 pour XP11.

Vous pouvez modifier le script à votre convenance .

code partiel :
Lua:
function Lights_On()
    override_airport_lites = 1
    airport_lights_on = 1
    airport_light_level = 50
end -- FUNCTION

Merci @betampona pour m'avoir indiqué cette valeur , j'avais mis au départ 25 mais ça donnait environ 9Mn ce qui insuffisant .

Reste à trouver comment modifier le PAPI qui diminue de moitié quand on allume la piste .
Le script n'est plus actif en fonction de l'angle du soleil (crépuscule - nuit - aube)
 

Fichiers joints

  • Switch_Airport_Lights_1.0.lua.zip
    1.6 KB · Affichages: 17
Dernière édition:
Un tout petit script Mute pour couper le son du simu avec un bouton ou un raccourci clavier . (XP11 -XP12)

Si vous avez X-ATC Chatter , le script ne le coupera pas , il faudra créer un raccouci clavier différend ou un bouton qui pourra alors être le même que pour le script .
 

Fichiers joints

  • MuteSound.lua.zip
    1.2 KB · Affichages: 14
Fred
Airports lights.
Penses tu que ça pourrait marcher sur P3D4?
(Ouais, je sais pas de commentaire) :LOL:
 
Fred
Airports lights.
Penses tu que ça pourrait marcher sur P3D4?
(Ouais, je sais pas de commentaire) :LOL:

C'est le code complet , il faudra juste changer les datarefs XP par les variables P3D ...

Lua:
dataref("airport_lights_on", "sim/graphics/scenery/airport_lights_on", "writable")
dataref("override_airport_lites", "sim/operation/override/override_airport_lites", "writable")
dataref("airport_light_level",  "sim/graphics/scenery/airport_light_level", "writable")
dataref("vasi_papi_night_dim",  "sim/private/controls/lights/vasi_papi_night_dim", "writable") --0.1to10 dflt 0.35

function Lights_On()
    override_airport_lites = 1
    airport_lights_on = 1
    airport_light_level = 5  --à ajuster
    vasi_papi_night_dim = 1 --0.1 to 10 dflt 0.35 best 1
end
--do_every_frame("Lights_On()")
do_often("Lights_On()")
 
@Jackpilot , j'ai un peu regardé les variables P3D , ça n'a pas l'air aussi simple ...

Pour améliorer l'éclairage des pistes de manière globale , tu peux essayer REX Global Texture, Effects and Sound Add-On.
24,95us$ ... Il fait beaucoup plus de choses mais c'est l'utilisateur qui choisit ...
Compatible avec Prepar3D v. 1, 2, 3 & 4+, FSX:Steam etFSX

1679306020984.png
 
C'est le code complet , il faudra juste changer les datarefs XP par les variables P3D ...

Lua:
dataref("airport_lights_on", "sim/graphics/scenery/airport_lights_on", "writable")
dataref("override_airport_lites", "sim/operation/override/override_airport_lites", "writable")
dataref("airport_light_level",  "sim/graphics/scenery/airport_light_level", "writable")
dataref("vasi_papi_night_dim",  "sim/private/controls/lights/vasi_papi_night_dim", "writable") --0.1to10 dflt 0.35

function Lights_On()
    override_airport_lites = 1
    airport_lights_on = 1
    airport_light_level = 5  --à ajuster
    vasi_papi_night_dim = 1 --0.1 to 10 dflt 0.35 best 1
end
--do_every_frame("Lights_On()")
do_often("Lights_On()")
Ca c'est du code Lua spécifique à FlywithLua , un plugin qui ne fonctionne qu'avec Xplane à ma connaissance
Il ne fonctionnera jamais sur P3D, même en remplaçant les datarefs par des variables P3D

do_often() par exemple est une fonction spécifique à FlywithLua

Et pour répondre @Jackpilot si P3D est comme FSX dans ce domaine, l'éclairage se règle au niveau du fichier de config, je ne pense pas qu'on puisse le modifier en temps réel comme avec XP
 
Dernière édition:

e: Depending on airport, landing lights illuminate runway or not!? Why ???



Post by Redlight » Sat Dec 18, 2021 4:42 pm


Try these tweaks to the Prepar3d config file in user folder, one of them (think it's the runway lights thing?) gives me good landing light illumination on the runway.

These tweaks also have reduced blurries to almost zero for me too.

[GRAPHICS]
DAY_THRESHOLD=48000
NIGHT_THRESHOLD=8000

[DISPLAY]
TextureMaxLoad=36
TEXTURE_BANDWIDTH_MULT=180
RUNWAY_LIGHTS_SURFACE_SCALAR=0.30
RUNWAY_LIGHTS_VASI_SCALAR=0.50
RUNWAY_LIGHTS_APPROACH_SCALAR=0.15
RUNWAY_LIGHTS_STROBE_SCALAR=0.30

[PANELS]
MAX_VC_TEXTURE_RESOLUTION=1024

[TERRAIN]
TEXTURE_SIZE_EXP=8
TERRAIN_MAX_AUTOGEN_TREES_PER_CELL=6000
 
Merci aux services techniques, je regarde tout ça !!!

Je n'ai pas de problème avec les phares d'aterrisage ou de circulation sur taxi, par contre les feux de piste sont parfois un peu flous meme si le "bloom" est à zero.
 
Merci aux services techniques, je regarde tout ça !!!

Je n'ai pas de problème avec les phares d'aterrisage ou de circulation sur taxi, par contre les feux de piste sont parfois un peu flous meme si le "bloom" est à zero.
Dans ce cas, ce sont bien ces lignes-ci à ajouter dans P3D.CFG section [DISPLAY]

[DISPLAY]
RUNWAY_LIGHTS_SURFACE_SCALAR=1.5 //Runway Lights
RUNWAY_LIGHTS_VASI_SCALAR=1.3 // VASI Lights
RUNWAY_LIGHTS_APPROACH_SCALAR=1.5 // Approach Bars
RUNWAY_LIGHTS_STROBE_SCALAR=1.5 // Strobes

ou
RUNWAY_LIGHTS_SURFACE_SCALAR=0.30
RUNWAY_LIGHTS_VASI_SCALAR=0.50
RUNWAY_LIGHTS_APPROACH_SCALAR=0.15
RUNWAY_LIGHTS_STROBE_SCALAR=0.30
il doit falloir surement jouer avec les paramètres jusqu'à trouver le bon. Redémarrage de P3D nécessaire à chaque fois
 
Yep, pas tout de suite, suis temporairement sur un autre projet :sneaky:
 
Retour
Haut