More Awesome Than You!
Welcome, Guest. Please login or register.
2024 November 21, 17:14:47

Login with username, password and session length
Search:     Advanced search
540287 Posts in 18067 Topics by 6545 Members
Latest Member: cincinancy
* Home Help Search Login Register
+  More Awesome Than You!
|-+  Awesomeware
| |-+  The Armory
| | |-+  Programmable Sleep Clock v3.31
0 Members and 5 Chinese Bots are viewing this topic. « previous next »
Pages: 1 ... 7 8 [9] 10 11 12 THANKS THIS IS GREAT Print
Author Topic: Programmable Sleep Clock v3.31  (Read 300611 times)
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #200 on: 2006 November 09, 09:00:14 »
THANKS THIS IS GREAT

I think I've come up with a way to do automatic class bed setting. I've verified that the Lua code works, anyway:

Code:
local bed = GetPrimitiveParameter(0)
local g = GlobalObjManager:getObjectGUIDFromObjectId(bed)
SetTemp(0, GetConstantWithGuid(g, 4097, 2))

All you'd have to do is pass the bed objectId to the Lua, and this would give you the Energy rating.
Oh? Now that's interesting. What LUA is this?
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #201 on: 2006 November 09, 11:18:12 »
THANKS THIS IS GREAT

I have a demonstration of how to do Lua like that in my new (lua-tester2b) hack I just posted.
Logged

twojeffs
Stupid Schlemiel
****
Posts: 1690



View Profile WWW
Re: Programmable Sleep Clock v3.31
« Reply #202 on: 2006 November 10, 05:09:57 »
THANKS THIS IS GREAT

Oh, shiney! Thanks for pointing that out, Dizzy. I need that for ACR so I can abandon my half-assed workaround I had to do for sleepage after woohoo. Grin

ETA: Ah, so that's a custom lua function you wrote. Easy enough to define as a local lua object in the controller though. I'll have to give it a shot.
Logged
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #203 on: 2006 November 10, 05:57:11 »
THANKS THIS IS GREAT

Do I need to install some janky program to mess with this LUA stuff or can this be done in NOTEPAD? I hate installing crap.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
twojeffs
Stupid Schlemiel
****
Posts: 1690



View Profile WWW
Re: Programmable Sleep Clock v3.31
« Reply #204 on: 2006 November 10, 07:18:30 »
THANKS THIS IS GREAT

You can define it as a local function and just include the code to run in the text file. I've seen examples of that in the code. Unfortunately I don't remember where at the moment. I'll have to dig one up to verify how it's done. That way you don' t need to compile an actual lua file at all.
Logged
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #205 on: 2006 November 10, 10:49:02 »
THANKS THIS IS GREAT

If you clear the bit 0 of flags in the Lua primitive, the SimAntics game engine will execute a Lua loadstring() of the indicated STR#'s description after doing a quick filter (they don't let you dofile() anymore, for example). I've been doing this for the past couple weeks in testing, and I've had no real problems.
Logged

J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #206 on: 2006 November 10, 11:57:54 »
THANKS THIS IS GREAT

...in English this time?
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #207 on: 2006 November 10, 13:20:33 »
THANKS THIS IS GREAT

Let's look at an example:

Code:
# Group = 0x7F1D0F49, Instance = 0x1030
# Title = Interaction - Pet - Give Birth

Look through that mess of code and you'll eventually notice this:

Code:
    59: Lua: Private - "OpenBirth", defined in description, Passing in params where param 0 = Local 0, param 1 = 0, param 2 = 0; true: 2E, false: 2E
        [ 007E: (00) 30010100FAFF19000007000007000000 ]
    5A: Lua: Private - "CloseBirth", defined in description; true: 63, false: 63
        [ 007E: (00) 30010200F2FF07000007000007000000 ]

Notice that both those Lua primitives are "defined in description" as per their flags settings.

Now, if you look at "Group = 0x7F1D0F49, STR# 0x130(Lua Scripts)", you see this:

Code:
0x0: OpenBirth
local numPKs = GetPrimitiveParameter(0)
nUI.OpenProgressDialog(4276996822)
nUI.ShowProgressDialogControl(1, false)
nUI.ShowProgressDialogControl(2, false)
nUI.ShowProgressDialogControl(3, false)
nUI.ShowProgressDialogControl(4, false)
nUI.ShowProgressDialogControl(numPKs, true)

0x1: CloseBirth
nUI.CloseProgressDialog()

The description for the first string contains the Lua code for the first command, and the description for the second string contains the code for the second. Pretty simple, really.
Logged

twojeffs
Stupid Schlemiel
****
Posts: 1690



View Profile WWW
Re: Programmable Sleep Clock v3.31
« Reply #208 on: 2006 November 10, 18:49:21 »
THANKS THIS IS GREAT

Ah yes, the pet birth code. That's where I saw the local lua code. Thanks again Dizzy. Smiley
Logged
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #209 on: 2006 November 10, 20:48:08 »
THANKS THIS IS GREAT

That made much more sense. How reverse-compatible is this, though? How far back in the engine can we expect to be able to do this?
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #210 on: 2006 November 10, 21:38:21 »
THANKS THIS IS GREAT

I think Lua in descriptions goes back to Nightlife, albeit about half the global functions were probably added for OfB. Probably would be a good rule of thumb to require OfB or newer for Lua mods.
Logged

ThyGuy
Exasperating Eyesore
*
Posts: 228


HELP ME! I'M STUPID!


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #211 on: 2006 November 14, 06:52:48 »
THANKS THIS IS GREAT

I'm having a oddity. All my sims run to the bed and go into a "go to bed" "Be used" querie seizure. At first I thought it was twojeffs ownership of beds hack, but when I removed that; this problem continued. I have now removed all hacks that have to do anything with beds except the clock, made sure them bastards were truly gone, and it's still doing the same thing.

I removed my moreawesomethanyou directory, Dl'ed the most up to date OFB version, and immediately they resume the querie seizure.
Logged

DEATH TO UGLY BEAGLE DOGS!
WALMART IS THE DEVIL!!!!!
I DEMAND THE FIERY DEATH OF CRYING BABIES!
Do us a favor? DIE, GO TO HEAVEN, STFU!
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #212 on: 2006 November 14, 07:52:12 »
THANKS THIS IS GREAT

How are you triggering this? Does it happen on its own, or are you manually issuing the orders?
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
ThyGuy
Exasperating Eyesore
*
Posts: 228


HELP ME! I'M STUPID!


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #213 on: 2006 November 14, 09:09:58 »
THANKS THIS IS GREAT

This happens on its own.

The clock tells sim to head to bed. They run to the side of the bed and the loop begins and doesn't stop until the game is paused and the querie is killed. They will get in the bed if you manually make them. In a double bed, the querie reacts by flooding the top of the screen with the "Go to sleep" "be used" icons. In a single bed, they don't even attempt to go to the bed. the querie comes up, and goes away, and then repeats.

I'm going to turn on debug and see if it causes a error, but all it seems to be doing is going into a impossible command loop.

Edit: Apparently something messed up the clocks in every lot in the neighborhood. Removing the clocks and putting new ones fixed the problem. twojeffs bed ownership hack appeared to caused some sort of spazz out, and the clocks retained this spazziness even after the bed ownership hack being removed.
« Last Edit: 2006 November 14, 09:52:49 by ThyGuy » Logged

DEATH TO UGLY BEAGLE DOGS!
WALMART IS THE DEVIL!!!!!
I DEMAND THE FIERY DEATH OF CRYING BABIES!
Do us a favor? DIE, GO TO HEAVEN, STFU!
jsalemi
Town Crier
Vacuous Vegetable
*****
Posts: 4475


In dog we trust, all others pay cash...


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #214 on: 2006 November 27, 13:40:29 »
THANKS THIS IS GREAT

I like how the latest version auto-determines the proper setting for the bed, but I'm a bit unclear on how it all works.  So let me say how I understand it, and you tell me if I'm wrong. Smiley  And then I have a question or two.

1) When putting the SC on a new lot, it automatically determines the proper setting for the bed, so the sim only has to set the wake time and the bed time settings.
2) On existing lots, the SC adjusts to the bed that's there (since the 'bed class' menu item is gone).

So, does the auto-bed class work with any bed, even custom ones?  Or will we still have to set custom ones manually? (I haven't played any lots with custom beds yet.)
Logged

Excelsior, you fathead!
I am Canadian.
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #215 on: 2006 November 27, 15:13:31 »
THANKS THIS IS GREAT

Post-OFB games should be able to autodetect the sim's bed level, provided no one is in it at the time. If the autodetect succeeds, the only option you can set it to will be the correct one.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #216 on: 2006 November 27, 17:18:22 »
THANKS THIS IS GREAT

So, does the auto-bed class work with any bed, even custom ones?  Or will we still have to set custom ones manually? (I haven't played any lots with custom beds yet.)

As long as the custom beds work with the BedGlobals, it should work with the auto-detect. AFAIK, there are no custom beds that don't use BedGlobals.
Logged

jennydeenyc
Exasperating Eyesore
*
Posts: 212


what're YOU lookin' at?


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #217 on: 2006 December 11, 06:04:15 »
THANKS THIS IS GREAT

I have one custom bed who's Comfort/Energy stats don't seem to match any other bed (single, double, Maxis or custom) in my catalog. Not sure what class to set the clock for. It's a single bed from Kate @ Parsimonious with Comfort 7 & Energy 10, no Environment. Any thoughts?
Logged
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #218 on: 2006 December 11, 08:24:18 »
THANKS THIS IS GREAT

If the "auto" option exists, it will autodetect it.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
jsalemi
Town Crier
Vacuous Vegetable
*****
Posts: 4475


In dog we trust, all others pay cash...


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #219 on: 2006 December 11, 14:21:01 »
THANKS THIS IS GREAT

Post-OFB games should be able to autodetect the sim's bed level, provided no one is in it at the time.

Ah, ok -- I was wondering why the full bed class list was showing up when I checked it -- the sims were asleep at the time.  I'll have to remember to do it while they're awake.
Logged

Excelsior, you fathead!
I am Canadian.
V
Senator
*
Posts: 1151



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #220 on: 2006 December 22, 16:32:23 »
THANKS THIS IS GREAT

All of a sudden, many of my teens and children are popping out of bed in the middle of the night. It usually happens just when everyone in the house is asleep and the clock automatically goes to 3.They are not energy refreshed and their beds' covers are lumped up as if they are still inside.

When I removed the sleep clock from the two child/teen bedrooms in one of my homes they were able to sleep through the night.

The parents are unaffected and sleep through the night just fine, waking fully refreshed at the proper time.
Logged

I want people to stop saying, "Son of a bitch". Instead we should say "Son of an ASS" because that is more accurate. Spread the word!

J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #221 on: 2006 December 22, 18:51:22 »
THANKS THIS IS GREAT

That sounds like an error. Get an error log.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
jsalemi
Town Crier
Vacuous Vegetable
*****
Posts: 4475


In dog we trust, all others pay cash...


View Profile
Re: Programmable Sleep Clock v3.31
« Reply #222 on: 2006 December 22, 23:16:32 »
THANKS THIS IS GREAT

All of a sudden, many of my teens and children are popping out of bed in the middle of the night. It usually happens just when everyone in the house is asleep and the clock automatically goes to 3.They are not energy refreshed and their beds' covers are lumped up as if they are still inside.


That sounds like a bug that TJ recently squashed in his Smart Beds hack -- do you use that?  If so, have you updated it to 0.90?
Logged

Excelsior, you fathead!
I am Canadian.
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #223 on: 2006 December 22, 23:42:21 »
THANKS THIS IS GREAT

Not sure why you'd need a smart bed if you have the smart clock.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
V
Senator
*
Posts: 1151



View Profile
Re: Programmable Sleep Clock v3.31
« Reply #224 on: 2006 December 23, 04:39:49 »
THANKS THIS IS GREAT

The smart bed let me pick a bed by putting the sim nearby (or relaxing in) the bed of choice and choosing "adjust... bed ownership... own this bed" which was especially useful for homes with lots of kids sharing one room. The smart clock (and the reason it took me until recently to try using it again) used to require having some idea of which one of the E*..* codes was the right one for the right bed. If the smart clock is smarter about which bed belongs to which sim nowadays or if the smartbeds is superfluous in the face of smart clock then I will remove it.

I had come back earlier this evening to put in the error report for the teenager as you suggested, JMP, when I saw jsalemi's message regarding the update for the smartbeds. I thought I did have the latest version of smart beds but figured I should check before I posted a reply. Jsalemi, that was the problem. I had the old one from earlier in December. Once I updated the file and sent the kids back to bed the next sim night they slept straight through without any trouble. Thank you for pointing me in the right direction.

Pescado, I am terribly sorry that I suspected it was your impeccable smartclock that was at fault. I certainly should have known better.      Wink

Logged

I want people to stop saying, "Son of a bitch". Instead we should say "Son of an ASS" because that is more accurate. Spread the word!

Pages: 1 ... 7 8 [9] 10 11 12 Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.076 seconds with 20 queries.