Script help

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
evilbob
Militia Captain
Militia Captain
Posts: 555
Joined: Sun Mar 05, 2006 1:23 pm

I've decided to try transcendence scripting, since I've done just about all I can with the basic xml, but I can't get my head around it

Code: Select all

			<OnCreate>
				(if (not (objGetData gSource "MineContract"))
					(block Nil
						(objSetData gSource "MineContract" (sysGetNode))
						)
					)
			</OnCreate>	
		
		<Invoke>
		(if (sysGetNode) (objGetData gSource "MineContract" )
			(block Nil						
			
[Script to use here]
)
)

		</Invoke>
I want this item to, when first created, get the system it was created in, so that when it's used, it will only function in that system.

I have the script it's meant to run working, but the if statement and on create aren't working. I'm sure it's something glaringly obvious, but I know next to nothing of the script and don't know what to do.
Last edited by evilbob on Fri Aug 15, 2008 3:14 pm, edited 1 time in total.
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Unfortunately, <OnCreate> is not supported for items--only for ships and stations (there are too many items--calling OnCreate every time one is created would slow down the game).

Depending on your needs, you might initialize the item only the first time it is used. Or you might set some parameters in the item when the item is given to the player (if there is a station that gives out mining contracts, for example).
Post Reply