pushable_block_floor (Solved)
pushable_block_floor (Solved)
Hello
I made pushable_block_floor that can be with light or without light (activated/deactivated)
My Question is how can i check if they are lit or unlit in a script?
I tried it with a counter but it didnt work.
For example. I want a door to open if all 8 pushable_block_floors are with light.
I made pushable_block_floor that can be with light or without light (activated/deactivated)
My Question is how can i check if they are lit or unlit in a script?
I tried it with a counter but it didnt work.
For example. I want a door to open if all 8 pushable_block_floors are with light.
Last edited by Dunkler on Tue Dec 16, 2014 3:17 pm, edited 2 times in total.
Re: pushable_block_floor_trigger
I tried something like this
But since im a scripting noob...i dont know what i am doing wrong
function pushable()
if pushable_block_floor_1.PushableBlockFloor:isActivated() and pushable_block_floor_2.PushableBlockFloor:isActivated() and
pushable_block_floor_3.PushableBlockFloor:isActivated() and pushable_block_floor_4.PushableBlockFloor:isActivated() and
pushable_block_floor_5.PushableBlockFloor:isActivated() and pushable_block_floor_6.PushableBlockFloor:isActivated() and
pushable_block_floor_7.PushableBlockFloor:isActivated() and pushable_block_floor_8.PushableBlockFloor:isActivated() then
dungeon_door_wooden_2.door:open()
else
dungeon_door_wooden_2.door:close()
end
end
i always get an error when i use the script in game. attempt to index field PushableBlockFloor (a nil Value) X
But since im a scripting noob...i dont know what i am doing wrong
function pushable()
if pushable_block_floor_1.PushableBlockFloor:isActivated() and pushable_block_floor_2.PushableBlockFloor:isActivated() and
pushable_block_floor_3.PushableBlockFloor:isActivated() and pushable_block_floor_4.PushableBlockFloor:isActivated() and
pushable_block_floor_5.PushableBlockFloor:isActivated() and pushable_block_floor_6.PushableBlockFloor:isActivated() and
pushable_block_floor_7.PushableBlockFloor:isActivated() and pushable_block_floor_8.PushableBlockFloor:isActivated() then
dungeon_door_wooden_2.door:open()
else
dungeon_door_wooden_2.door:close()
end
end
i always get an error when i use the script in game. attempt to index field PushableBlockFloor (a nil Value) X
- Soaponarope
- Posts: 180
- Joined: Thu Oct 04, 2012 3:21 am
Re: pushable_block_floor
The error is because you want a pushable_block_floor_trigger, they allow for connectors.
Re: pushable_block_floor
I haven't played around with pushable blocks at all, so I can't really provide a solution. But I can point out that in your script:
"PushableBlockFloor" shouldn't have any capitals. Should be:
Code: Select all
pushable_block_floor_1.PushableBlockFloor:isActivated()
Code: Select all
pushable_block_floor_1.pushableblockfloor:isActivated()
Re: pushable_block_floor
I think
is what you want though Scotty's suggestion could also work. I haven't tried it either.
Code: Select all
pushable_block_floor_1.controller:isActivated()
is what you want though Scotty's suggestion could also work. I haven't tried it either.
Last edited by Grimfan on Tue Dec 16, 2014 12:34 pm, edited 1 time in total.
- Soaponarope
- Posts: 180
- Joined: Thu Oct 04, 2012 3:21 am
Re: pushable_block_floor
pushable_block_floor_trigger_1.floortrigger:isActivated()
.pushableblockfloor isn't a valid field
.pushableblockfloor isn't a valid field
Re: pushable_block_floor
If you are using normal floor blocks (the gray ones in the editor) and not the floor block triggers (the gold ones in the editor) then controller is the component you want (since the gray ones don't have a floortrigger component). I first thought you were talking about custom floor blocks you had created so I was slightly confused.
Of course this makes me wonder how you are activating your floor blocks in the first place?
And if you are using gold floor blocks that act like floortriggers just connect them to a counter individually (if you don't want to use a script). Set the counter to 8 and have each floortrigger decrement the counter. When the counter reaches 0 have it activate to open the door.
Also you can wait until a real scripter comes in and sees this thread, hits their forehead in exasperation, and promptly makes me look like a moron.

Of course this makes me wonder how you are activating your floor blocks in the first place?
And if you are using gold floor blocks that act like floortriggers just connect them to a counter individually (if you don't want to use a script). Set the counter to 8 and have each floortrigger decrement the counter. When the counter reaches 0 have it activate to open the door.
Also you can wait until a real scripter comes in and sees this thread, hits their forehead in exasperation, and promptly makes me look like a moron.

- Soaponarope
- Posts: 180
- Joined: Thu Oct 04, 2012 3:21 am
Re: pushable_block_floor
Or I might be confused if he just wants to use the normal floor tiles. In that case the .controller should work. So one of those should do it.
Re: pushable_block_floor
Hello Everyone. Thanks for the help! 
pushable_block_floor_1.controller:isActivated()
works!
And yes your assumption was right. i didnt use the pushable-triggers because the puzzle i tried to make would not work with the triggers.
(the pushable-floors have to activate other nearby pushable floors)
Anyway. The puzzle works perfectly now
@ grimfan i tried to make the puzzle with a counter but it didnt work because the counter does not decrement if a pushable-floor is activated by a nearby pushable-floor.
It only decrements if i activate it directly by steping on it. And thats not what i tried to do.
Or maybe it would work with a counter-but i was just too stupid to do it right

pushable_block_floor_1.controller:isActivated()
works!
And yes your assumption was right. i didnt use the pushable-triggers because the puzzle i tried to make would not work with the triggers.
(the pushable-floors have to activate other nearby pushable floors)
Anyway. The puzzle works perfectly now

@ grimfan i tried to make the puzzle with a counter but it didnt work because the counter does not decrement if a pushable-floor is activated by a nearby pushable-floor.
It only decrements if i activate it directly by steping on it. And thats not what i tried to do.
Or maybe it would work with a counter-but i was just too stupid to do it right

- Halluinoid
- Posts: 165
- Joined: Tue Apr 02, 2013 7:08 pm
- Contact:
Re: pushable_block_floor (Solved)
great info but in my dungeon the team can't even push a block from one pushable tile to the next
the team touch the block, no reaction. what do they do to push the block?
the team touch the block, no reaction. what do they do to push the block?
Beleagured Castle LOGII complete