There are two ways to reduce the amount of duplication. One is to inherit from a base class. With a station baseclass you can inherit the language, events, docking ports etc. However, you cannot currently inherit the DockScreens elements. For example:
Code: Select all
<StationType UNID="&baStarGate">
<DockingPorts>
<Port x="0" y="0"/>
</DockingPorts>
<Language>
<Text id="actionGate">"[G]ate"</Text>
<Text id="actionUndock">"[U]ndock"</Text>
<Text id="descStargate">
"You are docked at the center of an alien stargate. These giant structures are used by the Ancient Races to move their starships across The Galaxy. Stargates are the best mode of faster-than-light travel and they are the only method known to humans."
</Text>
</Language>
</StationType>
However, in this case what you really want is a shared dockscreen. For example:
Code: Select all
<DockScreen UNID="&dsStargate;"
inherit= "&dsDockScreenBase;"
>
<Panes>
<Default>
<OnPaneInit>
(scrSetDescTranslate gScreen 'descWelcome)
</OnPaneInit>
<Actions>
<Action id="actionGate" default="1">
(block (
(currentStargateID (objGetStargateID gSource))
(destinationInfo (sysGetStargateDestination currentStargateID))
(destinationNode (@ destinationInfo 0))
(destinationGateID (@ destinationInfo 1))
)
(objGateTo gPlayerShip destinationNode destinationGateID &efStargateOut;)
(scrExitScreen gScreen 'forceUndock)
)
</Action>
<Action id="actionUndock" cancel="1">
(scrExitScreen gScreen 'forceUndock)
</Action>
</Actions>
</Default>
</Panes>
<Language>
<Text id="actionGate">[G]ate</Text>
<Text id="descWelcome">
You are docked at the center of an alien stargate. These giant structures are
used by the Ancient Races to move their starships across the Galaxy.
Stargates are the best mode of faster-than-light travel and they are the only method known to humans.
</Text>
</Language>
</DockScreen>
We don't need to define actionUndock as we're inheriting from dsDockScreenBase
Each stargate can now use the same dockscreen with dockScreen="&dsStargate;" instead of dockScreen="Main"