MWSE: xPCCellID Problem

Post » Thu Jul 07, 2016 8:44 pm

Does anyone know why xPCCellID returns a different string every frame, regardless of whether or not you've changed cells? It's a real problem for a simple script I made:



Long prevCell
Long currCell

setx currCell to xPCCellID

if ( prevCell != currCell )
set prevCell to currCell
Set Uvi_CellLoad_Global to 1
Return
endif

Al I wanted to do was test if the player had changed cells, for several scripts where a CellChanged check is unreliable, but instead it's triggering every frame, which is useless.

User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm

Post » Thu Jul 07, 2016 9:54 pm

If you want to compare strings use one of the string-specific functions. (StringCompare or StringMatch)



long old
long new
long dif

set old to new
setx new to xPCCellID
setx dif to xStringCompare old new
if ( dif )
MessageBox "Cell Changed!"
endif
User avatar
Saul C
 
Posts: 3405
Joined: Wed Oct 17, 2007 12:41 pm


Return to III - Morrowind