Question Arrow Freighter syncing/controlling with simpit ideas?

vdrorb

Member
Joined
Jan 23, 2011
Messages
16
Reaction score
0
Points
16
Hi folks,

I love the arrow freighter and i am looking for some hints how i can control it without using the virtual cockpit.
While the normal flight parameter can get accessed via the VESSEL* class oapi functions i would love also to control the light, gravity wheel, the fantastic countdown etc.
maybe somehow accessing the oapiVC* calls,... just brainstorming
any ideas to achieve this would be welcome :cheers:
 

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
I'd look into (ab)using clbkSaveState() / clbkLoadStateEx().
 

vdrorb

Member
Joined
Jan 23, 2011
Messages
16
Reaction score
0
Points
16
I'd look into (ab)using clbkSaveState() / clbkLoadStateEx().

:tiphat:
yeap, thats was a thought of mine too.. now decoding the line in the savefile

SAVEVAR00 0§0,1§0.00,2§0,3§0.00,4§0,5§0.00,6§0,7§1,8§0.00,9§1,10§0.00,11§0.00,12§0,13§1,14§1,15§0.00,16§0,17§0,18§3,19§1,40§0.04,41§4,42§0,43§0,44§0.00,45§0,46§0.00,47§0.00,48§0,

...but will i be able to set something (sure i am in the savefile) but can i make the arrowfreighter to know it on the fly

:hailprobe:
 

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
Calling clbkLoadStateEx() should cause the vessel to load its state from the save file supplied. Have a look at master/slave sources (Common/Message.cpp, VesselStateMessage object) to see how it works.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,905
Reaction score
2,166
Points
203
Location
between the planets
Calling clbkLoadStateEx() should cause the vessel to load its state from the save file supplied.

Have you ever tried that on SimTime? I wouldn't expect it to work, really.
 

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
Have you ever tried that on SimTime? I wouldn't expect it to work, really.

It works with Shuttle-A (in clbkPostStep()). It doesn't work with SSU. Didn't test with Arrow (yet)... But it's worth giving it a try.

Essentialy, whether it works depends on how the vehicle author chooses to interpret the VESSEL2 spec.
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
attachment.php

Technically, calling clbkLoadStateEx is unsafe during the simulation, but it can sometimes be safe depending on how the vessel was written.

The "safe" way to do it would be to directly call the vessel's clbkVCMouseEvent in PostStep, like I did (with clbkPanelMouseEvent, but the idea is still the same) in SimpitController here.

The only issue with clbkVCMouseEvent is you have to hook the vessel and capture the VC events traveling to the Arrow Freighter.
 
Top