[SOLVED] Creating a hidden 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!
Post Reply
OGDA
Posts: 115
Joined: Tue Oct 28, 2014 5:07 pm

[SOLVED] Creating a hidden trapdoor

Post by OGDA »

Hello,

the orginal bug is solved thanks to Skuggasveinn (see 4 posts down).

--------------------------------

Original message:

I've encountered a reproducible bug:

In a forest is a hole (floor of the tile on -7) and a forest_ground_01 over it to hide it. On the same tile is a floor trigger which executes

Code: Select all

function spawnethforest2trapdoor()
	ethpit1 = spawn("dungeon_pit_trapdoor", 4, 15, 22, 0 , 0, "ethpit")
	forest_ground_01_1.model:disable()
	ethpit1.pit:open()
end
to create a trap pit the player can't see before and immediately falls through down to the next level.
Until this point everything works fine.

As soon as you try to save the game after this event, it always crashes.

Image

Here are the source files of the small dungeon with only this event to recreate the bug:

(right click, save as)
https://das-kartell.org/files/Test_Bug.dat
https://das-kartell.org/files/Test_Bug.zip

The bug happens on every try on my computer.

King regards,
Joerg
Last edited by OGDA on Sun Nov 02, 2014 3:39 pm, edited 1 time in total.
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: [BUG-REPRODUCIBLE] Crashes after dyn. trapdoor and savin

Post by Skuggasveinn »

-EDIT , no it crashes when saving :D

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: [BUG-REPRODUCIBLE] Crashes after dyn. trapdoor and savin

Post by Doridion »

Could more modders confirm that bug with trying it ?
GoldenShadowGS
Posts: 168
Joined: Thu Oct 30, 2014 1:56 am

Re: [BUG-REPRODUCIBLE] Crashes after dyn. trapdoor and savin

Post by GoldenShadowGS »

Sort of unrelated. I accidently saved two -- on one of my entity names and didn't realize it and saved the dungeon. The editor wouldn't open dungeon.lua after that. I had to manually scan through it with notepad++ looking for problems when I discovered it. I deleted the two dashes -- and the editor could load it again.

To explain why I did it. I bind keypad - and + to elevation changes for entities. It only works if you haven't clicked on the name field.
Last edited by GoldenShadowGS on Sun Nov 02, 2014 3:05 pm, edited 1 time in total.
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: [BUG-REPRODUCIBLE] Crashes after dyn. trapdoor and savin

Post by Skuggasveinn »

fixed

Code: Select all

function spawnethforest2trapdoor()
	spawn("dungeon_pit_trapdoor", 1, 15, 14, 0 , 0, "ethpit")
	forest_ground_01_1.model:disable()
	ethpit.pit:open()
end
you can not create a local variable that needs to have its state saved. (you created ethpit1 that is a local and then changed it state to open)
you need to be addressing the entity itself.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: [BUG-REPRODUCIBLE] Crashes after dyn. trapdoor and savin

Post by Doridion »

Ok, so classified as a human bug :D ( Joke )
OGDA
Posts: 115
Joined: Tue Oct 28, 2014 5:07 pm

Re: [SOLVED] Creating a hidden trapdoor

Post by OGDA »

Thank you, Skuggasveinn! :)

I've changed the title and orginal post so that other can find this.

Kind regards,
Joerg
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: [SOLVED] Creating a hidden trapdoor

Post by Doridion »

THanks to you, sticked in the superthread as solved bugs ;)
Post Reply