How I got OnObjReconned to work.. yay!

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
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 am boggled about how to get this to work.

What are the steps to ObjRegisterForEvents?

I want to check if the player has recon a stargate in order for the gate to change from an unknown to a known gate.

This entail the recon event triggering to fire a script that changes a local system variable (sysSetData "Gate1" "known")

So how do I get the <OnObjReconned> to fire?

EDIT-

Answer- "Try a something simple."

Code: Select all

<OnCreate>
(block (eventSet)
 	(objRegisterForEvents gSource gSource)
	(staSetFireReconEvent gSource)

)

</OnCreate>

	<OnObjReconned>

	(block Nil
	(objSendMessage gPlayerShip Nil "Fired Recon Event!")
	)

	</OnObjReconned>

</Events>
And that works to change a unknown gate into a known gate, which is perfect. Should I unregister this obj or does it matter? staClearReconFireEvent?

Now how can I get <OnAttackedByPlayer> work? It doesn't seem to do anything with a stargate.. is it due to being immutable or is it the <event>?
Post Reply