gfd Posted December 31, 2014 Report Posted December 31, 2014 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
Pete Dowson Posted January 5, 2015 Report Posted January 5, 2015 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
gfd Posted January 5, 2015 Author Report Posted January 5, 2015 Thanks. Your last statement iced the cake. Inexperience sometimes leads one to be wary of blowing up the backyard. Graham
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now