Script problem- objGateTo

These are old bug reports that have been closed.
Locked
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 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?
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

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!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

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?
Locked