vranki / ExtPlane

Plugin for X-Plane flight simulator which allows reading and writing simulation properties
138 stars 44 forks source link

Get one value from Array #65

Open HoBu23 opened 4 years ago

HoBu23 commented 4 years ago

i cant find a method to get one value from an array. Or have i missed a post? Regards Horst

HoBu23 commented 4 years ago

It would be very nice if you could sub {dataref} [int] could define. Then you would directly get the value for this array element back.

Currently: sub sim/cockpit2/switches/generic_lights_switch set sim/cockpit2/switches/generic_lights_switch [,,,,,1] ufa sim/cockpit2/switches/generic_lights_switch [1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

Super would be, i.g. also: sub sim/cockpit2/switches/generic_lights_switch [5] set sim/cockpit2/switches/generic_lights_switch [,,,,,1] uf sim/cockpit2/switches/generic_lights_switch 1.0

I would need a lot.

vranki commented 4 years ago

Could be done. Currently you can just get the full array and use the value you want. Pull requests welcome!