How do I make a device that...

Freeform discussion about anything related to modding Transcendence.
Post Reply
BienM
Miner
Miner
Posts: 31
Joined: Thu Mar 06, 2008 1:19 pm

...allows me to spawn a ship, of which kind, choose the amount of ships spawned, and if it is hostile or not.
User avatar
digdug
Fleet Admiral
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
BienM
Miner
Miner
Posts: 31
Joined: Thu Mar 06, 2008 1:19 pm

Do you have an example? Because I'm still stumped on how to use it.
User avatar
evilbob
Militia Captain
Militia Captain
Posts: 555
Joined: Sun Mar 05, 2006 1:23 pm

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

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>
Post Reply