This are the Support Forums for FSUIPC and related products.
These forums replace the old support forums which have been running for 20+ years. The old forums contain a wealth of information on all FSUIPC products, but are now no longer available.
Please note that you will need to Register and Login to post for support, and also to download attachments. You can view these forums without registering.
Support is also available via Discord. Please use the following invite link to join the FSUIPC Discord server:
https://discord.gg/zjwUTrxmmE
Set flag to 1: Lua
Do you have a problem? Why post files with no explanation?
Hello,
I want to assign the value of 1 (or ON) to my flag at the start of fscuipc. My flag is associated with the joy N°4 (throttle quadrant) ans button 2 soit 1026 (256*4+2). I use a Lua file with ipc.writeFlag(flag_id, 1), but it does not work, I have also create the [auto] section with my script. What is the corret command ?
I use flag_id=1026 but I am not sure. I asked already for this few years in the old forum …
Posted by: @guit32I use a Lua file with ipc.writeFlag(flag_id, 1),
There is no such function. This is your lua script:
Script FSUIPC pour mettre un flag à 1 au démarrage -- Numéro du flag FSUIPC local flag_id = 1026 -- Activer le flag ipc.setflag(flag_id)
Flag 1026 does not exist - from the lua documentation for ipc.setFlag:
Sets the specified local Flag, 0-255. These flags are the same ones that can be changed by the FSUIPC assigned controls "LuaSet", "LuaClear" and "Lua Toggle".
Test flags using the ipc.testflag function.
Posted by: @guit32My flag is associated with the joy N°4 (throttle quadrant) ans button 2 soit 1026 (256*4+2)
Button flags are different from lua local flags. You cannot set button flags manually - they only change when the associated button is pressed or released. You can only check the state of the button flag, to see if a physical button is on or off. It doesn't make sense being able to set this flag to a different state than the button is in. You can only set the flag/button state for virtual buttons.
Posted by: @guit32I asked already for this few years in the old forum …
Didn't I respond there?
What are you actually trying to achieve?
John
I have 2 rotary encoder for 3 differents function: VHF, ADF and sqawk. I use 3 physical button on my throttle quadrant to choose the functionnality. At the start of a flight I want that the défault functionnality to be for the transponder.
I change my pc but I succeed to make it work before with a Lua file (I do not remenber how I did).
The physical button I use to activate the sqawk with my rotary encoder is Joy n°4 (Throttle Quadrant) and button n°2: I want the flag associated with this button to be activated at the beginning of my flight.
