Re: LoG2 Editor features and modding
Posted: Sat Nov 01, 2014 2:15 pm
This goes in a script, and each torch_holder needs connected with an onInsertItems, and an onRemoveItems.
(For some reason ther is no 'alwaysActivate' option.)
An alternative method for this is the following:
The feature of this one is that you have to have all three torches inserted or removed, before seeing the result.
This script additionally requires a counter named "torch_counter_1"; initially set to zero (if all holders start with torches).
(For some reason ther is no 'alwaysActivate' option.)
Code: Select all
function deactivateForcefield()
if torch_holder_1.controller:getHasTorch() and
torch_holder_2.controller:getHasTorch() and
torch_holder_3.controller:getHasTorch() then
force_field_1.controller:activate()
else
force_field_1.controller:deactivate()
end
end
Code: Select all
function deactivateForcefield()
if torch_counter_1.counter:getValue() > 2 then --was >=
force_field_1.controller:activate()
elseif torch_counter_1.counter:getValue() < 1 then --was >=
force_field_1.controller:deactivate()
end
end
This script additionally requires a counter named "torch_counter_1"; initially set to zero (if all holders start with torches).