Jump to content
The simFlight Network Forums

Recommended Posts

Posted

1. Can an LVar be added to an offset - 0x66C6, 2, L:switch_fuel_left, Enum, w?   Would be valuable to use with compound button/key press.

What kind of variables can be used? 

Posted

Also, having difficulty with offset conditions with keyless programming in the C510.ini. I want to toggle the starter keypress based on its variable. 

2=W0892=0,220,40,CIENGINE_Starter_1,1  If 0x0892 2 GENERAL ENG STARTER:1  is 0 (off) then start the engine.

4=W0892=1,220,40,CIENGINE_Starter_1,0   If 0x0892 2 GENERAL ENG STARTER:1  is 1 (on) then stop the starter.                  

If this works for a button shouldn’t it work for a keypress?

Result

  • 2=<< ERROR 21! Line ignored >>

4=<< ERROR 21! Line ignored >>

21 Virtual key number not in range 1–255

Posted
21 hours ago, DaveSCUSA said:

1. Can an LVar be added to an offset - 0x66C6

Generally yes, as that is in an offset area designated as free for general use. But you can only add it there as either a byte or word (2-bytes), and not as a double-word (4-bytes) or double floating point number (8 bytes) due to offset boundaries (i.e. the address ends in a 6, so you cannot use it for 4 or 8 byte values).

21 hours ago, DaveSCUSA said:

2, L:switch_fuel_left, Enum, w?

As this is an enum, you can add it as an unsigned byte.

Quote

 

10 hours ago, DaveSCUSA said:

2=W0892=0,220,40,CIENGINE_Starter_1,1  If 0x0892 2 GENERAL ENG STARTER:1  is 0 (off) then start the engine.

4=W0892=1,220,40,CIENGINE_Starter_1,0   If 0x0892 2 GENERAL ENG STARTER:1  is 1 (on) then stop the starter.                  

If this works for a button shouldn’t it work for a keypress?

Yes, but that won't wok for buttons either as the format is wrong - you have an additional/unneeded comma after the offset condition., and you have comments but no comment designator. Please consult the Advanced User guide if you have issues like this - it should be obvious if  you read this. For example, on P24 of the Advanced User guide:

Quote

You add an offset condition to any Key or Button parameter line in FSUIPC7.INI as follows:
        <sequence number>=<offset condition> <usual parameter>
The space between the new condition and the normal parameter is essential.

A simple example will help. Take this button push parameter, designed to toggle the landing gear when the button is pushed:
        1=P1,0,C65570,0
By adding an offset condition we can stop this doing anything when the aircraft is on the ground:
        1=W0366=0 P1,0,C65570,0

 

Is that not obvious?

Please always at least consult the manuals before posting, and also check/search the support forums for similar questions or issues. If you get an ERROR logged, then check your syntax against the manuals.

John

Posted
8 hours ago, DaveSCUSA said:

2=W0892=0,220,40,CIENGINE_Starter_1,1  If 0x0892 2 GENERAL ENG STARTER:1  is 0 (off) then start the engine.

4=W0892=1,220,40,CIENGINE_Starter_1,0   If 0x0892 2 GENERAL ENG STARTER:1  is 1 (on) then stop the starter.                  

If you want a key or button assignment to toggle an Input Event value, the best way to achieve this is to add the Input Event to an offset, using the new [InputEventOffsets] ini parameter section, and then assign to the offset byte togglebits control,. So, to add an input event to an offset in your C510.ini profile, add the following to your C510.ini file (below using offset A000):

Quote

[InputEventOffsets]
1=ENGINE_Starter_1=UB0xA000

And then assign to the FSUIPC-added control Offset Byte Togglebits with an offset value of A000 (change as needed) and a parameter of x1 (i.e. toggle first bit, to toggle between 0 and 1).

See new section Adding Input Events to Offsets on page 52 of the Advanced User guide.

John
 

John

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.