What does this mean?

Freeform discussion about anything related to modding Transcendence.
Post Reply
whaleduck
Militia Lieutenant
Militia Lieutenant
Posts: 185
Joined: Tue Jan 01, 2013 3:31 am
Location: Dodging jumpmissiles in a Helion

I'm making a new mod where if a commonwealth station is destroyed, a aquilla class cruiser is sent to kill off the attacker.
Here is the error:

Code: Select all

OnDestroy [Starton Eridani]: Unknown ship class ID [-602299387] ### (sysCreateShip -602299387 (objGetNearestStargate gSource) 4113) ###
And here is the code:

Code: Select all

<?xml version="1.0" ?>
<!DOCTYPE TranscendenceExtension
[
	<!ENTITY unidExtension		    			"0xD0090099">
    <!ENTITY scCommonwealthCruiser                      "0xD0090098">	
    
]>
<TranscendenceExtension UNID="&unidExtension;" version="0.99" name="Avenge">

    <ShipClass UNID="&scAquilaCruiser;"
			manufacturer=		"Pacific Defense Corporation"
			class=				"Aquila"
			type=				"cruiser"
			score=				"2835"

			mass=				"10000"
			cargoSpace=			"1000"
			thrust=				"5000"
			maneuver=			"12"
			maxSpeed=			"16"

			cyberDefenseLevel=	"8"
			explosionType=		"&vtThermoExplosion2;"
			leavesWreck=		"100"

			attributes=			"capitalShip, commonwealth, commonwealthFleet, commonwealthMilitary, genericClass"
			>
        
		<Escorts>
			<Ships>
				<Ship count="8" class="&scBritannia;" orders="escort"  noFriendlyTarget= "true"/>
			</Ships>
		</Escorts>
		
		<Armor>
			<ArmorSection start="345" span="15" armorID="&itP210HexphaseArmor;" />
			<ArmorSection start="330" span="15" armorID="&itP210HexphaseArmor;" />
			<ArmorSection start="315" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="300" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="285" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="270" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="255" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="240" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="225" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="210" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="195" span="15" armorID="&itP210HexphaseArmor;" />
			<ArmorSection start="180" span="15" armorID="&itP210HexphaseArmor;" />

			<ArmorSection start="165" span="15" armorID="&itP210HexphaseArmor;" />
			<ArmorSection start="150" span="15" armorID="&itP210HexphaseArmor;" />
			<ArmorSection start="135" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="120" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="105" span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="90"  span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="75"  span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="60"  span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="45"  span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="30"  span="15" armorID="&itP210HexphaseArmor;" nonCritical="general"/>
			<ArmorSection start="15"  span="15" armorID="&itP210HexphaseArmor;" />
			<ArmorSection start="0"   span="15" armorID="&itP210HexphaseArmor;" />
		</Armor>

		<Devices>
			<Device deviceID="&itStarCannon;" omnidirectional="true"/>
			<Device deviceID="&itStarCannon;" omnidirectional="true"/>
			<Device deviceID="&itNAMIHeavyLauncher;" secondaryWeapon="true" minFireArc="340" maxFireArc="200" posAngle="115" posRadius="50" posZ="0"/>
			<Device deviceID="&itNAMIHeavyLauncher;" secondaryWeapon="true" minFireArc="160" maxFireArc="20" posAngle="245" posRadius="50" posZ="0"/>
			<Device deviceID="&itR9Deflector;"/>
		</Devices>
		

		<Image imageID="&rsLargeShips1;" imageX="1728" imageY="0" imageWidth="192" imageHeight="192" imageFrameCount="0" imageTicksPerFrame="0"/>

		<Items>
			<Item count="40d20" item="&itM5Missile;"/>
		</Items>

		<AISettings
			fireRateAdj=		"20"
			fireAccuracy=		"95"
			perception=			"4"
			combatStyle=		"standOff"
			/>

	</ShipClass>
	
	
(

setq intCommonwealthOnDestroy (lambda Nil
				(block (aquilaCruiser theDestroyer)
					; Destroy items on the station
					(intDestroyItems gSource)

					; Create a corporate cruiser to avenge the station
					(setq aquilaCruiser
						(sysCreateShip &scCommonwealthCruiser;(objGetNearestStargate gSource) &svCommonwealth;;)
						)

					; If someone destroyed the station, avenge
					(setq theDestroyer aOrderGiver)
					(if (and theDestroyer
							(objCanAttack theDestroyer)
							(not (eq (objGetSovereign theDestroyer) &svCommonwealth;;)))
						(block Nil
							(objSendMessage gPlayerShip gSource "Commonwealth station destroyed! Deploy commomwealth avenger!")
							(shpOrderAttack aquilaCruiser theDestroyer)

							; Since the cruiser is busy, deploy some transports to loot the station
							(for i 1 (random 1 3)
								(block (transport)
									(setq transport
										(sysCreateShip &scEI500; (objGetNearestStargate gSource) &svCommonwealth;;)
										)

									(shpOrderLoot transport gSource)
									(shpOrderGate transport)
									)
								)
							)
						)

										
					; Take all the items from the station (so that others won't loot it)
					(shpOrderLoot CommonwealthCruiser gSource)

					; Gate out
					(shpOrderGate CommonwealthCruiser)
					)
				))
</TranscendenceExtension>
(since i am not a programmer i built this on top of some files from the decompiled transcendence.tdb)
User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

Your error:

Code: Select all

OnDestroy [Starton Eridani]: Unknown ship class ID [-602299387] ### (sysCreateShip -602299387 (objGetNearestStargate gSource) 4113) ###
Should be read as:

Code: Select all

Error Message: OnDestroy [Starton Eridani]: Unknown ship class ID [-602299387]
Error Context: ### (sysCreateShip -602299387 (objGetNearestStargate gSource) 4113) ###
So the script engine tries to tell you that
  • it encountered an error.
  • the error occured was that it expected a (recognized) ship class ID, but instead encountered a ship class ID that is Unknown.
  • the error was detected* in the function (sysCreateShip ...)
(* It may happen that an error is detected later than where it was created, but that does not seem the case in with this error.)

So, in your code, there are two instances of the function (sysCreateShip ...), namely:

Code: Select all

(sysCreateShip &scCommonwealthCruiser;(objGetNearestStargate gSource) &svCommonwealth;;)
and

Code: Select all

(sysCreateShip &scEI500; (objGetNearestStargate gSource) &svCommonwealth;;)
I see the following syntax irregularities:

there should be a space between

Code: Select all

&scCommonwealthCruiser;(objGetNearestStargate gSource)
and,
There should be only one ';' at the end of

Code: Select all

&svCommonwealth;;
(your should think of the &...; entities as placeholders for an (internal) number. Since our human brain is notoriously bad at remembering arbitrary large numbers, we invented a system that allows naming those numbers. Each 'named number' has a name that starts with an '&', followed by the name [letters and numbers, but no spaces] and ended by the ';')

But both those irregularities do not seem to creat the error. So, my best guess is, that you did not yet create a ship that is known as '&scCommonwealthCruiser;' (or did not include it yet) and therefore, the script engine complains about an 'Unknown ship ID'.

Good luck,
Pixelfck
Last edited by pixelfck on Mon Jul 29, 2013 3:06 pm, edited 1 time in total.
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de
whaleduck
Militia Lieutenant
Militia Lieutenant
Posts: 185
Joined: Tue Jan 01, 2013 3:31 am
Location: Dodging jumpmissiles in a Helion

Fixed all that. But still isn't sending over an Aquila that will shoot your face off whenever you destroy a Commonwealth station. But there is no error code. (But in the meanwhile this gives me another mod idea :))
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

hi
looks like you are interested to edit intCommonwealthOnDestroy to have an aquila cruiser go after the destroyer of the station.
For that, you don't actually need to override the aquila cruiser (unless you want a special version of it with a new UNID for the revenge pursuit)

so, intCommonwealthOnDestroy is a lamdba function, and a global one too, that must be called by many spaceObj, and as such must stay inside a <Globals>

so, try to wrap your function inside your extension with:
<Globals>
(block Nil ;;always wrap all the functions in your globals with a single block
(setq intCommonwealthOnDestroy (lambda Nil
blah blah

)
</Globals>
whaleduck
Militia Lieutenant
Militia Lieutenant
Posts: 185
Joined: Tue Jan 01, 2013 3:31 am
Location: Dodging jumpmissiles in a Helion

Thanks digdug! When I destroyed Starton Erandi, a Aquilla-class cruiser (and a fleet of Britannias) came over and shot me down.
Post Reply