Truespace Script Custom Event

OnCustomEvent

For some special situations you may need to define custom communication between your objects.
Use RsApp.SendCustomEvent method to send an event and implement OnCustomEvent to handle the
event.

function OnCustomEvent(params)
{
	var eventData = params.Param('vtEventData');
	System.Trace(eventData)
}
RsApp.SendCustomEvent(Space.CurrentScene() + "/target", "hello")

It should be possible to send an event to one object and have it relay to all items in a scene making interface type behaviors – todo test this theory

Custom events seem to run in the scope of the calling function shown by running System.Trace(System.ThisName()); or System.Trace(System.ThisOwner();.

It’s possible to pass Command script access to object nodes by passing things like Node and RsTime in the event arguments.

RsApp.SendCustomEvent(Space.CurrentScene() + "/target", {Node:Node, RsTime:RsTime})

Leave a Reply

Your email address will not be published.