All textures are vanilla. One new texture added.
if ( state == 0 ) set timer to ( timer + GetSecondsPassed ) if ( timer > 0.1 ) placeatme "AC_de_closet_02" 1 1111 1 set state to 1 set timer to 0 endifendifan activator that just disables itself. e.g.
begin AC_chestdummydisableif ( cellchanged == 1 ) ;setdelete 1endifendWhat is ithe purpose of these disabled activators?
if ( locked == 1 ) if ( getlocked == 0 ) menutest set locked to 2 elseif ( getlocked == 1 ) return endifendif ; extra endifendif
begin AC_comchest02scriptfloat timershort stateshort lockedif ( getlocked == 1 ) set locked to 1endifif ( locked == 1 ) if ( getlocked == 0 ) menutest 0 set locked to 2 elseif ( getlocked == 1 ) return endif ;endifendifif ( onActivate == 1 ) if ( getlocked == 0 ) if ( state == 0 ) Playgroup "idle2" PlaySound3D "Chest open" set state to 1 endif endifendifif ( state == 1 ) set timer to ( timer + GetSecondsPassed ) if ( timer > 1.0 ) skipanim activate set state to 2 endif returnendifif ( state == 2 ) skipanim if ( Menumode ) return endif set state to 3 returnendifif ( state == 3 ) PlaySound3D "Chest Close" Playgroup "idle3" set timer to 0 set state to 0endifend[EDIT]some more fixes
begin ab01wlcrChestScriptDontSaveObject; status varsshort statefloat myScaleshort cc; temp varsshort i1short i2float x1float y1float x2float y2float x3float y3; timersfloat gspfloat t1float t2if ( state == -1 ) returnelseif ( state == 0 ) set state to 1 disable set i1 to Random 10001; a little scale randomization set myScale to GetScale set myScale to ( ( ( i1 / 13000.0 ) + 0.9 ) * myScale ) SetScale myScale returnelseif ( state == 1 ) set state to 2 ; set ab01wlCreCount to ( ab01wlCreCount + 1 ) set y1 to ( player->GetLevel ) set y1 to ( y1 * 20 ) set x1 to ( player->GetLuck ) set x1 to ( 2.5 * x1 ) set i1 to Random 1001 set i1 to ( y1 - x1 - ( i1 / 5 ) + 250 ) if ( i1 > 900 ) Lock 90 elseif ( i1 > 800 ) Lock 80 elseif ( i1 > 700 ) Lock 70 elseif ( i1 > 600 ) Lock 60 elseif ( i1 > 500 ) Lock 50 elseif ( i1 > 400 ) Lock 40 elseif ( i1 > 300 ) Lock 30 elseif ( i1 > 200 ) Lock 20 elseif ( i1 > 100 ) Lock 10 endif set x1 to GetPos Z set myScale to GetScale set x1 to ( ( 14 * ( myScale - 1 ) ) - 5 + x1 ) SetPos Z x1 enableif ( ab01debug == 2 ) MessageBox "chest scale set to %f" myScaleendif return endif ; stateif ( GetDisabled == 0 ) if ( CellChanged ) if ( ab01wlSkipSpawn ) set t2 to 0 disable return endif if ( GetInterior ) if ( cc == 1 ) set t2 to 0 disable return endif set cc to 2 else if ( cc == 2 ) set t2 to 0 disable return endif set cc to 1 endif endif if ( GetScale != myScale ) disable SetScale myScale enable;if ( ab01debug == 2 ); MessageBox "chest scale re-set to %f" myScale;endif return endifendif; start of relevant partset gsp to GetSecondsPassedif ( t1 > 0 ) if ( t1 >= 0.8 ) SkipAnim else set t1 to ( t1 + gsp ) endifendif if ( OnActivate ) if ( t1 == 0 ) if ( GetLocked == 0 ) set t1 to 0.1 PlayGroup Idle2 1 PlaySound3DVP "Door Creaky Open" 0.9 0.9 else activate endif elseif ( t1 >= 0.8 ) activate endifendifif ( MenuMode ) returnendif; end of relevant partif ( t2 < 6 ) set t2 to ( t2 + gsp ) returnendif set t2 to Random 10001set t2 to ( t2 * 0.00005 )if ( GetDisabled ) set state to -1 setdelete 1 returnendifset i1 to 0set x1 to ( GetDistance player ); if ( x1 > 5300 ) ; reduced to try to avoid palace orphaned chestsif ( x1 > 5100 ) set i1 to 1endifif ( i1 == 1 ) set x1 to ( player->GetPos X ) set y1 to ( player->GetPos Y ) set y3 to ( player->GetAngle Z ) set x2 to GetPos X set y2 to GetPos Y set x2 to ( x2 - x1 ) set y2 to ( y2 - y1 ) if ( y2 >= 0 ) set x3 to y2 else set x3 to ( 0 - y2 ) endif if ( x3 < 0.00001 ) return endif set x3 to ( x2 / y2 ) if ( x2 > 0 ) if ( y2 > 0 ) if ( x3 > 1 ) if ( y3 < -45 ) set i1 to 0 endif else if ( y3 < -90 ) set i1 to 0 endif if ( y3 > 135 ) set i1 to 0 endif endif else if ( x3 < -1 ) if ( y3 < 0 ) if ( y3 > -135 ) set i1 to 0 endif endif else if ( y3 < 45 ) if ( y3 > -90 ) set i1 to 0 endif endif endif endif else if ( y2 > 0 ) if ( x3 < -1 ) if ( y3 > 45 ) set i1 to 0 endif else if ( y3 > 90 ) set i1 to 0 endif if ( y3 < -135 ) set i1 to 0 endif endif else if ( x3 > 1 ) if ( y3 > 0 ) if ( y3 < 135 ) set i1 to 0 endif endif else if ( y3 > -35 ) if ( y3 < 90 ) set i1 to 0 endif endif endif endif endif if ( i1 == 0 );if ( ab01debug == 2 ); messagebox "chest player not in sight: disable";endif set t2 to 0 disable endifendifend
begin AC_chestdummy; AC_dummy is a global short variableif ( GetDisabled ) if ( AC_dummy == 0 ) setdelete 1 endif returnendifdisableend
begin AC_comchest02scriptfloat timershort stateshort lockedif ( getlocked == 1 ) set locked to 1endifif ( locked == 1 ) if ( getlocked ) return endif menutest 0 set locked to 2 endifif ( onActivate == 1 ) if ( getlocked == 0 ) if ( AC_dummy == 0 ) set AC_dummy to 1 placeatme "AC_com_chest_02" 1 1111 1 Playgroup "idle2" PlaySound3D "Chest open" set state to 2 endif endifendifif ( state == 2 ) set timer to ( timer + GetSecondsPassed ) if ( timer > 1.0 ) activate set timer to 0 endif if ( menumode == 1 ) set state to 3 endif returnendifif ( state == 3 ) if ( menumode == 0 ) PlaySound3D "Chest Close" Playgroup "idle3" set state to 4 endif returnendifif ( state == 4 ) set timer to ( timer + GetSecondsPassed ) if ( timer > 2 ) set timer to 0 set AC_dummy to 0 set state to 0 endifendifend