Aller au contenu

Photo

Issue with CreateInstancedAreaFromSource()


  • Veuillez vous connecter pour répondre
Aucune réponse à ce sujet

#1
pseudonymous

pseudonymous
  • Members
  • 3 messages
Back with 1.23 a series of new functions where added, among those was CreateInstancedAreaFromSource() described here http://nwn2forums.bi...&forum=114&sp=0

From this I can derive:

1) DestroyObject( oArea );  should be callable on an area (despite what the documentation inside the toolset says -- My hunch is that the documentation in the toolset reflects the state before patch 1.23 in this regard.)

2)  While the area object should be deallocated, destroying it might/will
also leak objects from that area (since they might be without parents
now)

I'm guessing / hoping that a thorough clean-up script can destroy all
these objects before an actual call to  destroy the area object itself
will deal with this.


My question is this though. I've created an area via CreateInstancedAreaFromSource(), I've transitioned into it and hooked it up back to a normal, non-instanced area. I've also set up a script to run at OnExit which cleans the area of any items/remains/etc before checking a flag whether the area is instanced, and if so, calling DestroyObject on it.

Via a series of SendMessageToPC() I can see that my code takes the branches I'd expect and the call to DestroyObject should indeed happen, but if I later run a method which enumerates the amount of areas by looking at the number of objects with the same tag (I prefix all areas' tags by 'ar_') - it still shows that there's one more instance of the area than before.

Anyone played with this instancing feature ? Anyone got it to work ?