-- Object Path To - allows users to path to this object via the smart object /use command. -- User clicks on this object and will recieve a 'path-to' trigger with the destination specified by this object. -- Created by: Thor Alexander -- Created on: 4/18/2008 -- Listens for these triggers: -- attach() -- detach() -- Broadcasts these triggers: -- path_to(destinationX, destionationY) Define Properties() --- Private Properties --- Parameters use_destination = 0 ExposeProperty('use_destination', 'Path to the specified coordinates instead of the objects position?', 'checkbox') SetPropRange('use_destination', 0, 1) PersistProperty('use_destination') destination_x = 0.0 ExposeProperty('destination_x', 'X coordinate to path to (in worldspace)?') PersistProperty('destination_x') destination_y = 0.0 ExposeProperty('destination_y', 'Y coordinate to path to (in worldspace)?') PersistProperty('destination_y') script_description = 'Path To This' script_long_description = 'Avatars will path towards this object when it is clicked on' end -- Commands -- Triggers Trigger use(user_object, ...) Debug("in use for %s from %s", self.name, user_object.name) if self.use_destination == 1 then xPos = self.destination_x yPos = self.destination_y else xPos = self.x yPos = self.y end SendTo(user_object, 'path_to', 0, xPos, yPos, 0) end