[SOLVED] Fall into teleporter => floor_trigger not activated

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
User avatar
Zo Kath Ra
Posts: 944
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

[SOLVED] Fall into teleporter => floor_trigger not activated

Post by Zo Kath Ra »

Let there be a test dungeon with a floor_trigger at:
elevation = 1

Let there also be a teleporter at:
elevation = 0

The teleporter's destination are the floor_trigger's coordinates.

When the party walks into the teleporter from elevation 0, the floor_trigger is activated.
But when the party falls into the teleporter from elevation 1, the floor_trigger isn't activated.
Last edited by Zo Kath Ra on Thu May 28, 2015 3:09 pm, edited 1 time in total.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Bug: Falling into teleporter doesn't activate floor_trig

Post by Komag »

This might be related to the old Grimrock 1 "bug" of not teleporting when falling into a teleporter, at least it sounds kind of similar. I suppose you could always script it to forcibly work if necessary.
Finished Dungeons - complete mods to play
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: Bug: Falling into teleporter doesn't activate floor_trig

Post by Azel »

What about if the party falls in to the Teleporter from Elevation 2? I bet the trigger activates!

(i have not tested this yet)
User avatar
Zo Kath Ra
Posts: 944
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Bug: Falling into teleporter doesn't activate floor_trig

Post by Zo Kath Ra »

Azel wrote:What about if the party falls in to the Teleporter from Elevation 2? I bet the trigger activates!

(i have not tested this yet)
Nice idea :)
But that doesn't work, either :(
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: Bug: Falling into teleporter doesn't activate floor_trig

Post by Azel »

Invisible platform under the the Trigger, which gets removed as the last step after the trigger fires. That'll teach the greedy Teleporter a lesson :mrgreen:
User avatar
st1nger
Posts: 19
Joined: Wed May 29, 2013 8:44 pm
Location: Germany

Re: Bug: Falling into teleporter doesn't activate floor_trig

Post by st1nger »

hi

The trigger works fine, It is the teleporter what does not work.
The teleporter checks only horizontal axes/faces not vertical.

you have to script the teleportation yourself i think.
I think about a solution. That makes me curious
User avatar
st1nger
Posts: 19
Joined: Wed May 29, 2013 8:44 pm
Location: Germany

Re: Bug: Falling into teleporter doesn't activate floor_trig

Post by st1nger »

so thats my example for an solution.
not perfect, but it works.

Code: Select all

defineObject{
	name = "party",
	baseObject = "party",
	components = {
		{
			class = "Timer",
			name = "falltimer",
			timerInterval = 0,
			triggerOnStart = true,
			onActivate = function(self)
				if party.party:isFalling() == true then
					local ent
					local tp
					local tppos
					for ent in party.map:entitiesAt(party.x, party.y) do
						local checktp = ent:getComponent("teleporter")
						if checktp ~= nil then
							tppos = ent:getWorldPositionY()
							tp = checktp
						end
					end
					if tp ~= nil and tp:getTriggeredByParty() == true then
						local x = tppos + 2
						if party:getWorldPositionY() < x then
							local l,x,y,z = tp:getTeleportTarget(l,x,y,z)
							local x1, y1, f, l1 = party:getPosition()
							party:setPosition(x, y, f, z, l)
							spawn("teleportation_effect", l, x, y, f, z)
							party.gravity:setFallingSpeed(0)
						end
					end
				end
			end
		}
	}
}
User avatar
Zo Kath Ra
Posts: 944
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Bug: Falling into teleporter doesn't activate floor_trig

Post by Zo Kath Ra »

Thank you, that works very well :)
User avatar
st1nger
Posts: 19
Joined: Wed May 29, 2013 8:44 pm
Location: Germany

Re: Bug: Falling into teleporter doesn't activate floor_trig

Post by st1nger »

when it works mark the topic with [SOLVED] please for other people with this problem.
like this for example: [SOLVED] Falling into teleporter doesn't work
User avatar
Zo Kath Ra
Posts: 944
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Bug: Falling into teleporter doesn't activate floor_trig

Post by Zo Kath Ra »

st1nger wrote:when it works mark the topic with [SOLVED] please for other people with this problem.
like this for example: [SOLVED] Falling into teleporter doesn't work
Done. Had to change the topic title a little, because [SOLVED] didn't fit into it anymore.
Post Reply