I cannot seem to get these to work:
BrainComponent:operate(string)
BrainComponent:openLockWith(string, string)
When it refers to "string" I assume its an ID of an object on the same floor. Makes sense since the goTo() command is working like this. For openLockWithKey() I assume its a lock ID and then a key ID. For operate() I have tried button and lever IDs.
Using herders, skeleton_trooper and trickster, neither of these commands seem to work. I make the mob goto to the square where the ID is. When he is there, I call the operate command but he just does a few turns and that's it. Here is my code:
Code: Select all
function setThinking(go)
go.brain:addConnector('onThink',self.go.id,'thinkHook')
go.brain:addConnector('onThinkSpecial',self.go.id,'thinkHookSpecial')
print("Brained")
end
function thinkHook(p)
--print("In thinkHook", self.go.id, p.id)
local br = p.go.brain
if p.go.x == 12 and p.go.y == 9 then
print("doing operate")
br:openLockWith("lock_1", "blue_key")
--br:operate("castle_wall_lever_1")
else
br:goTo("floor_trigger_2")
end
--[[
local b = br:here("floor_trigger_2")
if b == true then
print("At trigger")
end
b = br:here("blue_key_1")
if b == true then
print("At blue key")
end
]]--
--br:goTo("party")
end
function thinkHookSpecial(p)
--print("In thinkHook special", self.go.id, p.id)
local br = p.go.brain
--[[
if p.go.x == 12 and p.go.y == 9 then
print("doing operate")
--br:openLockWith("lock_1", "blue_key")
br:operate("castle_wall_lever_1")
else
br:goTo("floor_trigger_2")
end
]]--
end
setThinking(herder_1)
Any help you can give on these would be great. Thanks.