Page 1 of 1

Script problem- objGateTo

Posted: Fri Nov 09, 2007 2:34 am
by Periculi
What am I missing with this?

This is on a navbeacon that gets created from a player item-

Code: Select all

<OnCreate>
				(block (beaconSys)
					(objSetGlobalData gPlayership "beaconSys" (sysGetName gSource))

				)

				(block (beaconNode) 
					(objSetGlobalData gPlayership "beaconNode" (sysGetNode gSource))
				)

				(block (beaconGate)
					(objSetGlobalData gPlayership "beaconGate" (sysGetNearestStargate gSource))

				)

				</OnCreate>
And then something like this in the jump drive-

Code: Select all

		<Invoke key="J" installedOnly="true">
		(switch
			; If we are on top of a stargate, then jump to Elysium
			(leq (objGetDistance gSource (objGetNearestStargate gSource)) 3)
				(objGateTo gSource "Elysium" "Start" &efStargateOut;)

			; Otherwise, we jump
			
			(block (newPos newNode)
				(setq newPos (objGetGlobalData gPlayership "beaconGate"))
				
				(setq newNode (objGetGlobalData gPlayership "beaconNode"))
			

				(objGateTo gSource newNode newPos &efStargateOut;)
				)
			)
	</Invoke>

But it said Identifier expected What does that mean?

Posted: Fri Nov 09, 2007 4:25 am
by george moromisato
A few ideas:

1. <OnCreate> expects a single expression--you've got three separate (block ...) expression.
2. (sysGetNode) does not take any parameters.
3. (sysGetName) does not take any parameters.
4. It's (objGetNearestStargate...), since your are trying to find the nearest stargate to some object.

Try:

Code: Select all

<OnCreate> 
   (block (beaconSys beaconNode beaconGate) 
      (objSetGlobalData gPlayership "beaconSys" (sysGetName)) 
      (objSetGlobalData gPlayership "beaconNode" (sysGetNode)) 
      (objSetGlobalData gPlayership "beaconGate" (objGetNearestStargate gSource)) 
      ) 
</OnCreate> 
Good luck!

Posted: Fri Nov 09, 2007 5:15 am
by Periculi
Thanks for the help!

I got a new error- Identifier expected: 47648776 <-- it never had that number before. :) Can I use newNode and newPos in the objGateTo function?