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