Jump to content

Cell as script property


SKKmods

Recommended Posts

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 by lee3310
Link to comment
Share on other sites

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

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

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

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 by lee3310
Link to comment
Share on other sites

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 by lee3310
Link to comment
Share on other sites

 

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.

 

 

 

 

zBnz9Tb.png

 

 

Edited by LarannKiar
Link to comment
Share on other sites

 

 

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.

 

 

 

 

zBnz9Tb.png

 

 

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...