Visit Captain Sim web site  
  Welcome, Guest. Please Login or Register

 

Page Index Toggle Pages: 1 [2]  Send TopicPrint
 10 Sim event/variable/simconnect questions (Read 7082 times)
retiredflyer73
Full Member
*
Offline



Posts: 17
Joined: May 22nd, 2024
Re: Sim event or variable?
Reply #15 - Jun 7th, 2024 at 1:27pm
Print Post  
can you tell me the variable you used for the APU start light? I get it to come on after starting the APU but it does not go out as it's supposed to.
  
Back to top
 
IP Logged
 
skudd
New Member
Offline



Posts: 2
Joined: Nov 25th, 2024
Re: How to start a new topic?
Reply #16 - Nov 25th, 2024 at 5:28pm
Print Post  
I'm trying to add the CS C-130 to an addon platform I am building, which uses SimConnect to set fuel loads (and eventually payloads). I've found though that "Tank No. 1" and "Tank No. 4" don't seem to have any representation in the documented simvars in SimConnect. I would have assumed them to be the "FUEL TANK LEFT MAIN" and "FUEL TANK RIGHT MAIN" values, but those are not implemented, it seems.

Am I missing something? Are these handled by a different simvar? Is it a bug in the addon?
  
Back to top
 
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4357
Joined: Nov 7th, 2005
Re: Sim event/variable/simconnect questions
Reply #17 - Nov 28th, 2024 at 10:43am
Print Post  
skudd wrote on Nov 25th, 2024 at 5:28pm:
I'm trying to add the CS C-130 to an addon platform I am building, which uses SimConnect to set fuel loads (and eventually payloads). I've found though that "Tank No. 1" and "Tank No. 4" don't seem to have any representation in the documented simvars in SimConnect. I would have assumed them to be the "FUEL TANK LEFT MAIN" and "FUEL TANK RIGHT MAIN" values, but those are not implemented, it seems.

Am I missing something? Are these handled by a different simvar? Is it a bug in the addon?


The C130 uses a fuel system, which is represented by different simvars.
See variables starting with FUELSYSTEM in the SDK documentation.
Regarding fuel tanks, see FUELSYSTEM TANK QUANTITY:INDEX, replacing INDEX with the desired tank index.

Tank indices:
1: TANK NO.1
2: TANK NO.2
3: LEFT AUXILIARY
4: LEFT EXTERNAL
5: RIGHT_EXTERNAL
6: RIGHT AUXILIARY
7: TANK NO.3
8: TANK NO.4

Tank/pump/valve indices can be found in the [FUEL_SYSTEM] section of the
flight_model.cfg

Following simvars may also be useful:
FUELSYSTEM TANK TOTAL QUANTITY:INDEX
FUELSYSTEM TANK WEIGHT:INDEX
FUELSYSTEM TANK LEVEL:INDEX
  
Back to top
IP Logged
 
skudd
New Member
Offline



Posts: 2
Joined: Nov 25th, 2024
Re: Sim event/variable/simconnect questions
Reply #18 - Dec 7th, 2024 at 7:04pm
Print Post  
Ah, perfect. I overlooked that in the API docs.

Thank you!
  
Back to top
 
IP Logged
 
7DR
New Member
Offline



Posts: 3
Joined: Mar 27th, 2025
Re: Sim event/variable/simconnect questions
Reply #19 - Apr 4th, 2025 at 4:21pm
Print Post  
I'm building Air Manager instruments for the J model, and have questions on some autopilot functions.
Climb/Glide - using L:P17_002_KNB I can move the wheels fine, but nothing else happens. Using L:m133_AP_target_pitch seems to make control operate. Is this the best way?
Turn knob - L:P17_001_KNB will move the knob, but again, nothing else happens.
Heading Bug  - L:L07_001_IND sets bug on HSI and that's it.  I tried adding a number of different HEADING_ events with no success.
Also, anybody know the readback variable for the DC power switch (off/bat/ext)?
Any help is appreciated!
Thanks to CS for bringing the 130 to msfs!
  
Back to top
 
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4357
Joined: Nov 7th, 2005
Re: Sim event/variable/simconnect questions
Reply #20 - Apr 8th, 2025 at 8:21am
Print Post  
7DR wrote on Apr 4th, 2025 at 4:21pm:
I'm building Air Manager instruments for the J model, and have questions on some autopilot functions.
Climb/Glide - using L:P17_002_KNB I can move the wheels fine, but nothing else happens. Using L:m133_AP_target_pitch seems to make control operate. Is this the best way?
Turn knob - L:P17_001_KNB will move the knob, but again, nothing else happens.
Heading Bug  - L:L07_001_IND sets bug on HSI and that's it.  I tried adding a number of different HEADING_ events with no success.

The problem is that not all controls work through only reading/writing the variable.
In some cases, when you click, additional actions occur, for example, default events of the sim are triggered, etc.
Moreover, some logic can be processed in wasm. Therefore, for example, rotating the Pitch/Turn knobs simply by assigning values to the P17_001_KNB/P17_002_KNB variables does not give the desired result. That is, it does not give the same effect as their full rotation by clicking or by assigned controls in the sim.

Of course, you can always change the code in xml, if you understand how. Therefore, I can only advise you to look at q135_302_interior.xml and cs130_interior_common.xml. Search for the elements of interest there, see how they work and try to change them to suit your needs.

Quote:
Also, anybody know the readback variable for the DC power switch (off/bat/ext)?

Same story. There is no variable for the position of this switch. Its position depends on the default systems of the sim and is determined by the code:
<ANIM_CODE>(A:ELECTRICAL MASTER BATTERY:1, Bool) if{ 1 } els{ (A:EXTERNAL POWER ON:2, Bool) if{ 2 } els{ 0 } }</ANIM_CODE>
The click code is even more complicated.

I can only name the DC power code of the switch: O05_001_GL3. Search by this name in the above xml and see how it works.
  
Back to top
IP Logged
 
7DR
New Member
Offline



Posts: 3
Joined: Mar 27th, 2025
Re: Sim event/variable/simconnect questions
Reply #21 - Apr 10th, 2025 at 4:19pm
Print Post  
Thank you for the reply and info.  I'll check out the code and  advise with any revelations.
Also, though it's off subject, the reverse thrust characteristics/performance could use some work - it's very weak.
  
Back to top
 
IP Logged
 
7DR
New Member
Offline



Posts: 3
Joined: Mar 27th, 2025
Re: Sim event/variable/simconnect questions
Reply #22 - Apr 10th, 2025 at 6:44pm
Print Post  
I don't seem to have any ...interior.xml files.  This was a ms store purchase.  Only xml I have is 2 library files.??
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint
 
  « Board Index ‹ Board  ^Top