Page 1 of 1

Question to devs: Pit:addTrapDoor and Door:addPullChain

Posted: Mon Nov 12, 2012 3:45 pm
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!

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

Posted: Mon Nov 12, 2012 4:19 pm
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.

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

Posted: Mon Nov 12, 2012 4:22 pm
by Xanathar
Thank you very much!

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

Thanks again

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

Posted: Mon Nov 12, 2012 8:17 pm
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.