NPC Ships In-Game?

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Aeonic
Militia Commander
Militia Commander
Posts: 469
Joined: Sun Jun 14, 2009 1:05 am
Location: Designing his dream ship.

What exactly do you have to do to get newly created friendly or enemy ships to show up in the game? I'd be much more inclined to make them if I knew how to get them to show up.
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.
Image
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Well ships are generally associated with stations so you need to have a station for it to belong too. There are many you can overwrite and just add your ship to its ships. Then all you would have to do is play the game and find the station and you will see if it worked. (if you make it random you might have to find more than one of those stations)

You can also create ships from in script using sysCreateShip.
Crying is not a proper retort!
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.

For scripted appearance ships (ie, missions), yes, you need an event to trigger (such as onCreate, onDestroy, or onInvoke, (for things like autons)).

However, for ships that appear around stations, you can simply add your ship to that stations:
<Ships>
<Reinforcements>
<Encounters>
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
User avatar
Aeonic
Militia Commander
Militia Commander
Posts: 469
Joined: Sun Jun 14, 2009 1:05 am
Location: Designing his dream ship.

What about things like raider platforms or scavengers?? How do those work?
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.
Image
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.

Aeonic wrote:What about things like raider platforms or scavengers?? How do those work?
You can see how both work in the "encountersVol01.xml" file: the raider platforms/ranx dreadnoughts/tripoli's are all given the order="wander"

The scavenger is given the order="scavenge"

List of ship orders:
traderoute
scavenge
wander
patrol (+ patrol radius) (+ target, not for stations)
guard (+ target, not for stations)
gateonthreat
escort (NOT for stations) (+ target)
gate (kinda dumb to use with stations, since they will gate out immediately)
wait (not really useful with stations, as they sit in the gate)
attack (+ target, unless used at a station, in which case it auto-defaults to the player's ship as the target)
dock (+ target) (I am not sure it works with stations)
loot (+ target) (I am not sure it works with stations)

When I say something may/maynot work with a station, I mean in its ships/reinforcements/encounters tabs, NOT its events, as you can use any of these in the event scripts.
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
User avatar
Prophet
Militia Captain
Militia Captain
Posts: 826
Joined: Tue Nov 18, 2008 6:09 pm

If you just want to test them out to try installing something like this on the ship you use for testing,

Code: Select all

    <ItemType UNID="&itHangar;"
		name=				"MiniFighter Hangar"
		level=				"2"
		value=				"2000"
		mass=				"5000"
		frequency=			"uncommon"
		numberAppearing=	"1"
		modifiers=			"MajorItem; Auton"

		description=  "This is a hangar bay for fighters."

		sortName=			"hangar"
		>

	<Image imageID="&rsItems1;" imageX="96" imageY="192" imageWidth="96" imageHeight="96"/>

	<CargoHoldDevice
			cargoSpace=		"100"
			/>
			
	<Invoke key="L" installedOnly="true">
        (block Nil
            (setq ftr (sysCreateShip
            
            ;; change this to the ship UNID you want to test
            &scRanxDreadnought;
            
            gSource &svPlayer; "Fleet"))
            (shpOrderEscort ftr gPlayerShip (random 10-20))
            )
	</Invoke>
	
</ItemType>
you will have to install it as a device and change scRanxDreadnought with the unid of the ship you want to test, and then you can spawn as many as you want as wingmen!
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Also, the GOD mod can spawn ships I think.
[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
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.

schilcote wrote:Also, the GOD mod can spawn ships I think.
yes, it can do that.
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Aeonic wrote:What about things like raider platforms or scavengers?? How do those work?
They work just like every other ship in the game, but sometimes the 'station' that is in charge of the spawns is actually disguised as something else. You can have an asteroid spawning ships if you like.

You aren't restricted to having a ship spawn from a station, either. You can add them to the game with script, if you want to.

The stations are simply the easiest mechanism to get ships to spawn in star systems without scripting them.

The only real oddball in the mix is the CSC which is a special ship-station hybrid combination that requires both elements to function correctly.
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:
Aeonic wrote:What about things like raider platforms or scavengers?? How do those work?
They work just like every other ship in the game, but sometimes the 'station' that is in charge of the spawns is actually disguised as something else. You can have an asteroid spawning ships if you like.

You aren't restricted to having a ship spawn from a station, either. You can add them to the game with script, if you want to.

The stations are simply the easiest mechanism to get ships to spawn in star systems without scripting them.

The only real oddball in the mix is the CSC which is a special ship-station hybrid combination that requires both elements to function correctly.
Well the CSC is not that difficult really: it's basically a ship spawned by an encounter, and you could essentially equate it with a really advanced version of the mule, xml-wise.
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
Post Reply