weight alcove
Posted: Sun Jan 04, 2015 12:09 pm
Hello there,
I post this here, because TheLastOrder asked if it can be used in log2:
(original thread in log1 forum: viewtopic.php?f=14&t=6667)
I made a small modification, based on a script that minmay gives me.
There is still an issue, sorry but this comes at a point where I am lost
if you put a stack of (stackable) items it won't work.
e.g: if you put a stack of 12 shuriken (0,1kg each, for the alcw3 or alcw4)
It works only if you put the shurikens one by one.
I suppose it is because it has to count the items if there is stackable items.
I just think of that because Minmay gives me a script for a forge system, which check and count the stackable items.
I post this here, because TheLastOrder asked if it can be used in log2:
(original thread in log1 forum: viewtopic.php?f=14&t=6667)
I made a small modification, based on a script that minmay gives me.
There is still an issue, sorry but this comes at a point where I am lost

if you put a stack of (stackable) items it won't work.
e.g: if you put a stack of 12 shuriken (0,1kg each, for the alcw3 or alcw4)
It works only if you put the shurikens one by one.
I suppose it is because it has to count the items if there is stackable items.
I just think of that because Minmay gives me a script for a forge system, which check and count the stackable items.
SpoilerShow
Code: Select all
weight = 0
weight2 = 0
weight3 = 0
weight4 = 0
finish = 0
function weightcheck(surface, item)
if finish == 0 then
weight = 0
weight2 = 0
weight3 = 0
weight4 = 0
for _,i in alcw1.surface:contents() do
weight = weight + i:getWeight()
end
for _,j in alcw2.surface:contents() do
weight2 = weight2 + j:getWeight()
end
for _,k in alcw3.surface:contents() do
weight3 = weight3 + k:getWeight()
end
for _,l in alcw4.surface:contents() do
weight4 = weight4 + l:getWeight()
end
check()
end
end
function check()
if finish == 0 then
if weight == 0.1 and
weight2 == 0.2 and
weight3 == 1.2 and
weight4 == 1.2 then
iron_weight.door:open()
playSound("secret")
finish = 1
else
iron_weight.door:close()
end
end
end