Jump to content

How to display something in a Lua window


stefwei

Recommended Posts

Posted

Hello,

This seems to be a quite odd question but I can' get anything to display in a Lua window.

My lua file contains only one line

ipc.display("This is my text")

but it doesn't display anything.

I tried this

ipc.display("")
ipc.display("This is my text")
ipc.sleep(5000)

It works, The window stays 5 seconds.

But this doesn't work

ipc.display("")
ipc.display("This is my text", 5)

Who can help me to figure this out?

Stefan

Posted

Hello,

 

this is more a general question for the FSUIPC Forum, not especially LINDA I think?

 

However, how do you execute this script?

Is it part of a LINDA module and therefore inside a function?

 

As you can let show the display for 5 seconds using the ipc.sleep, I assume you have somewhere in your code in an other part also an ipc.display("") which closes your window immediately.

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Posted

I was just working in a Linda Editor window to learn how to manage scripts.

The line is in a lua file triggered by an entry in the user.lua file of the plane I was working on.

6 minutes ago, guenseli said:

As you can let show the display for 5 seconds using the ipc.sleep, I assume you have somewhere in your code in an other part also an ipc.display("") which closes your window immediately

My understanding of the syntax is:

ipc.display("string", delay) where I can set the delay for the time the message would be displayed. This doesn't work. It doesn't work either without the preceding ipc.display("") line

Posted

 

Difficult ...

But if you use it in LINDA then you have to use it inside a function, e.g.

 

function test ()

ipc.display("test")

end

 

and then execute this function.

 

As you say, ipc.display is just working, when you add ipc.sleep(5000), then my assumption is, that in the whoöe wide LINDA code something is terminating you display immediately. With ipc.sleep, you pause the whole code for 5 seconds.

I think, inside a function it should work then ...

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Posted

Yes. The function is MyTrials in the user.lua file of my plane. It says: runlua('MyTrials'). MyTrials.lua is a file in my modules folder.

Ok, I got it! My way is a too complicated way. It is far more convenient to write directly in the user.lua file.

I created a function 'MyTrials', assigned it to a button, and now the line

ipc.display("I got it!", 5)

is displayed as wanted.

Thanks for the hint,

Stefan

Posted
7 hours ago, stefwei said:

MyTrials.lua is a file in my modules folder. 

Ok, I got it! My way is a too complicated way. It is far more convenient to write directly in the user.lua file.

 

 

Ah, ok, now I understand. 

ok, that was much too complicated … glad you sorted it now.

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Archived

This topic is now archived and is closed to further replies.

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