- Removed -
if ( player.getParentCell == rLastCell ) ; --- evaluates true on cell change let rLastCell := player.getParentCell forEach aIterator <- aArray[ "cell" ] if eval ( *aIterator == rLastCell ) let rRef := aArray[ "ref" ][ aIterator[ "key" ] ] rRef.reset3DShape let aRazorLog[ ar_Size aRazorLog ] := aIterator[ "key" ] ; --- you'll need to queue each element for deletion endIf loop forEach aIterator <- aRazorLog ar_Erase aArray[ "ref" ] aIterator[ "key" ] ar_Erase aArray[ "cell" ] aIterator[ "key" ] loop ar_Erase aRazorLog 0:(( ar_Size aRazorLog ) - 1 )endIfTo call the code after a cell reset, you'll either need to track each cell's detach time ( more info in the command doc, under the cell functions section ) or add an activator as a watch dog that flags a variable in its script on reset ( you'll need to walk through the cell's activators, find yours, fetch the flag's value, evaluate and clear it )
if ( player.getParentCell == rLastCell )
if ( player.getParentCell != rLastCell )
if eval ( *aIterator == rLastCell )
if eval ( *aIterator == rLastCell )
let rRef := RefArray[ "ref" ][ aIterator[ "key" ] ]
let RefArray := ar_Construct stringMaplet refArray[ "ref" ] := ar_Construct arraylet refArray[ "cell" ] := ar_Construct array
let refArray[ "ref" ][ ar_Size refArray[ "ref" ] ] := rReflet refArray[ "ref" ][ ar_Size refArray[ "cell" ] ] := rCell
SCN DMCounterMeshSetshort doonceshort brokenref objectrefref counterrefref objectrefoldfloat fquestdelaytimestring_var path1string_var path2string_var path3string_var pathtemparray_var aRazorLogarray_var CellArrayarray_var aIteratorref rLastCellarray_var aRazorLogarray_var aIteratorarray_var RefArrayref rLastCellref rRefref rCellfloat resetdetachfloat resethoursfloat resettimeshort arraystartbegin gamemodeset fquestdelaytime to 0.1if doonce == 0 set doonce to 1 let path1 := "furniture\upperclass\uppercountermiddle02.nif" let path2 := "furniture\upperclass\uppercounterend03.nif" let path3 := "furniture\upperclass\uppercounterend04.nif" let RefArray := ar_Construct stringMap let refArray[ "ref" ] := ar_Construct array let refArray[ "cell" ] := ar_Construct array let aRazorLog := ar_Construct Arrayendifif broken == 0 set objectref to player.getcrosshairref if objectref != objectrefold && objectref != 0 set objectrefold to objectref if objectref.getdistance player <= 150 && (objectref.isactivatable == 0 || objectref.iscontainer == 1) let pathtemp := objectref.getmodelpath if eval (pathtemp == path1) || objectref.getmodelpath == path2 || objectref.getmodelpath == path3 set objectrefold to 0 if player.IsAnimGroupPlaying AttackLeft == 1 || player.IsAnimGroupPlaying AttackRight == 1 || player.IsAnimGroupPlaying AttackPower == 1 set broken to 1 endif endif endif endifendifif broken == 1 objectref.playgroup forward 1 playsound CGlassMedium set broken to 0 if arraystart == 0 set arraystart to 1 endif let rCell := player.getParentCell let rRef := objectref let refArray[ "ref" ][ ar_Size refArray[ "ref" ] ] := rRef let refArray[ "ref" ][ ar_Size refArray[ "cell" ] ] := rCellendifif ( player.getParentCell != rLastCell ) && arraystart == 1 let rLastCell := player.getParentCell set resetdetach to GetCellDetachTime rLastCell set resettime to GetCellResetHours rLastCell set resethours to ((gamedayspassed - resetdetach) * 24) + gamehour if resethours >= 72 forEach aIterator <- RefArray[ "cell" ] if eval ( *aIterator == rLastCell ) let rRef := RefArray[ "ref" ][ aIterator[ "key" ] ] rRef.reset3DState let aRazorLog[ ar_Size aRazorLog ] := aIterator[ "key" ] endIf loop forEach aIterator <- aRazorLog ar_Erase RefArray[ "ref" ] aIterator[ "key" ] ar_Erase RefArray[ "cell" ] aIterator[ "key" ] loop ar_Erase aRazorLog 0:(( ar_Size aRazorLog ) - 1 ) endifendifend
forEach aIterator <- RefArray[ "cell" ]
forEach aIterator <- RefArray[ "cell" ]
ar_Dump RefArray[ "cell" ]or even
ar_Dump RefArrayto get a dump of what your arrays contain. It may help you a lot.
let refArray[ "ref" ][ ar_Size refArray[ "cell" ] ] := rCellshould quite surely be
let refArray[ "cell" ][ ar_Size refArray[ "cell" ] ] := rCell
Invalid expression for parameter 2. Expected array.
Invalid expression for parameter 2. Expected array.
let tmpArray := refArray[ "ref" ]; ar_Dump tmpArrayif eval (ar_Find rRef tmpArray >= 0)