Nystul wrote:
update: managed to get it to work now - although had to use the dummy panel trick as well here - didn't manage to make it work without. resizing the editor window results in correct but delayed position updates - this is not optimal, but right now I don't know how to fix it...
Sorry about that. It looks like I need to rework compass some more to make it more portable. Stick with the temp solution for now.
Nystul wrote:I started implementing making the geometry of the automap independent from the existing geometry in game. I basically make a copy and deactivate the unwanted parts of the gameobject.
Rather than do that, we should use the RDBLayout methods to instantiate a simpler copy of the dungeon. Instantiate map geometry first time user opens map, disable it when not in use, then delete when user transitions to exterior.
RDBLayout can build the dungeon gameobject in stages. Use CreateBaseGameObject() for just the static geometry, then call methods like AddActionDoors() to add the doors. It will be fast because the meshes and textures are already cached. It will also let you create the dungeon how you want and avoid expensive objects (lights, enemies) altogether.
There are currently a few issues with this however. Firstly, the methods have been modified to require a reference to actionLinkDict. This will need to be designed a little differently so the geometry can be loaded independent of actions. Secondly, the RDBLayout methods will try to add serialization properties to some objects, which isn't desirable in this case.
I will quickly fix these issues with RDBLayout methods this morning.
Edit: I have made the following changes to better support you for loading a custom copy of dungeon geometry.
- In RDBLayout methods actionLinkDict is now passed by value instead of reference. It's a Dictionary class, no need to pass as reference, it will be the same collection regardless. This allows you to pass null for actionLinkDict to avoid adding actions to geometry.
- Added a serialize flag to RDBLayout methods. Passing false for this flag will turn off serialization for those game objects supporting it.
- Changed serializable classes to only register/deregister if LoadID != 0. This will avoid exceptions for objects without serialization properties.
Give RDBLayout a shot now and you should be able to build your map geometry quickly and without any of the complications of working with live scene objects.
Let me know if any problems!