Difference between revisions of "Talk:Detect Player Cell Change (Without Polling)"

Jump to navigation Jump to search
no edit summary
imported>Granson
imported>BeamerMiasma
Line 36: Line 36:


[[User:Granson|Granson]] ([[User talk:Granson|talk]]) 2015-10-24T14:19:19 (EDT)
[[User:Granson|Granson]] ([[User talk:Granson|talk]]) 2015-10-24T14:19:19 (EDT)
I think I've found an easier and lighter solution to solve the existing problems with the original method. From my testing this works perfectly, I haven't been able to outrun it. First follow the directions of the original posted method - I suggest using a copy of the XMarker object rather than an invisible fork to prevent any havok interaction. The only necessary addition is a script on the ObjectReference of the placed invisibleObject itself with the following content:
<nowiki>Scriptname StalkerObjRefScript Extends ObjectReference
Actor Property PlayerREF Auto
Event OnCellDetach()
MoveTo(PlayerREF)
Debug.Trace(Self + ": Tracker detected cell detach, moved to to cell " + GetParentCell())
EndEvent</nowiki>
The original spell & script will handle the moving of the invisibleObject whenever the PC walks between connected cells, and the OnCellDetach event on the ObjectReference will handle the moving between loadscreen doors. This event will also make the object 'catch up' in case it gets stuck somehow so there is no need for an OnUpdate event, keeping it polling free.
The only problem I have found with this method is that occasionally both of the scripts will fire when going through a load door. Somewhat depending on what you are doing with the tracker, it's usually trivial to solve that by setting a script flag or keyword in whatever code or effect you plan to run.
--[[User:BeamerMiasma|BeamerMiasma]] ([[User talk:BeamerMiasma|talk]]) 2016-08-14T21:08:23 (EDT)
Anonymous user

Navigation menu