Question: concerning ships that spawn ships

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Fatboy
Militia Lieutenant
Militia Lieutenant
Posts: 247
Joined: Fri Feb 22, 2008 1:52 am
Location: California

Is it possible to make a ship that spawns ships every 30 seconds or so?

And if so please provide me with the code.
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

yes, i'll put an example code up in a short while.

EDIT:

Code: Select all

<Events>
	<makeship>
		(block (auton)
			; Create the auton
			(setq auton
				(sysCreateShip 
					&scAutoSentinel;
					(objGetPos gSource)
					&svFriendlyAuton;
					"auton"
					)
				)
				
			; Escort ship
			(shpOrderEscort auton gSource)
			
			; Welcome message
			(objSendMessage gPlayerShip glossary "AutoSentinel&#xae; v2.01 online and escorting me")
			)
	<makeship>
	<onCreate>
		(sysAddObjRecurringTimerEvent 900 gSource "makeship")
	</onCreate>  
</Events>		
i have not tested this, at least yet, but putting this on a ship should make it create an autosentinel auton escorting it every 30 secons, the event that creates the ship is started when the ship is created, if the ship goes through a gate, or perhaps if the player does, it may stop working.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

You can use <OnAIUpdate> rather than putting a timer in every system you need to have the effect in.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

just a note the OnAIUpdate is an item event. Only ships with that item (and that are AI) will run that event every 30 ticks. (iirc)
Crying is not a proper retort!
User avatar
Fatboy
Militia Lieutenant
Militia Lieutenant
Posts: 247
Joined: Fri Feb 22, 2008 1:52 am
Location: California

I found 1 error in your code, not much though, <makeship> at the end is supposed to be </makeship>.

It works!

Thanks!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Right, Betel!

Put it on a Carrier Bay and install it on a Carrier Ship and then be sure to give it some charges to track fighters and maybe some code in the event to only launch if the playership is in range...
User avatar
Arisaya
Fleet Admiral
Fleet Admiral
Posts: 5535
Joined: Tue Feb 05, 2008 1:10 am
Location: At the VSS Shipyards in the frontier, designing new ships.

Periculi wrote:Right, Betel!

Put it on a Carrier Bay and install it on a Carrier Ship and then be sure to give it some charges to track fighters and maybe some code in the event to only launch if the playership is in range...
or any target... shouldn't be too hard... :D
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Hmmm... Might want to put that into the Schil Capital Ship, triggered by my version of the ship computer mod.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad
Post Reply