SKKmods Posted February 15, 2023 Author Share Posted February 15, 2023 Yes at 11 to 14 game units before which at player run speed of 300 units per second is 0.05 seconds or 3 frames of script execution at 60 fps ... NURSE ! Link to comment Share on other sites More sharing options...
lee3310 Posted February 16, 2023 Share Posted February 16, 2023 (edited) Yes at 11 to 14 game units before which at player run speed of 300 units per second is 0.05 seconds or 3 frames of script execution at 60 fps ... NURSE !Something i want to try is manually converting the cell form you are looking for (from Hex to decimal) store it in an "Int" variable and use GetParentCell().GetFormID == to check on every cell change (shouldn't take a lot of resources that way) Edited February 16, 2023 by lee3310 Link to comment Share on other sites More sharing options...
SKKmods Posted February 16, 2023 Author Share Posted February 16, 2023 The difficulty you have is actually capturing every cell change event. To do that would need a persistent ObjectReferene in each cell to trigger the event as it an ObjectReference event, not a cell event. Which is why I used the DiamondCityGate object. The cell script has no events. The issue with OnLocationLoaded or OnLocationChange is that locations have no relation to individual cells which causes much myrth e.g DiamondCityLocation which spans internal and external cells so does not trigger on transition. Link to comment Share on other sites More sharing options...
lee3310 Posted February 16, 2023 Share Posted February 16, 2023 There is this script that is supposed to be more reliable than using "OnCellLoad()" on the player alias and also resource friendly but the question is, how to check if the current cell is the one that you are looking for if you can't use a property or getform every time ? is it possible to manually store the cell ID as "Int" and use GetParentCell().GetFormID ==. The difficulty you have is actually capturing every cell change event. To do that would need a persistent ObjectReferene in each cell to trigger the event as it an ObjectReference event, not a cell event. Which is why I used the DiamondCityGate object. The cell script has no events. The issue with OnLocationLoaded or OnLocationChange is that locations have no relation to individual cells which causes much myrth e.g DiamondCityLocation which spans internal and external cells so does not trigger on transition.I sent you a script template that i found on the wiki for tracking cell changes (efficiently according to the author) it places a marker and use it as reference:https://www.creationkit.com/index.php?title=Detect_Player_Cell_Change_(Without_Polling)Worth a shot. Link to comment Share on other sites More sharing options...
SKKmods Posted February 16, 2023 Author Share Posted February 16, 2023 That is a very neat solution, as I totally avoid placing static objects using one as a hard coded index reference is not sommat I would have thought of. Do you know how often an Ability polls/updates/refreshes (as the player can cross a whole 4096 cell in just under 4 seconds) ? Link to comment Share on other sites More sharing options...
lee3310 Posted February 16, 2023 Share Posted February 16, 2023 (edited) I have no idea but you can see in the talk page someone mentioned the fact that the player can crosses multiple cell borders at the same time hence the second script attached to the object (and also to teleport it beyond loading doors)The whole idea is to keep it "poll free". Edited February 16, 2023 by lee3310 Link to comment Share on other sites More sharing options...
SKKmods Posted February 16, 2023 Author Share Posted February 16, 2023 The spell is clearly "polling" on condition GetInSameCell to detect false and trigger the magic effect. Link to comment Share on other sites More sharing options...
lee3310 Posted February 16, 2023 Share Posted February 16, 2023 (edited) The spell is clearly "polling" on condition GetInSameCell to detect false and trigger the magic effect.yeah that condition is placed on the spell itself (in the editor) it's a simple check and most likely a native function (much faster than papyrus). Edited February 16, 2023 by lee3310 Link to comment Share on other sites More sharing options...
LarannKiar Posted February 17, 2023 Share Posted February 17, 2023 (edited) There is this script that is supposed to be more reliable than using "OnCellLoad()" on the player alias and also resource friendly but the question is, how to check if the current cell is the one that you are looking for if you can't use a property or getform every time ? is it possible to manually store the cell ID as "Int" and use GetParentCell().GetFormID ==. The difficulty you have is actually capturing every cell change event. To do that would need a persistent ObjectReferene in each cell to trigger the event as it an ObjectReference event, not a cell event. Which is why I used the DiamondCityGate object. The cell script has no events. The issue with OnLocationLoaded or OnLocationChange is that locations have no relation to individual cells which causes much myrth e.g DiamondCityLocation which spans internal and external cells so does not trigger on transition.I sent you a script template that i found on the wiki for tracking cell changes (efficiently according to the author) it places a marker and use it as reference:https://www.creationkit.com/index.php?title=Detect_Player_Cell_Change_(Without_Polling)Worth a shot. I knew I saw this method somewhere.. Well, I made an alternate version based on this earlier that works similarly, but instead of a magic effect it uses a quest and a scene. The Story Manager starts the quest (and keeps it running) on Change Location Event. It has two aliases: 1) Actor: their "OnCellChange (custom) event" is what the scene script sends, 2) Activator (quest alias "Created Ref"; for comparing its GetParentCell() with the Actor's one; activator only for the scene as it is the "scene actor"). The scene script sends the custom event with the arguments: Actor, oldCell, newCell (just like the OnLocationChange). The quest script (optional) listens for the custom event. I rather used OnLocationChange in the mod I made it for so I haven't tested it that much but it was working. It should be pretty fast too. Edited February 17, 2023 by LarannKiar Link to comment Share on other sites More sharing options...
lee3310 Posted February 17, 2023 Share Posted February 17, 2023 There is this script that is supposed to be more reliable than using "OnCellLoad()" on the player alias and also resource friendly but the question is, how to check if the current cell is the one that you are looking for if you can't use a property or getform every time ? is it possible to manually store the cell ID as "Int" and use GetParentCell().GetFormID ==. The difficulty you have is actually capturing every cell change event. To do that would need a persistent ObjectReferene in each cell to trigger the event as it an ObjectReference event, not a cell event. Which is why I used the DiamondCityGate object. The cell script has no events. The issue with OnLocationLoaded or OnLocationChange is that locations have no relation to individual cells which causes much myrth e.g DiamondCityLocation which spans internal and external cells so does not trigger on transition.I sent you a script template that i found on the wiki for tracking cell changes (efficiently according to the author) it places a marker and use it as reference:https://www.creationkit.com/index.php?title=Detect_Player_Cell_Change_(Without_Polling)Worth a shot. I knew I saw this method somewhere.. Well, I made an alternate version based on this earlier that works similarly, but instead of a magic effect it uses a quest and a scene. The Story Manager starts the quest (and keeps it running) on Change Location Event. It has two aliases: 1) Actor: their "OnCellChange (custom) event" is what the scene script sends, 2) Activator (quest alias "Created Ref"; for comparing its GetParentCell() with the Actor's one; activator only for the scene as it is the "scene actor"). The scene script sends the custom event with the arguments: Actor, oldCell, newCell (just like the OnLocationChange). The quest script (optional) listens for the custom event. I rather used OnLocationChange in the mod I made it for so I haven't tested it that much but it was working. It should be pretty fast too. Clever, i may give it a try too but i'm not very familiar with the story manager (it lacks documentation) Link to comment Share on other sites More sharing options...
Recommended Posts