Re: [Mod] Minimap WIP
Posted: Mon May 03, 2021 9:38 pm
No, there is no direct way to use the automap and have it update too.
The automap outside is completely created from scratch as it's own mesh that is placed under the ground/out of site. From there, when ever you open the minimap, it runs through a ton of code to compute everything and rebuild the mesh, and then creates the render texture, the automap camera that shoots its viewpoint to the render texture, and then renders it on your display and pauses the game to stop any bugs with cameras while in automap.
The automap inside uses the 3d model of the interior, but the moment you enable it without pausing, it causes the player to start flying into the black void. This again is because of how the camera system creates and assigns a second camera of automapping. So, because it isn't paused, it causes tons of camera/player bugs.
Point being, because the render texture and camera are created on the fly, when the map is opened, I cannot use either of those properties/objects. I also I can't continually push the automap update without causing more movement bugs/issues. I just tried, and pushing it with pausing off causes the player to lock in places, since now you're tied to the automap camera and not main camera.
For the NPC idea, that makes perfect sense, and what I was thinking. I didn't know where to look for the NPC data, but I'll starting digging into streaming assets.
As for the buildings, I am so close. I only need to get the RMB Block position property, so I can know where the specific exterior block is in the unity world space coordinate system. Anyone else have any ideas on how to get the block position or, if there is a method to get the building position data translated into the unity 3d space position? I've been digging through the block generation data, and I have got all the way to being able to grab all buildings in a block, grab all exterior blocks around me, filter for only special buildings like taverns, and pull building position within the block. I just can't figure out how the RMB block ulong positions are being translated into unity 3d space positions for placement. I've tried copying a number of position formulas within the differing model placement scripts, but I'm still not finding the correct output/ way to do this.
The automap outside is completely created from scratch as it's own mesh that is placed under the ground/out of site. From there, when ever you open the minimap, it runs through a ton of code to compute everything and rebuild the mesh, and then creates the render texture, the automap camera that shoots its viewpoint to the render texture, and then renders it on your display and pauses the game to stop any bugs with cameras while in automap.
The automap inside uses the 3d model of the interior, but the moment you enable it without pausing, it causes the player to start flying into the black void. This again is because of how the camera system creates and assigns a second camera of automapping. So, because it isn't paused, it causes tons of camera/player bugs.
Point being, because the render texture and camera are created on the fly, when the map is opened, I cannot use either of those properties/objects. I also I can't continually push the automap update without causing more movement bugs/issues. I just tried, and pushing it with pausing off causes the player to lock in places, since now you're tied to the automap camera and not main camera.
For the NPC idea, that makes perfect sense, and what I was thinking. I didn't know where to look for the NPC data, but I'll starting digging into streaming assets.
As for the buildings, I am so close. I only need to get the RMB Block position property, so I can know where the specific exterior block is in the unity world space coordinate system. Anyone else have any ideas on how to get the block position or, if there is a method to get the building position data translated into the unity 3d space position? I've been digging through the block generation data, and I have got all the way to being able to grab all buildings in a block, grab all exterior blocks around me, filter for only special buildings like taverns, and pull building position within the block. I just can't figure out how the RMB block ulong positions are being translated into unity 3d space positions for placement. I've tried copying a number of position formulas within the differing model placement scripts, but I'm still not finding the correct output/ way to do this.