Question to devs: Pit:addTrapDoor and Door:addPullChain

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Question to devs: Pit:addTrapDoor and Door:addPullChain

Post by Xanathar »

Hi,
The docs for Pit:addTrapDoor and Door:addPullChain functions say:
This function is intended to be used internally by the editor. Do not attempt to add a XXX dynamically to a YYY from a script because it may cause problems with save games. This function is listed here only for completeness.
Sadly they would be useful functions for things like on-the-fly generated dungeons or similar situations (and, I won't hide the fact, my treasure chests :lol: ).

The questions are:
  • Is the warning still valid ? I know you have changed many things regarding what's saved and what not and how and I was wondering if this is still the case
  • Are they safe to use one-time in a scripting entity outside of any function scope (that is, the code that is auto-run at first startup) ? I ask because this seem to be about the same time dungeon.lua is executed, but you know the details
Thank you very much in advance!
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Question to devs: Pit:addTrapDoor and Door:addPullChain

Post by antti »

Petri thinks that they should work with save games now but he's not 100% certain.

You probably can try them out by adding a pullchain/trapdoor in level script and then seeing if they persist between saving and loading the game.
Steven Seagal of gaming industry
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Question to devs: Pit:addTrapDoor and Door:addPullChain

Post by Xanathar »

Thank you very much!

Will try and post the result here so that everyone will be informed for the future.

Thanks again
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Question to devs: Pit:addTrapDoor and Door:addPullChain

Post by Xanathar »

They work ok and survive save/load well, even if activated outside the "autorun" path (for testing I've attached the addPullChain call to a wall_button and it worked).

However, pits spawned at runtime show the original floor until a save/reload cycle is done.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
Post Reply