Spawning a Ship/Station in a Predefined System
Posted: Fri May 20, 2016 2:43 am
The one way I like to do it is to create a virtual station, then use an event to spawn that station.
The idea is that OnGlobalSystemCreated creates a station for each system, then when that station is created it checks if the name of the system is right, then you get to spawn whatever you want using sysCreateShip or sysCreateStation.
The above sample code should produce an Ares Shipyard at Eridani.
The idea is that OnGlobalSystemCreated creates a station for each system, then when that station is created it checks if the name of the system is right, then you get to spawn whatever you want using sysCreateShip or sysCreateStation.
Code: Select all
<StationType UNID="&stVirtualStation;"
name= "Virtual Station"
virtual= "True"
>
<Events>
<OnGlobalSystemCreated>
(block Nil
(sysCreateStation &stVirtualStation; nil)
(if
;(eq (sysGetName) "name of the system you want")
(eq (sysGetName) "Eridani")
(block Nil
;here is where you spawn either a ship or a station
;(sysCreateShip unid pos sovereignID [eventHandler])
;(sysCreateStation unid pos [eventHandler])
(sysCreateStation &stAresShipyard; (sysVectorPolarOffset Nil 0 0))
)
)
)
</OnGlobalSystemCreated>
<Events>
</StationType>