Zorkaz Posted April 16, 2020 Share Posted April 16, 2020 Onload() happens when the cell is loaded. But when actually is a cell really loaded?(I mean in terms of distance) Has someone gained insight? The reason: I want to make some animals respawnable via script, but I'm unsure if they would just pop up Link to comment Share on other sites More sharing options...
YouDoNotKnowMyName Posted April 16, 2020 Share Posted April 16, 2020 I think that depends on the uGridsToLoad value in the ini file (i could be wrong ...).Typically 3 cells (or was it 5?) around the player. Link to comment Share on other sites More sharing options...
thousande Posted April 17, 2020 Share Posted April 17, 2020 You may mix OnLoad with OnCellLoad here? OnLoad signals when the ObjectReference's 3d is rendered and ready.OnCellLoad signals when the cell's 3d and all the children's (object references) 3d in the cell is ready. Check the documentation for both. Link to comment Share on other sites More sharing options...
SKKmods Posted April 17, 2020 Share Posted April 17, 2020 The radius that triggers it is your uGridsToLoad which is by default 5 which works out to 10,240 game units radius from the player. Plus/Minus the object offset from the cell datum. Test it yourself by attaching this to some object references for some empirical data so you don't need to rely on internet opinions; Event OnLoad() Debug.Trace("MyScript.OnLoad " + Self + " 3D " + Self.Is3dLoaded() + " Distance " + Self.GetDistance(Game.GetPlayer()) as Int ) EndEvent Event OnCellAttach() Debug.Trace("MyScript.OnCellAttach " + Self + " 3D " + Self.Is3dLoaded() + " Distance " + Self.GetDistance(Game.GetPlayer()) as Int ) EndEvent Event OnCellLoad() Debug.Trace("MyScript.OnCellLoad " + Self + " 3D " + Self.Is3dLoaded() + " Distance " + Self.GetDistance(Game.GetPlayer()) as Int ) EndEvent Link to comment Share on other sites More sharing options...
Zorkaz Posted April 17, 2020 Author Share Posted April 17, 2020 Thanks SKK50, I was eventually about to test it myself, as you suggested, but earliest next week. Link to comment Share on other sites More sharing options...
SKKmods Posted April 17, 2020 Share Posted April 17, 2020 Since we are sharing opinion, I have found OnLoad is the cheapest to use in terms of Papyrus system load, OnCellLoad(/OnCellAttach are equal. That's from measuring script latency on 4096 const scripts loading at once. Link to comment Share on other sites More sharing options...
Recommended Posts