Linking a Dock Path to a Specific Animation

Hi all,

Pretty sure this hasn’t been addressed specifically elsewhere, a search of the forum hasn’t turned anything up at least.

I am currently setting up the fed_TNG_starbase so all four of the main doors open and close, I’ve prepared everything and given it three animations per door (launch, dock and close) and am looking at the kad_FuelPod example to see how the pros have done it. First thing I notice is the “_MAD[1]” Sub Parameter, this seems tied in with the different animations but there’s nothing on the ANIM joints to tie these together

How/where are these actually linked? Nothing in the kad_fuelpod *.madstate file looked like it really linked these together except for these “wrappers” below

-- State-specific wrappers

-- Docking path 0
KAD_FUELPOD_DockPathOpen_OnSet = function(ship)
    KAD_FUELPOD_DockPathOpenArm_OnSet(ship, "DockPathOpen", "FightL0Open", "FightL0Close")

KAD_FUELPOD_DockPathOpen_OnPause = function(ship)	
    KAD_FUELPOD_DockPathOpenArm_OnPause(ship, "DockPathOpen", "FightL0Open", "FightL0Close")

KAD_FUELPOD_DockPathClosed_OnSet = function(ship)
    KAD_FUELPOD_DockPathClosedArm_OnSet(ship, "DockPathClosed", "FightL0Open", "FightL0Close")

KAD_FUELPOD_DockPathClosed_OnPause = function(ship)	
    KAD_FUELPOD_DockPathClosedArm_OnPause(ship, "DockPathClosed", "FightL0Open", "FightL0Close")
	setState(ship, "DockPathClose", 1)

-- Docking path 1
KAD_FUELPOD_DockPathOpen1_OnSet = function(ship)
    KAD_FUELPOD_DockPathOpenArm_OnSet(ship, "DockPathOpen1", "FightL1Open", "FightL1Close")

KAD_FUELPOD_DockPathOpen1_OnPause = function(ship)	
    KAD_FUELPOD_DockPathOpenArm_OnPause(ship, "DockPathOpen1", "FightL1Open", "FightL1Close")

KAD_FUELPOD_DockPathClosed1_OnSet = function(ship)
    KAD_FUELPOD_DockPathClosedArm_OnSet(ship, "DockPathClosed1", "FightL1Open", "FightL1Close")

KAD_FUELPOD_DockPathClosed1_OnPause = function(ship)	
    KAD_FUELPOD_DockPathClosedArm_OnPause(ship, "DockPathClosed1", "FightL1Open", "FightL1Close")
	setState(ship, "DockPathClose1", 1)

The only difference being the number inserted into the name of the _OnSet functions… is this the link? Am I missing something? If anyone has played with this before please let me know of your experience :smiley:

1 Like

I think that’s the link.
Have a look at scripts\meshanimation.lua file, and you’ll find things like DockPathClosed1, DockPathOpen2 were listed with those RepairDo, CodeRed and so on.


I agree with lone wolf. I remember looking into this before and coming to that conclusion, although I haven’t tested it…

1 Like

Odd, this file causes an Access Violation straight up… Nothing in the log with it too…

I’ve been able to partially test this and it looks correct! Only issue is paths 6, 7 and 8 which seem to need to be added to the meshanimation.lua file? Now that you mention it? My 4th dock path (despite being identical to the other 3) is not working and that’s on the same anim set that I can’t list yet.

I’m re-extracting my HWRM big files in case there was something updated, something different, that made the old file invalid :confused:

A fresh copy of the file was processed fine, a modified copy chucked the ■■■■■ :confounded:

More prodding is required…

Yeah… you can’t add to the pairs… looks like 6 sets of MAD to dockpath animations might actually be hardcoded somewhere… and we need 8 for the Starbase doors :frowning:

1 Like

Ok, results are in!

  1. There is a HARDCODED LIMITATION of 6 paths as this was likely done specifically for the Kadeshi fuel pod. This is unfortunate. Hard Coding is bad folks. You could have at least done something like 10 paths instead of 6 if Hard Coding was unavoidable :confused:
  2. You can ONLY use each of the 6 pairs of “DockPathOpen” and “DockPathClosed” (one unnumbered, 5 numbered) from meshanimation.lua for the purposes of a MAD animation link, nothing else there will elicit a reaction
  3. If you add an “exclusive” pair to meshanimation.lua you will get an Access Violation as the Hard Coding is hit head on
  4. Adding “inclusive” pairs in meshanimation.lua doesn’t seem to cause Access Violations
  5. Correlation between animation index and DockPathOpen/Closed is indeed the number at the end of it.

The implications of this is that the Federation Starbase now has three fully fleshed out doors with their own anims and dock/launch paths and one that just can’t be done… and it will annoy me forever now :confused:

(If anyone is wondering why 4 doors need 8 paths its because we’re using a different pattern of lights for dock and launch, so one MAD index per path was required).


You can trigger mad animations from Lua. So it is conceivable that you could create the last dock animation as a non-used animation (e.g. resource operation - in no Trek fan, but I’m pretty sure that station does not mine asteroids…) and then trigger it artificially via custom code when the dock path is used.