Jump to content

How to determine open/closed stage at launch


Recommended Posts

I'm working on an animation module for a retractable wing.  The wing can be either open or closed, but I don't know how to determine it's current state.  This is the module cfg for the part:

	MODULE
	{
	   name = ModuleAnimateGeneric
	   animationName = foldingWingAnim
	   startEventGUIName = Fold
	   endEventGUIName = Unfurl
	}

So, the way it is working is that it will be launched in the same stage as it is in the SPH.  So, when the wing is open, the event says "Fold", and when it is closed, the event says "Unfurl".  How can my code know what state it is in?

Thanks in advance

Link to comment
Share on other sites

5 hours ago, linuxgurugamer said:

I'm working on an animation module for a retractable wing.  The wing can be either open or closed, but I don't know how to determine it's current state.  This is the module cfg for the part:


	MODULE
	{
	   name = ModuleAnimateGeneric
	   animationName = foldingWingAnim
	   startEventGUIName = Fold
	   endEventGUIName = Unfurl
	}

So, the way it is working is that it will be launched in the same stage as it is in the SPH.  So, when the wing is open, the event says "Fold", and when it is closed, the event says "Unfurl".  How can my code know what state it is in?

Thanks in advance

Solved.  For anyone who is interested, the var:  animation.animTime goes from 0 to 1.  You need to figure out whether 0 is deployed or retracted, depending on the model

Link to comment
Share on other sites

Just like a stock dish

	MODULE
	{
		name = ModuleAnimateGeneric
		animationName = Deploy
		isOneShot = false
		startEventGUIName = Extend
		endEventGUIName = Retract
		actionGUIName = Toggle Antenna
		allowAnimationWhileShielded = False
	}
	MODULE
	{
		name = ModuleAnimateGeneric
		animationName = pulseEmitMediumDishAntenna
		isOneShot = false
		startEventGUIName = Blink Lights
		endEventGUIName = Blink Lights
		allowManualControl = False
	}
	MODULE
	{
		name = ModuleDataTransmitter
		packetInterval = 0.35
		packetSize = 2
		packetResourceCost = 12.0
		requiredResource = ElectricCharge
		DeployFxModules = 0                     <------------  Here
		ProgressFxModules = 1                   <------------  Here
	}

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...