Pushable Blocks moving through walls

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
Slayer82
Posts: 303
Joined: Thu Feb 05, 2015 10:19 am

Pushable Blocks moving through walls

Post by Slayer82 »

Hey everyone, someone on Nexus Mods mentioned that during my mod the pushable blocks in the 'Eastern Zhaoze' area are able to move through solid walls and the dungeon wall gratings.
When I play tested the mod, this didn't happen, yet now that I tried it in the dungeon editor this is happening.
I have set up a button outside of the area to activate the pushable block floors, a lever to open a hidden wall to access the area, and another lever to reset the block positions if the player cannot solve the puzzle.
Once solved a mine door spear opens to the south allowing the player to traverse to the Southern Zhaoze.
I am using this script -
SpoilerShow
function enterSouthernZhaoze()
if pushable_block_floor_trigger_9.floortrigger:isActivated() and
pushable_block_floor_trigger_10.floortrigger:isActivated() and
pushable_block_floor_trigger_11.floortrigger:isActivated() and
pushable_block_floor_trigger_12.floortrigger:isActivated() and
pushable_block_floor_trigger_13.floortrigger:isActivated() then
hudPrint("A gate has been opened.")
playSound("gate_open")
castle_door_portcullis_2.door:open()
else
castle_door_portcullis_2.door:close()
end
end

function respawnPushableBlocks()
pushable_block_3:destroy()
pushable_block_4:destroy()
pushable_block_5:destroy()
pushable_block_6:destroy()
pushable_block_7:destroy()
spawn("pushable_block", 6, 4, 3, 3, 0, "pushable_block_3")
spawn("pushable_block", 6, 5, 4, 4, 0, "pushable_block_4")
spawn("pushable_block", 6, 3, 5, 5, 0, "pushable_block_5")
spawn("pushable_block", 6, 6, 5, 6, 0, "pushable_block_6")
spawn("pushable_block", 6, 6, 4, 7, 0, "pushable_block_7")
end
Does anyone know why this is happening now? It wasn't before.
The only thing I can think of is that I installed the patch 2.2.4 during the process of making the mod, but I play tested it and this didn't occur.
Mods - Isle of the Deranged & The Allure of Nightfall
http://grimrock.net/forum/viewtopic.php?f=23&t=9513
viewtopic.php?f=23&t=14762
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Pushable Blocks moving through walls

Post by minmay »

Pushable blocks aren't stopped by DoorComponents. If you want to change this behaviour it should be trivial to redefine the pushable block's onClick hooks to check for DoorComponents and either create a temporary obstacle right before pushing (to get the "blocked" animation) and destroy it right after, or to just not push at all (if you don't want the animation).
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Slayer82
Posts: 303
Joined: Thu Feb 05, 2015 10:19 am

Re: Pushable Blocks moving through walls

Post by Slayer82 »

That makes sense. I was sure that the obstacles were blocking the path of the pushable blocks, though.
This is what happens when you play test a mod without help.
Mods - Isle of the Deranged & The Allure of Nightfall
http://grimrock.net/forum/viewtopic.php?f=23&t=9513
viewtopic.php?f=23&t=14762
Post Reply