Jump to content
The simFlight Network Forums

Offsets


Recommended Posts

Hello everyone.

More and more I come into the topic of offsets and usually I try to avoid them but it's getting to a point now where I cannot and I must try to use them. My problem is I know nothing about them. Can someone recommend a couple good tutorials on offsets and how to use them..find them etc. , preferably in a beginners form.

Thanks

Ed

Link to comment
Share on other sites

More and more I come into the topic of offsets and usually I try to avoid them but it's getting to a point now where I cannot and I must try to use them. My problem is I know nothing about them. Can someone recommend a couple good tutorials on offsets and how to use them..find them etc. , preferably in a beginners form.

Sorry, I think you misunderstand. "Offsets" are just numbers -- the distance in bytes, in a block of memory, from its base to the position of some data or functional facility trigger. There's no possibility of any general tutorial on them because there are many different forms of the data and facilities, for doing different things.

What you really need to do is state what you want to do and ask advice on how to do it. There's no other way. You need the purpose first.

Pete

Link to comment
Share on other sites

Ok Pete,

Appreciate your reply. Shows how much I know about them. Well here goes. I recently purchased Prosim737 and I want to install a sound wav to my trim wheels. Each of my trim wheels use a pulse switch. FSUIPC sees two buttons for each switch. This works great with the PMDGNGX as I can set the trim using the pulse switches as 4 different buttons. One for up and one for down trim on each wheel. This set up works with Prosim as well except there are no sound triggers in Prosim for three of the buttons . There is one (gate) available..so the result is I have trim wav on one button. I would like to have the trim wav available for all directions of trim travel..up and down on each wheel.

I do see some other entry areas in Prosim audio where perhaps I can use offsets to trigger sound for the other 3 buttons. Problem is I know nothing about offsets and rather than bombard forums with questions about them I was hoping to learn about them as much as possible before asking. One kind gentleman sent me a copy of offsets for PM and I have some pages of offsets myself from the FSUIPC SDK and what not.

Looking at elevator trim I think the bit number is 050A and it's size is 2. It goes on to say bit 5 Elevator, Bit 6 Elevator Trim,Bit 7 Aileron, Bit 8 Throttle. Prosim asks for a number 0x0000. I also see in the FSUIPC documents numbers that range in the 66thousands.. 66230 etc. I just dont know how all this correlates.

From what I gather, if I input the correct offset number I may be able achieve the result I am looking for. It also seems to me that for every action in FS there is a corresponding offset number. So for me the problem is to find out which offset does what and to be able to input it in it's proper numerical form.

I hope this makes sense to you Pete.

Appreciate your time.

Ed

Link to comment
Share on other sites

This set up works with Prosim as well except there are no sound triggers in Prosim for three of the buttons . There is one (gate) available..so the result is I have trim wav on one button. I would like to have the trim wav available for all directions of trim travel..up and down on each wheel.

Hmm. "Offsets" really don't have anything to do with sound.

I do see some other entry areas in Prosim audio where perhaps I can use offsets to trigger sound for the other 3 buttons. Problem is I know nothing about offsets and rather than bombard forums with questions about them I was hoping to learn about them as much as possible before asking. One kind gentleman sent me a copy of offsets for PM and I have some pages of offsets myself from the FSUIPC SDK and what not.

But how do you trigger the sound to play? What are you hoping to use for this.

Looking at elevator trim I think the bit number is 050A and it's size is 2. It goes on to say bit 5 Elevator, Bit 6 Elevator Trim,Bit 7 Aileron, Bit 8 Throttle.

There's really no such thing as a "bit number" of 050A. That number is hex for decimal 1290, and there are no numbers used in any computers I know of with that many bits! A "normal" integer in an x86 computer has 32 or 64 bits. If you meant to say "offset 050A" then that is an offset assigned to Project Magenta, with individual bits assigned to control certain actions in the PM MCP such as TO/GA. I really dn't know where you are getting your odd information from.

Prosim asks for a number 0x0000. I also see in the FSUIPC documents numbers that range in the 66thousands.. 66230 etc. I just dont know how all this correlates.

I've no idea about what ProSim is asking, but the CONTROLS listed in my documents in the 65535 and upwards range are simply the FS commands or controls which you can assign in FSUIPC or in FS iself to buttons,, keys and axes. There are hundreds of them and not to be confused at all with offsets.

From what I gather, if I input the correct offset number I may be able achieve the result I am looking for.

you dont "input" "offset nmbers"! They are merely references to data positions, as I already explained.

It also seems to me that for every action in FS there is a corresponding offset number.

No no no. Those are NOT "offsets" but "controls" or commands if you like. Some MS documents calles them "events" or "key events". They are all actions, not data.

So for me the problem is to find out which offset does what and to be able to input it in it's proper numerical form.

The complete list of FS command names and numbers is provided for you in a PDF in your FSUIPC Documents folder.

I hope this makes sense to you Pete.

I think you should explain what it is you want to do. If you want to trigger a sound, provided by you in the form of a wave file, then the only facility my programs provide for this is via Lua plug-in programming with the Lua sound library functions. you can certainly play any sound using that and trigger itby a value in an offset of by a key press or axis movement.

Pete

Link to comment
Share on other sites

Hmm. "Offsets" really don't have anything to do with sound.

I was hoping to use an offset to trigger a sound. But if it can't be done I will give up on that idea.

But how do you trigger the sound to play? What are you hoping to use for this.

Re: Prosim. Add an audio wav. Configure the wav to a trigger. The triggers are added by the Prosim developers.(called gates) . .unfortunately there is only one gate trigger for trim and I have 4 trim buttons, hence I need 4 gates. To get around the lack of gates I was experimenting with an area where you can enter offsets to trigger sounds and I thought maybe I could trigger a sound by inserting an offset into one of these. ie: a trim up or trim down offset.

There's really no such thing as a "bit number" of 050A. That number is hex for decimal 1290, and there are no numbers used in any computers I know of with that many bits! A "normal" integer in an x86 computer has 32 or 64 bits. If you meant to say "offset 050A" then that is an offset assigned to Project Magenta, with individual bits assigned to control certain actions in the PM MCP such as TO/GA. I really dn't know where you are getting your odd information from.

My mistake. Meant offset. Most of my information I got from searching the word 'offset in this forum. Looks like I got a bit confused with some of it.

I've no idea about what ProSim is asking, but the CONTROLS listed in my documents in the 65535 and upwards range are simply the FS commands or controls which you can assign in FSUIPC or in FS iself to buttons,, keys and axes. There are hundreds of them and not to be confused at all with offsets.

Ahh yes. ok. I understand the FS list.. When I configure a wav in the Prosim Audio Configure FSUIPC menu area a box opens up with 0x0000. I assume it's wanting you to insert an offset number here.post-24515-0-47877100-1361308556_thumb.j

I have most of my controls and all my axes calibrated through FSUIPC and as such are working fine depending on software being used. With the avionics software I have to add sounds as it uses the default 738 sounds and that area doesn't include sounds for my homemade throttle to take advantage of.

you dont "input" "offset nmbers"! They are merely references to data positions, as I already explained.

Copy that. References to data positions only.

No no no. Those are NOT "offsets" but "controls" or commands if you like. Some MS documents calles them "events" or "key events". They are all actions, not data.

The complete list of FS command names and numbers is provided for you in a PDF in your FSUIPC Documents folder.

I think you should explain what it is you want to do. If you want to trigger a sound, provided by you in the form of a wave file, then the only facility my programs provide for this is via Lua plug-in programming with the Lua sound library functions. you can certainly play any sound using that and trigger itby a value in an offset of by a key press or axis movement.

hmm..ok...then it looks like it can't be done. I have queried the Prosim Forum as well..but no luck . I will have a look at LUA though and see if there's is any option to make it work with the Prosim Avionics suite as far as sound triggers go. In the jpg you can see where I found the area for offsets. Also my trim wheels work on a 4 button input. Button 30 is being used for trim up on Captains wheel. Trim down no sound. F/O side no sound up or down.

Thanks for your time Pete.

Ed

Pete

Link to comment
Share on other sites

I was hoping to use an offset to trigger a sound. But if it can't be done I will give up on that idea.

Oh, of course it can be done. If you know what offset contains the event acting as a "trigger", then a short Lua plug-in could be written to play a wave when the trigger is set. This plug-in would have an event.offset function call for that offset, which executes a function which uses the sound.play function to play the sound. It isn't difficult. There are lots of examples of Lua plug-ins supplied in your FSUIPC Documents folder, and a lot more in the User Contributions subforum here.

And i can help too. You need merely to identify the trigger and the sound you want to play.

Re: Prosim. Add an audio wav. Configure the wav to a trigger. The triggers are added by the Prosim developers.(called gates) . .unfortunately there is only one gate trigger for trim and I have 4 trim buttons, hence I need 4 gates. To get around the lack of gates I was experimenting with an area where you can enter offsets to trigger sounds and I thought maybe I could trigger a sound by inserting an offset into one of these.

Sorry, very little of that makes any sense at all to me. Maybe you need to talk to ProSim support about this?

ie: a trim up or trim down offset.

There we go again. You are persisting with your misunderstanding of offsets. Offsets contain DATA. "Trim Up" and "Trim Down" are actions, or commands, or controls if you like. Not "data".

You can read, from an offset, the current trim value, and therefore see when it changes. But if you play a sound lasting, say, 1 second, and you change the trim value say 10 times a second (quite easily), it gets complicated. With a simple plug-in you'd end up playing the sound ten times simultaneously, overlapping. so you'd need to also test if the sound is already playing, and avoid starting it again.

I can help with this if you wish. You'll need to identify the sound wave file.

With the avionics software I have to add sounds as it uses the default 738 sounds and that area doesn't include sounds for my homemade throttle to take advantage of.

Wouldn't the best place to ask be the ProSim forum then?

... Ah, I see you have. Didn't they understand you there, then?

Pete

Link to comment
Share on other sites

Thanks Pete,

"Wouldn't the best place to ask be the ProSim forum then?"

"... Ah, I see you have. Didn't they understand you there, then?"

Well, apparently not for I got but one response and that was from a fellow who gave me a list of PM offsets in hopes it would help. I have not heard from anyone else so perhaps its a software limitation. When I came across that drop down menu that listed FSUIPC options I thought I would ask you about it. I'm going to leave this thread now and read up on Lua and go over my FSUIPC documentation. I have learned lots already from this thread and I have to thank you for that. I'll be back again when I'm a little more knowledgeable about these offsets , commands, events and what not. I now know that 'offsets' contain data where as I always thought they pointed to or marked an event that contained data.

Anyways , appreciate your time,

Thanks a million

Ed

Link to comment
Share on other sites

I'm going to leave this thread now and read up on Lua and go over my FSUIPC documentation. I have learned lots already from this thread and I have to thank you for that. I'll be back again when I'm a little more knowledgeable about these offsets , commands, events and what not.

Okay. Don't forget, I will help construct a plug-in to play a sound when the trim value changes. If you want to have a stab at it, check the Lua library documentation. You'll need the event.offset function, referring to the trim offset, a WORD value at offset 0BC2 (you'll see this if you check the FSUIPC Offsets list -- if you've installed FSUIPC 4.86 you'll find one in your FSUIPC Documents folder), and the sound functions sound.play, and sound.query. The entire plug-in would only be about 6-9 lines long. You'd have it loaded atomatically when FS starts, either via ipcReady.lua, or by using the [Auto] facility in the INI file.

Regards

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.