Jump to content
The simFlight Network Forums

Can this code be implemented from FSUIPC?


Gehall1963

Recommended Posts

Hi John;

I would like to implement the engine starter sequence in the SSW FRF-104 and assign to a switch but it uses both Lvars (I know how to use these) and the code below, just wondering if this is possible with FSUIPC?   Would this be an LUA script?   More than willing to scour the advanced manual to learn more but don't want to waste time if it can't be done.

<!-- left starter switch -->

<Name>left_starter</Name>

<Animation>

<Parameter>

<Code> (L:starter0, number) 50 * </Code>

<Lag>100</Lag>

</Parameter>

</Animation>

<MouseRect>

<Cursor>Hand</Cursor>

<TooltipText>LEFT STARTER </TooltipText>

<MouseFlags>LeftRelease+LeftSingle</MouseFlags>

<CallbackCode>

(M:Event) 'LeftSingle' scmp 0 == if{ 69635 (>L:custom_event_id, number) 1 (>L:starter0, number) }

(M:Event) 'LeftRelease' scmp 0 == if{ 0 (>L:starter0, number) }

</CallbackCode>

</MouseRect>

 

Thanks

Glen

Edited by Gehall1963
Link to comment
Share on other sites

Well, as I am not sure what that "code" is or does, it is difficult to say, but I don't see why it wouldn't be possible in lua if its just using custom events and lvars. It may even be possible to implement directly in calculator code, in which case you could just define a preset and use that.  The MobiFlight Discord channel would be the place to ask about turning that into calculator code.

John

Link to comment
Share on other sites

Hi John;

The solution turned out to be simpler than I thought, the only relevant part of the code is the custom event ID 69635, switching this to a value of 1 initiates the start sequence so it was very simple to assign this to a switch.  In the end I just added these entries to the FSUIPC.ini file.

[LvarOffsets.CF-104]
1=L:starter0=UB0xA001
2=L:starter1=UB0xA002

[Buttons.CF-104]
1=PE,30,Cx0100A001,x01     -{offset byte set, offset A001}-
2=UE,30,Cx0100A001,x00     -{offset byte set, offset A001}-
3=PE,30,Cx0100A002,x01     -{offset byte set, offset A002}-
4=UE,30,Cx0100A002,x00     -{offset byte set, offset A002}-
5=PE,30,C69635,1     -{Custom control: <69635>}-
6=UE,30,C69635,0     -{Custom control: <69635>}-

I'm learning :), Thanks again for your reply and for a great piece of software !

Glen

 

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.