Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Lab Assistant
Original Poster
#1 Old 3rd Dec 2006 at 11:21 PM
Default auto lights on door not working
Hi all,

I'm currently working on some holiday stuff namely a pet basket and a door with light interactions.

while the auto lights appear to be working on the pet basket - I tested for 3 sim days and they turned on and off at the appropriate time testing cheats returns 2 different errors: Couldn't find object ref occurs when switching to life mode, when sim goes whats this and when pet exits basket. Undefined Transition occurs when pet exits basket.
any idea what I should do about these errors?

my biggest prob though is that when applying the same interactions to a door the auto lights do not work at all. no game crashing, freeze of time or error logs either.

would be too cool if you could have a look!

thanks in advance!
Attached files:
File Type: rar  holiday stuff.rar (210.5 KB, 9 downloads) - View custom content

More build mode, plants, lights and pet stuff by me can be found at
Advertisement
The ModFather
retired moderator
#2 Old 4th Dec 2006 at 12:23 AM
Chrissy, let me explain something about the "Autolight" feature.

It is not a feature built-in in the game, that automatically turns on and off all the light in the lot. The Maxis lamps have the autolight feature because:
1) they are assigned to the category "lamps" (in the Init there is a line "My Category := Const 0x0106:0x17")
2) the "Function - Main" BHAV called from the OBJF either is the semiglobal one, taken from the LampGlobals, or is a private one that calls the semiglobal one.
3) the semiglobal "Function - Main" continuously reads the time of the day, and changes the state of the lamp accordingly.
4) Whenever you invoke, on a Maxis lamp, the interaction ".../This Room" or ".../All Lights", the corresponfing BHAV scans all the objects in the room or lot, looking for any object assigned to category "lamp", and then turns it on/off/auto.

So, why your light doesn't work? The truth is that it actually *works*, but only when you manually select the interaction "Autolight": only when you do this, the BHAV checks the time of the day and sets the light state accordingly; in every other moment, the pet bed just stays idle, and does nothing (so, it never check the time of the day).

What you need to do, is to examine the "Function - Main" BHAV from the LampGlobals and transfer part of its code into your private "Function - Main".
It's not an easy job, because the semiglobal Function.Main, in turn, calls other semiglobal functions from the LampGlobals, so before doing anything, I suggest you to clone a Maxis lamp and study its code with SimPE. And when you are ready, import the LampGlobals you might need into your package, and do the needed corrections.

Lastly, as for the error logs you attached, they are caused by the fact that only the "lead tile" is the actual object; the other tiles are just cosmetic. therefore, generally they should have not functions at all, beside the Init.
I've cleaned up the two "non-lead" OBJF from all the BHAV references, except the Init; and I get no errors. Do the same, and then check if it works fine with pets, and if you can clean it correctly.


PS: what explained above applies to the doors, too, and to any other non-lamp object, including... modular stairs I had a hard job when I had to implement the Autolight feature on the Carina stairs

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Back to top