Spawning vessels and animations

streb2001

Addon Developer
Addon Developer
Donator
Joined
Feb 9, 2008
Messages
326
Reaction score
0
Points
16
Location
North Yorkshire
I am coding a dll for the Shenzhou spacecraft. I am separating the spacecraft modules using the same method shown in the stock Atlantis dll source i.e. calling oapiCreateVesselEx() to spawn the detached module as a new vessel. This works well, except that the new vessel has its animations reset. I could of course set the anim state in the new vessel dll on creation but that assumes the anims were in this state before. The anims could be in any position.

My question is: is there a way of communicating this information between running vessel instances? I imagined creating a data structure in reserved memory and sharing it, or maybe defining a "friend" method in the parent vessel and have the child vessel call it to get the anim states.

This must be possible. Anyone any suggestions?

s2k1
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,336
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
If the vessel module you create, is also done by your code, you can either communicate with it directly by getting its vessel interface and cast it to the known subclass, or you can use CVEL - the cvelmessage.dll functions can even be used, if the vessel is not based on CVEL.
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
Hi Streb. As Urwumpe said, you can get the VESSEL pointer to your vessel with oapiGetVesselInterface(), then cast it to your derived class, and set animation states that way. However an easier hack is to simply send the messages using the clbkConsumeBufferedKey.
 

streb2001

Addon Developer
Addon Developer
Donator
Joined
Feb 9, 2008
Messages
326
Reaction score
0
Points
16
Location
North Yorkshire
Thanks chaps. Seems straightforward, I'll get my thinking cap on.
 
Top