Search found 304 matches
- Wed Nov 23, 2022 5:59 pm
- Forum: Lua and API Scripting Help
- Topic: Integer number from Lua calculation needed
- Replies: 36
- Views: 3209
Re: Integer number from Lua calculation needed
Hi @Keith and all, no need to apologize for anything. Still, that // operator does not work for me. In my "instrument" attached option 1 and 3 do work, but number 2 not. brightness_lines = 0 gColorPrint = "blue" function DrawCanvas() _rect(10, 10 ,200, 200) _fill(gColorPrint) end...
- Tue Nov 22, 2022 7:51 pm
- Forum: Lua and API Scripting Help
- Topic: Integer number from Lua calculation needed
- Replies: 36
- Views: 3209
Re: Integer number from Lua calculation needed
Running this simple code produces the same error as the OP. bad argument #2 to 'format' (number has no integer representation)" local input = 0.5 local output = string.format("%x", input * 255) -- "7F" print(output) However running this code does not produce an error local ...
- Tue Nov 22, 2022 11:33 am
- Forum: Lua and API Scripting Help
- Topic: Integer number from Lua calculation needed
- Replies: 36
- Views: 3209
Re: Integer number from Lua calculation needed
Hi again, thank you all for your expertise. In my case string.format() did not accept the return value of math.floor() as an integer. I used string.format() with %x formatting to produce a hexadecimal number. I have changed my code now to: gColorPrint = string.format("#%02X%02X%02XFF", toi...
- Mon Nov 21, 2022 7:18 pm
- Forum: Lua and API Scripting Help
- Topic: Integer number from Lua calculation needed
- Replies: 36
- Views: 3209
Integer number from Lua calculation needed
Hi, in an instrument script I want to control the brightness of a text color. For that I have the variable gColorPrint. From time to time I see this error in the logfile: "error in dataref callback: logic.lua:266: bad argument #2 to 'format' (number has no integer representation)" It happe...
- Thu Nov 17, 2022 1:22 pm
- Forum: Under development and finished work
- Topic: Dial events in the log file - rotary knob
- Replies: 3
- Views: 575
Re: Dial events in the log file - rotary knob
Joe,
thank you. I see now, I did not search the forum before posting. So I will wait for the next AM release.
Detlef
thank you. I see now, I did not search the forum before posting. So I will wait for the next AM release.
Detlef
- Thu Nov 17, 2022 12:11 pm
- Forum: Under development and finished work
- Topic: Dial events in the log file - rotary knob
- Replies: 3
- Views: 575
Dial events in the log file - rotary knob
Hi all, I am using a hardware rotary knob using this function in the Lua instrument code: hw_dial_add(HwPanelPin(INDEX_DIAL_SPD_A), HwPanelPin(INDEX_DIAL_SPD_B), "TYPE_1_DETENT_PER_PULSE", 2, cbHwDialSpeed) I see these entries in the logfile: 022-11-17 12:59:08.024 INFO CORCOR - Dial event...
- Fri Nov 11, 2022 10:21 am
- Forum: Under development and finished work
- Topic: Instrument submission guidelines question
- Replies: 17
- Views: 1606
Re: Instrument submission guidelines question
Okay so through their SDK. @Ralph, yes, the Airmanager might use the PMDG SDK and then provide access to the aircrafts state via the normal fs2020_variable_subscribe(). Do you plan that? As long as that is not the case, I can build some of the 737 AM instruments using FSUIPC for me only, because I ...
- Thu Nov 10, 2022 1:42 pm
- Forum: Under development and finished work
- Topic: Instrument submission guidelines question
- Replies: 17
- Views: 1606
Re: Instrument submission guidelines question
I got this reply: "We are not supporting LVARS for communication with our products. If a user needs to communicate this needs to be done via the .h and C++"
- Thu Nov 10, 2022 1:28 pm
- Forum: Under development and finished work
- Topic: Instrument submission guidelines question
- Replies: 17
- Views: 1606
Re: Instrument submission guidelines question
Hi Detlef, This particular guideline was introduced because several submissions were made that relied on using the Mobiflight wasm for access to LVAR’s back in the early days of MSFS. The good news is AM doesn’t require that now. AM community instruments can’t be reliant on other software for vario...
- Wed Nov 09, 2022 6:55 pm
- Forum: Under development and finished work
- Topic: Instrument submission guidelines question
- Replies: 17
- Views: 1606
Re: Instrument submission guidelines question
Sorry to say that no, we cannot have it rely on FSUIPC. But what can FSUIPC do what we can't? The 737 is from PMDG. The aircraft comes with an XML file that controls the behavior within MSFS. Normal users of the aircraft dont know nothing about that and there is no need for that. But I have found a...