BugsbyBearkeley Posted March 12, 2017 Share Posted March 12, 2017 I want to make a script that uses "GetFirstRefInCell" to scan a cell for both persistent and temporary references as soon as a player enters an adjacent one, but this seems to require that the cell being scanned is loaded into memory. Does that only happen when the player enters the cell for the first time in a session? Or can cells be preloaded? Link to comment Share on other sites More sharing options...
QQuix Posted March 12, 2017 Share Posted March 12, 2017 (edited) Cells are loaded as you enter them (that is what is happening behind the properly named 'Load Screen') Cells left behind remain in memory as long as the engine does not need the memory they occupy. This way, cells are loaded not only when the player enters them for the first time, but may need to be loaded every time the player enters them, if the engine reclaimed their memory. According to a report long ago, in low memory systems, not even the last cell visited remains in memory, so you cannot take it for granted. I am not aware of any way to preload cells. Edited March 12, 2017 by QQuix Link to comment Share on other sites More sharing options...
BugsbyBearkeley Posted March 12, 2017 Author Share Posted March 12, 2017 That pretty much scraps the mod I'm working on. Is it correct then that there's no way to get temporary reference info from unloaded cells? I would need reference IDs and position/rotation. Link to comment Share on other sites More sharing options...
QQuix Posted March 12, 2017 Share Posted March 12, 2017 The only way I can think of (and it is UGLY) is to move the player there for a frame, collect the data and move him back. But the visual side effects are BAD: a second Load Screen, a flicker of the screen for a split second and a (low) risk of another load screen on the way back.Even worse if you have a number of adjacent rooms and need to map every one. Besides that , moving the player is tricky and may crash the game under certain circumstances. Link to comment Share on other sites More sharing options...
BugsbyBearkeley Posted March 13, 2017 Author Share Posted March 13, 2017 Yeah that wouldn't work very well. At this point I think I'm going to give up, but just for the sake of curiosity - there's two things I can think of that would still work for me. Either:1. having an exterior cell with the same formID as a vanilla interior, or2. somehow getting a terrain heightmap inside an interior cell So far when I tried these they either did nothing or crashed the game on load (but I don't remember what did which). Link to comment Share on other sites More sharing options...
QQuix Posted March 13, 2017 Share Posted March 13, 2017 Duplicate formIDs are not expected by the engine and, most likely, will cause problems. Just occurred to me something I did in the past for mapping non-movable references: you could create an work ESP, visit the cells, write the info to a text file and read that file in your mod before entering the cell. But I suppose you are after actors and not statics, so not a helpful idea either. Link to comment Share on other sites More sharing options...
BugsbyBearkeley Posted March 13, 2017 Author Share Posted March 13, 2017 Actually I am interested in statics, but scanning cells would have been for runtime compatibility adjustments, so it would concern cells that were changed by other mods that I don't know about. The mod this was going to be a part of was meant to be an alternative to Immersive Interiors, but instead of using piecemeal meshes like II it would create new worldspaces with terrain maps for each interior like this. Advantages being that it's better looking, less performance heavy, and a lot quicker to make, but of course it's incompatible with almost everything. I was thinking about fixing this with a script that would run when the player enters the new cell. All vanilla objects from the original interiors would be moved and repositioned, so the original interiors would be empty if the player wasn't using any conflicting mods. Scanning unloaded cells would serve the purpose of checking the original interiors for remaining objects that could then be moved into the new exterior cells. I could probably crank compatibility patches out with a TES4edit script but I'd prefer something better than that. Link to comment Share on other sites More sharing options...
QQuix Posted March 14, 2017 Share Posted March 14, 2017 Any reason to do it from the previous cell? Why not use GetCellChanged and do all your checking and adjustments the very first frame when the player enters a new cell? Link to comment Share on other sites More sharing options...
BugsbyBearkeley Posted March 14, 2017 Author Share Posted March 14, 2017 I don't think we're on the same page. The player would never enter the vanilla interior cell. Instead, he goes through the front door of a building and ends up in a new worldspace that mimics the original interior, so the original interior never gets loaded into memory. Like this: Building in the vanilla game:Tamriel worldspace <-(door)-> interior cell Same building in my mod:Tamriel worldspace <-(door)-> new worldspace with copy of interior cell <-(NPC door)-> original interior cell Why a new worldspace? Because the point of the mod is to be able to look out of house windows and see the surrounding world as it would look from the outside (like II but with more fidelity). And it seems to be impossible to put land records in interior cells. Link to comment Share on other sites More sharing options...
QQuix Posted March 14, 2017 Share Posted March 14, 2017 I see . . . and, since there is no way of peeking that interior beforehand, I see two ways of doing it: 1) Dynamically duplicated interiors: Tamriel worldspace <-(door)-> interior cell >> (first frame) duplicate the cell and move the player to >> New cell The bad side effect is that the first time the player enters any interior, you would have two load screens (and you also must rig the original doors, so the next time the player enters the same interior, the doors lead directly to your new interior . . . this would also take care of companions that may come after the player) 2) Predefined interiors: but this will only work for unmoded vanilla interiors. I don't know a thing about land records , so I can't help you there. Link to comment Share on other sites More sharing options...
Recommended Posts