TodaY Posted May 17, 2010 Share Posted May 17, 2010 Hi everybody ;DI'm working on a house mod, and I want to make a light button (is really needed since daylight actually goes on and off during the correct times... when it's on and the lights are on there's too much lighting, but when it's off and the lights are off there isn't enough lighting ;|)So what I did was give the flame of a candle and a "light bulb" a reference ID, and set them as persistent reference.But when I try to make this script: ----------------------------------short stage Begin OnActivate if stage == 0 (refID the flame).disable ; could be the other way around (refID the lightbulb).disable set stage to 1 elseif stage == 1 (refID's).enable set stage to 0 endifend----------------------------------It tells me it can't find the objects defined in the reference ID ;/I'm very confused here - I know something about scripting, but not muchI guess this has something to do with parents and stuff... Any help on how to make this work is very apreciated! Thanks for reading and happy modding ;D Link to comment Share on other sites More sharing options...
RagnaHighArc Posted May 22, 2010 Share Posted May 22, 2010 Hi everybody ;DI'm working on a house mod, and I want to make a light button (is really needed since daylight actually goes on and off during the correct times... when it's on and the lights are on there's too much lighting, but when it's off and the lights are off there isn't enough lighting ;|)So what I did was give the flame of a candle and a "light bulb" a reference ID, and set them as persistent reference.But when I try to make this script: ----------------------------------short stage Begin OnActivate if stage == 0 (refID the flame).disable ; could be the other way around (refID the lightbulb).disable set stage to 1 elseif stage == 1 (refID's).enable set stage to 0 endifend----------------------------------It tells me it can't find the objects defined in the reference ID ;/I'm very confused here - I know something about scripting, but not muchI guess this has something to do with parents and stuff... Any help on how to make this work is very apreciated! Thanks for reading and happy modding ;D double click on the object's name in the Cell View Window. So, find ur cell, find the object's name in the list of items contained in that cell, double click on it(or right-click properties) and give it a Reference EditorID. go here and scroll down to "Creating a New Persistent Reference". That id is the one you need to use in your scripts. that should work. also, i haven't coded in a while, but the script looks a bit weird. So, the next problem could be the script itself. just post if there are more problems. Link to comment Share on other sites More sharing options...
TodaY Posted May 22, 2010 Author Share Posted May 22, 2010 I already have done everything you just said - and it's there in that script ;pbut david basher helped me - all the script needed was a timer Link to comment Share on other sites More sharing options...
Recommended Posts