Invoke question

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

I think that <Events> do not belong in an item tag. That would most likely be causing the crash.

Place the event in the ship that you are setting the timer on, the sysAddObjRecurringTimerEvent creates a timer that fires an event on the object you refer to as stationCreator- but stationCreator needs the event tag and events to fire.
F50
Fleet Officer
Fleet Officer
Posts: 1004
Joined: Sat Mar 11, 2006 5:25 pm

Periculi is right, no events on an item.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

not quite right there are two events currently on items
OnRefuel (for fuels) and OnShieldDown (for when shields go down)

for the CheckPos event that would need to go on the scStationCreator ship then it would work
Crying is not a proper retort!
Drazalon
Anarchist
Anarchist
Posts: 13
Joined: Thu May 22, 2008 11:52 pm
Contact:

actually this is possible. Just look at the Auton or Navigation Beacon Scripts. You can justify the item &it first, then define the station &st with following events.

Here.

Code: Select all

<TranscendenceModule>

<ItemType UNID="&itNavBeacon;"
	name=				"Nav Beacon"
	level=				"3"
	value=				"300"
	mass=				"300"
	frequency=			"common"
	modifiers=			"Auton; MinorItem"

	description=		"This portable navigation marker can be used to mark a location. It is designed to be retrieved and shifted as necessary."
	>

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

<Invoke>
		(block (auton)
			; Create the auton
			(setq auton
				(sysCreateShip 
					&scNavBeacon;
					(objGetPos gSource)
					&svFriendlyAuton;
					"auton"
					)
				)

			; Escort ship
			(shpOrderHold auton)

			; Welcome message
			(objSendMessage gSource Nil "Navigational beacon online.")

			; Remove the item from the player's list
			(objRemoveItem gSource gItem 1)
		)
	</Invoke>

</ItemType>

<ShipClass UNID="&scNavBeacon;"
		manufacturer=		""
		class=				"Portable Nav Beacon"
		type=				""
		score=				"0"
		techOrder=			"mech"
		attributes=			"auton"
		
		mass=				"2"
		cargoSpace=			"87"
		thrust=				"30"
		maneuver=			"12"
		maxSpeed=			"20"

		dockScreen=			"Main"
		beacon=				"true"

		leavesWreck=		"0"
		rotationCount=		"1"

		>

	<Armor>
		<ArmorSection start="270" span="180" armorID="&itPlasteelPlate;" areaSet="0,2,3,7" />
		<ArmorSection start="90"  span="180" armorID="&itPlasteelPlate;" areaSet="1,4" />
	</Armor>

	<Devices>
	</Devices>
	
	<Items>
		<Item count="1" item="&itNavBeacon;"/>
	</Items>

	<Image imageID="&rsNavBeacon;" imageX="0" imageY="0" imageWidth="64" imageHeight="64" imageFrameCount="2" imageTicksPerFrame="120" flashTicks="3" />

	<AISettings
		fireRateAdj=		"20"
		fireAccuracy=		"80"
		perception=			"4"
		nonCombatant=		"true"
		/>

	<DockScreens>
		<Main
			name=			"Portable Nav Beacon"
			>

			<Panes>
				<Default
						desc="You are docked with a Portable Nav Beacon.">

					<Actions>

						<Action name="Bring Aboard" imageID="&rsItemListScreen;" imageIndex="1" key="B" default="1" >
							(block Nil
								(objAddItem gPlayerShip (itmCreate &itNavBeacon; 1))
								(objDestroy gSource)
								(scrExitDock gScreen)
								)
						</Action>

						<Action name="Undock" imageID="&rsItemListScreen;" imageIndex="0" cancel="1" key="U">
							<Exit/>
						</Action>
					</Actions>
				</Default>
			</Panes>

		</Main>
	</DockScreens>

	<DockingPorts>
		<Port x="0"		y="40" />
		<Port x="0"		y="-40" />
		<Port x="40"	y="0" />
		<Port x="-40"	y="0" />
	</DockingPorts>

</ShipClass>
"If God is the DJ, and Life is the dance floor; Love is the rhythm, and You are the music;flow" -Drazalon
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

What you are showing there is an item (without events) and a station (with events).

Which is a fine example of not putting an event tag in an item tag.
Post Reply