Thanks! The disable/enable in one frame worked.
Below are the scripts I used, do you see any problems with them?
I created a new light reference for a lit tiki torch, with sound. I applied the following script to it. I did NOT check the reference persists option, because I am not saving the data.
begin TR_lit_tiki_scriptDontSaveObjectshort doonceif ( doonce == 0 ) disable enable set doonce to 1 returnendifif ( MenuMode == 1 ) Returnendifif ( GetDisabled == 1 ) setdelete 1 returnendifif ( player->CellChanged == 1 ) disable returnendifend TR_lit_tiki_script
I then created an activator using the static unlit tiki torch, and applied the following script to it. I did check the References Persist option for this.
If the player saves the game while in this cell, then reloads the game, the tiki will get scaled up to 0.5. I use this feature to reset the lit tikis. When the player leaves the cell - all the tiki torches will go out (well actually they will go out when the player reenters the cell).
begin TR_act_tiki_torchshort new_tikifloat curZshort dooncefloat tempZ;using scale value to determine if the player has come in via a game loadif ( doonce == 0 ) set curZ to ( GetPos Z ) set doonce to 1endifif ( GetScale == 0.5) ;reactive lights SetPos Z curZ PlaceAtMe "TR_m3_lit_tiki2" 1 0 1 set tempZ to ( curZ - 5000 ) SetPos Z tempZ SetScale 0.1 Returnendifif ( MenuMode == 1 ) Returnendifif ( player->CellChanged == 1 ) if ( new_tiki == 1 ) SetScale 1.0 SetPos Z curZ Set new_tiki to 0 endif Returnendifif ( OnActivate == 1) if ( new_tiki == 0 ) PlaceAtMe "TR_m3_lit_tiki2" 1 0 1 set tempz to ( curZ - 5000 ) SetPos Z tempZ SetScale 0.1 set new_tiki to 1 Return endifendifEnd TR_act_tiki_torch