mikolajgos Posted July 22, 2011 Share Posted July 22, 2011 I've tried to make a button for turning the lights on and off, just like the one on the top of Anvil Lighthouse. I've found the script from the lighthouse:scn AnvilLighthouseActivator begin OnActivate if IsActionRef player == 1 if AnvilLighthouseFire.GetDisabled == 0 AnvilLighthouseFire.disable else AnvilLighthouseFire.enable endif elseif IsActionRef UlfgarFogEyeRef == 1 ; message "DEBUG: Ulfgar activating lighthouse bowl" ; turn on if evening, turn off if morning if gamehour <= 12 AnvilLighthouseFire.disable else AnvilLighthouseFire.enable endif endif end Then I've changed the activator "AnvilLighthouseFire" into "TestFire01", an activator I created. It looked like this: scn 0TESTFIRE begin OnActivate if IsActionRef player == 1 if TestFire01.GetDisabled == 0 TestFire01.disable else TestFire01.enable endif elseif IsActionRef UlfgarFogEyeRef == 1 ; message "DEBUG: Ulfgar activating lighthouse bowl" ; turn on if evening, turn off if morning if gamehour <= 12 TestFire01.disable else TestFire01.enable endif endif end I tried to save but an error occured saying that the game cannot find script in line 7 (TestFire01.disable). I'm not good at scripting in Oblivion, so I ask You, what am I doing wrong? : /Regards : ) Link to comment Share on other sites More sharing options...
nosisab Posted July 22, 2011 Share Posted July 22, 2011 (edited) The enable/disable function must be performed on a reference and not objectID. To get the needed reference you must place your activator on the world and go to the proper field in it's properties and give it an explicit referenceID, which is what you use in your script. Notice I'm supposing you are using the ObjectID, since no information about it is given. The objectID is the name you give to the activator (in this case) at the Object window instead it's actual instance in the Render window. To access the field you can select the item either in the render window or the Cell View window and right click it and Edit. The field is the top most, named "Reference editor ID". call it something like TestFire01Ref to easy identification as referenceID from the objectID. Edited July 22, 2011 by nosisab Link to comment Share on other sites More sharing options...
fg109 Posted July 22, 2011 Share Posted July 22, 2011 Don't name anything using numbers at the front. Link to comment Share on other sites More sharing options...
nosisab Posted July 22, 2011 Share Posted July 22, 2011 (edited) Don't name anything using numbers at the front.I didn't understand, mean you the FormID? the above mentioned are all names and not numbers. PS: you rose an interesting point, something called EdDabb01 could easily pass for a hex number :) Edited July 22, 2011 by nosisab Link to comment Share on other sites More sharing options...
fg109 Posted July 22, 2011 Share Posted July 22, 2011 I meant the script name. Link to comment Share on other sites More sharing options...
nosisab Posted July 22, 2011 Share Posted July 22, 2011 (edited) Ah, yes, but that's convention and not game breaking, still should be avoided indeed. Keeping a more meaningful prefixing standard is the way to good coding. I believe the OP named it so to have quicker access to the script in the list... Edited July 22, 2011 by nosisab Link to comment Share on other sites More sharing options...
mikolajgos Posted July 22, 2011 Author Share Posted July 22, 2011 I understand what you mean, I've changed it, but the program still doesn't let me to save the script, see for yourself: http://img708.imageshack.us/img708/4774/csscrn.png Sorry if i'm doing some stupid mistake :f Link to comment Share on other sites More sharing options...
fg109 Posted July 22, 2011 Share Posted July 22, 2011 Did you try changing the fire into a persistent reference? Link to comment Share on other sites More sharing options...
mikolajgos Posted July 22, 2011 Author Share Posted July 22, 2011 Oh, I didn't know I should, but anyway it works perfectly now. Thanks a lot guys ;) Link to comment Share on other sites More sharing options...
Recommended Posts