question about a modified pit / trapdoor

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!
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

question about a modified pit / trapdoor

Post by kelly1111 »

Does anyone know how to make a pit that drops the party to another place than the level below that pit?
How would you make such a pit without using a telporter, but with for instance the custom target option that stairs use
is this possible, I cant seem to find the script line in the asset pack.. or are stair and pit behaviors hardcoded?
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: question about a modified pit / trapdoor

Post by zimberzimber »

You can't give pits a custom destination. Your only way is using a teleporter, but only after the party fell to the level below.
You could hack around this by imitating a pit fall, and having an invisible teleporter teleport you to the new detestation as if the party fell from above.

Place a pit object, disable the pit component, have a 7 tile elevation drop, put an invisible teleporter at the bottom, set the teleporters destination to where you want the party to land + 1 elevation.
Something will not work though. Like using ropes, the "AAAH" sound (can still be added with a floor trigger), and the camera facing down while falling.
My asset pack [v1.10]
Features a bit of everything! :D
User avatar
Isaac
Posts: 3188
Joined: Fri Mar 02, 2012 10:02 pm

Re: question about a modified pit / trapdoor

Post by Isaac »

An alternative method [with its own pros&cons] is to place the teleporter above the ceiling on the level below the pit. In this way, the party falls (as usual), but can be made to land just about anywhere you wish.
What's nice about this, is that it uses a pit, but it doesn't have to affect the layout of the level below; the teleporter is above the ceiling... normally impossible to for the party to reach.

Image

[updated] Example Project: https://www.dropbox.com/s/3ct6rol7tpjzb ... t.zip?dl=0

One of the cons [as mentioned above], is rope. Rope bypasses the effect entirely. This could be used as a feature of a puzzle, otherwise it would need to be handled if this was not intended.

***Doesn't yet handle use from attack panel, but I will update it soon, it's late; (it's 5AM here). :shock:
Last edited by Isaac on Wed Jan 11, 2017 1:16 pm, edited 2 times in total.
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: question about a modified pit / trapdoor

Post by zimberzimber »

You could still place a teleporter where the party would appear after using rope.
If the level below has a passage there or something, disable it when the party approaches it from the bottom level, and enable it when the party approaches the pit on the top level.

Automap will still show though.
My asset pack [v1.10]
Features a bit of everything! :D
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

Re: question about a modified pit / trapdoor

Post by kelly1111 »

brilliant, just what I needed. This helps alot.
thanks for the answers
User avatar
Lark
Posts: 178
Joined: Wed Sep 19, 2012 4:23 pm
Location: Springfield, MO USA

Re: question about a modified pit / trapdoor

Post by Lark »

You can also just move the party wherever you want using a script without using a teleporter. Just use party:setPosition(x, y, party.facing, elevation, level) if that would help. I believe that the "fall" could be orchestrated anyway you like, especially if you disabled gravity (party.gravity:disable()) and used party:setWorldPosition(pos) and others - heck, you could even make them fall up with a floor trigger into a shaft above, then slam them sideways into a wall! I'm not sure of the FSP, but I'll bet it could work. Or you can trigger the pit, let the party fall for a fraction of a second via a delayed call to another included function, then move them wherever. Best Regards, -Lark
User avatar
Isaac
Posts: 3188
Joined: Fri Mar 02, 2012 10:02 pm

Re: question about a modified pit / trapdoor

Post by Isaac »

Lark wrote:...I believe that the "fall" could be orchestrated anyway you like...
One thing of note is that using the pit comes with automatically tilted camera and party [falling] sound; using an elevation drop does not. If they are falling, there needs to be a way to detect this. It can be done with hooks or triggered scripts, or a teleporter.

The big problem with floor_triggers and teleporters on the ground below, is that you see the ground approaching before the teleporter or script changes the party's position.
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: question about a modified pit / trapdoor

Post by zimberzimber »

Another thing to note - If you started falling into a pit, you'll just keep falling, regardless of your position. (through floors and such) (At least if you use a teleporter after you fell)
My asset pack [v1.10]
Features a bit of everything! :D
User avatar
Isaac
Posts: 3188
Joined: Fri Mar 02, 2012 10:02 pm

Re: question about a modified pit / trapdoor

Post by Isaac »

zimberzimber wrote:Another thing to note - If you started falling into a pit, you'll just keep falling, regardless of your position. (through floors and such) (At least if you use a teleporter after you fell)
Do you have a clearer example?

(When I try falling into a pit with a teleporter in it, the engine prints a notice that it is "ignoring teleportation -- party falling to level below")
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: question about a modified pit / trapdoor

Post by zimberzimber »

Isaac wrote:
zimberzimber wrote:Another thing to note - If you started falling into a pit, you'll just keep falling, regardless of your position. (through floors and such) (At least if you use a teleporter after you fell)
Do you have a clearer example?

(When I try falling into a pit with a teleporter in it, the engine prints a notice that it is "ignoring teleportation -- party falling to level below")
Before I started working on the asset pack, I recall I wanted to make a pit (that had water in it) and if the player fell into it, they would appear somewhere else. It did work, except the party just kept falling.
Though, ti was a long time ago, maybe one of the patches prevents this from happening.
My asset pack [v1.10]
Features a bit of everything! :D
Post Reply