[Solved] Make Teleporter Move in Unison with Pushable Block

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
cfisher2833
Posts: 11
Joined: Sat Oct 18, 2014 9:14 pm

[Solved] Make Teleporter Move in Unison with Pushable Block

Post by cfisher2833 »

Okay, so for the puzzle I am working on I am trying to make it so that a teleporter above a pushable block moves in unison with the block--similar to that one puzzle in the game where you push the blocks to create a bridge that you can throw stuff from. Anyone have any idea how I would make this work? Is it something special to bridges or will the teleporter work? Or is it something that would require deeper level tools than the scripting function?
Last edited by cfisher2833 on Tue Oct 28, 2014 11:12 pm, edited 1 time in total.
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: How to Make Teleporter Move in Unison with Pushable Bloc

Post by Prozail »

Once solution is to create the pushable block and floor, and place a teleporter above it.
then place a scriptcomponent next to the whole thing, and register the onclick hooks for each side.

something like this.

(my teleporter is named pushable_teleporter, it's not a new definition)

Code: Select all

pushable_block_1.clickWest:addConnector("onClick", "script_entity_1", "moveblock")
pushable_block_1.clickNorth:addConnector("onClick", "script_entity_1", "moveblock")
pushable_block_1.clickEast:addConnector("onClick", "script_entity_1", "moveblock")
pushable_block_1.clickSouth:addConnector("onClick", "script_entity_1", "moveblock")

function moveblock()
	pushable_teleporter.particle:disable()	
	pushable_teleporter.light:disable()	
	delayedCall(self.go.id, 1.2, "moveteleporter")
end

function moveteleporter()
	pushable_teleporter:setPosition(pushable_block_1.x,pushable_block_1.y,pushable_block_1.facing,1,pushable_block_1.level)
	pushable_teleporter.particle:enable()	
	pushable_teleporter.light:enable()	
end
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: How to Make Teleporter Move in Unison with Pushable Bloc

Post by Grimfan »

One important thing to note is that you can't stand on pushable blocks. You'll just fall through them, so you are going to need a bridge or platform of some sort above them.
User avatar
Jouki
Posts: 127
Joined: Fri Oct 24, 2014 12:57 pm

Re: How to Make Teleporter Move in Unison with Pushable Bloc

Post by Jouki »

Grimfan wrote:One important thing to note is that you can't stand on pushable blocks. You'll just fall through them, so you are going to need a bridge or platform of some sort above them.
could invisible wall solve this?
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: How to Make Teleporter Move in Unison with Pushable Bloc

Post by Grimfan »

An invisible platform would do it since it's basically just a magic bridge with a few things removed. I think it was pretty much intended for purposes like this.
cfisher2833
Posts: 11
Joined: Sat Oct 18, 2014 9:14 pm

Re: How to Make Teleporter Move in Unison with Pushable Bloc

Post by cfisher2833 »

I think I may have found a simpler solution. I am gonna have activated pushable block floor triggers all over which, when toggled by the block, simply turn on the teleporter above it, with the teleporter only staying on so long as the movable block is beneath it. Hope it works. If not, I'll definitely give that script a try. Thanks

The idea for the puzzle is to have a spectral relay puzzle where you have to move the blocks to get the blob around obstacles.
Last edited by cfisher2833 on Tue Oct 28, 2014 11:16 pm, edited 2 times in total.
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: How to Make Teleporter Move in Unison with Pushable Bloc

Post by Prozail »

But it was a cool concept...

inspired me to do this http://www.youtube.com/watch?v=h0kXGokaLpo

:)
cfisher2833
Posts: 11
Joined: Sat Oct 18, 2014 9:14 pm

Re: How to Make Teleporter Move in Unison with Pushable Bloc

Post by cfisher2833 »

Prozail wrote:But it was a cool concept...

inspired me to do this http://www.youtube.com/watch?v=h0kXGokaLpo

:)
Yeah, I like how you did it. Using a script seems like a hell of a lot more efficient than the way I did it (where every block floor trigger activates a teleporter above it when the block is on it), but I figured it would be a fairly complex script to work as intended.

btw, I think this should be added a puzzle compendium or something. There's a lot of great puzzles to be made using this method.
Post Reply