This is because the <CreateFromItem> event installs devices after creating the ship if it has autonConfig data. I think this should be made consistent, but there are a few ways to do it, depending on how shields work canonically:

1) Shields cannot be active while inside another object.

  • All ships should have shields depleted when created from a ship or non-gate station. This would affect ships deployed from CSCs, Korolov stations, etc.

2) Shields can be active while inside large enough ships and stations.

  • All ships should have shields depleted when created from an object that's too small.
  • Autons with autonConfig created from a large enough object should have shields restored.
  • Possibly some of 3).

3) Shields can be active while inside any other object.

  • Autons should remember their shield level when converted to an item.
  • Autons with autonConfig should have shields set to stored shield level.
  • Autons with autonConfig but no shield level should have shields restored.
  • baAutonItemBase should have an <OnUpdate> event that increases the shield level, to simulate regeneration.
  • Replacing an auton item's shields (and possibly other items) should set the stored shield level to 0.
  • Ideally, the stored shield level should be displayed as a percentage in dsAutonBay, but the screen would have to be periodically refreshed (it seems like this would require a recurring event or using behavior hard-coded for the Neurohack screen).

See also Ships with variable hp shields are created with less than full shields.

nms 10 Nov 2017:

George indicated on the stream that there's no canonical reason shields can't be up inside another ship, so I think option 3 is best for Constellation gameplay.

I've implemented saving and restoring the shield level. And displaying the saved level in the auton bay screen should be simple enough. But regeneration while in item form is waiting on a function to get the shield regen rate.

George suggested saving the tick the auton returned and calculating the shield level when launching, instead of using an event. This would be slightly more accurate and have less overhead, but it would prevent autons that have been launched from ever stacking, even if they're identical. Also, the event could refresh the screen if appropriate, allowing the auton bay screen to update as the shield regenerates.

A third possible approach is to use a suspended ship, which might enable anything that changes over time to keep working. E.g. patcher arm, thermo shell nanofac, etc. But I'm not clear on what does and doesn't update for suspended ships. And it would be tricky to handle gating. EDIT: Shield level doesn't update for suspended ships. There would have to be a similar feature where a ship continues to update, but doesn't have AI and doesn't exist as far as other objects are concerned.