I have defined my own door object, and want to set it so that it can trigger an event or object when it is opened.
Is there a way to set up a "blank" connector for a certain trigger in the object definition, that can be later set to a target within the editor?
Setting the Component:addConnector(event, target, action) in the onInit stage seems to require a full definition and I haven't found a way of setting this so that it doesn't do something unwanted while still being valid.
Connectors?
Re: Connectors?
Well, something has to trigger your door to open. Why do you not trigger in the same moment your script?
Re: Connectors?
Sorry, I should probably clarify.
The door is already opened by clicking on it. (thanks Doridion).
I want it to be able to trigger an external secondary event when the door is opened, but I don't want to specify that within the script as I want it to do different things in different areas.
The door is already opened by clicking on it. (thanks Doridion).
I want it to be able to trigger an external secondary event when the door is opened, but I don't want to specify that within the script as I want it to do different things in different areas.
Re: Connectors?
According to the script reference DoorComponents have onOpen and onClose events.
DoorComponent.onOpen(self)
DoorComponent.onClose(self)
DoorComponent.onOpen(self)
DoorComponent.onClose(self)
Links to my YouTube playlist of "tutorials" and to my forum thread.
-
- Posts: 168
- Joined: Thu Oct 30, 2014 1:56 am
Re: Connectors?
You can add connectors by script if they aren't showing up in the editor
or
Code: Select all
door_1.clickable:addConnector("onClick", "yourScript", "yourFunction")
Code: Select all
door_1.clickable:addConnector("onClick", "dungeon_door_2", "open")