Spawn Button / Lever connected to Door
Posted: Wed Sep 19, 2012 2:34 pm
Is there any way how to connect my spawned Button or Lever (in the script ewntity) with the door?
I am missing some hook on Button entity like "onActivate = function(self)......"
I need spawn some buttons "on-the-fly" in my script entity (after activate pressure plate) and these must be active - connected to doors.
- Or eventually How to I remove entity (button/lever) created by editor
- Or eventually How to I hide entity (button/lever) created by editor
- Or eventually How to I move entity (to wall) or change its facing
Thanks for answer.
I am missing some hook on Button entity like "onActivate = function(self)......"
I need spawn some buttons "on-the-fly" in my script entity (after activate pressure plate) and these must be active - connected to doors.
- Or eventually How to I remove entity (button/lever) created by editor
- Or eventually How to I hide entity (button/lever) created by editor
- Or eventually How to I move entity (to wall) or change its facing
Code: Select all
-- first: clone new custom button in the objects.lua
cloneObject{
name = "Custom_wall_button",
baseObject = "wall_button",
-- need the onActivate hook
}
-- next in the lua script entity
function ActivatePressurePlate()
spawn("Custom_wall_button", 1, 10, 21, 2, "MyWallbutton1")
-- is there any way to connect MyWallbutton1 to the door?
end