How do I make a device that...
- digdug
- Fleet Admiral
- Posts: 2620
- Joined: Mon Oct 29, 2007 9:23 pm
- Location: Decoding hieroglyphics on Tan-Ru-Dorem
put in the <Invoke> of the device a sysCreateShip function.
SysCreateShip is flexible enough to choose the location, sovereign and eventually the controller of the ships spawned.
Here the syntax on how to use the function:
http://xelerus.de/index.php?s=functions&function=249
SysCreateShip is flexible enough to choose the location, sovereign and eventually the controller of the ships spawned.
Here the syntax on how to use the function:
http://xelerus.de/index.php?s=functions&function=249
you mean like this:
this code spawns a wingman ship for the player, on top of them. It also requires a device with "hangar" as a modifier
this code spawns a wingman ship for the player, on top of them. It also requires a device with "hangar" as a modifier
Code: Select all
(switch
; If we don't have a Hangar
(not (objGetItems gSource "*I+Hangar"))
(objSendMessage gSource Nil "Hardware not avaliable")
; If we don't have enough credits
(setq gCost 50)
(switch
(gr gCost (plyGetCredits gPlayer))
(objSendMessage gSource Nil "Resources not avaliable")
(block (ship)
(setq ship (sysCreateShip &scWasp; gPlayerShip &svCommonwealth; "fleet"))
(shpOrderEscort ship gPlayerShip 15)
)
(plyCredit gPlayer -50))
; Identify the item
(itmSetKnown gItem))
</Invoke>