Jump to content
The simFlight Network Forums

Title Bar


gfd

Recommended Posts

Greetings,

I am just beginning to use offsets. There is an offset event available. I would like to show a value on the title bar of p3d. What I would do is capture the value of an existing offset, manipulate the value, assign that value to an unused offset and show the value of that offset using the logging page. Can I do it this way?

function ShowSomething(offset, value)

local newValue = value/10

writeSB(0x, newValue)

end

event.offset(0x, "SB", ShowSomething)

I would enter 0xoffsetUnused in the logging page to show on the title page. Confirmation or criticism most welcome,

Graham

Link to comment
Share on other sites

I am just beginning to use offsets. There is an offset event available. I would like to show a value on the title bar of p3d. What I would do is capture the value of an existing offset, manipulate the value, assign that value to an unused offset and show the value of that offset using the logging page. Can I do it this way?

 

Well, with some corrections, yes:

 

function ShowSomething(offset, value)

local newValue = value/10

ipc.writeSB(0x????, newValue)

end

event.offset(0x????, "SB", "ShowSomething")

 

where the ???? parts are replaced by the correct hex values you want.

 

With Lua development, don't be afraid to actually try things. Yes, of course ask if you get stuck, but you can rarely do any harm by simply experimenting.

 

Pete

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.