Replies: 41 (Who?), Viewed: 16471 times.
Page 1 of 2
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#1 Old 6th Aug 2012 at 8:12 PM Last edited by Phaenoh : 7th Aug 2012 at 7:40 AM.
Default Select Object by Category
I'm modding Inge's StayThingsShrub to keep things based on the object's category (right now, just toilets), but I must be messing up something simple in the line, cuz it's not working. I would also like this to become active on placement, rather than a pie menu and I'm thinking I can do that on the controller object's placement, but will that still affect all the objects that get placed after the controller goes down? Or is there a way of telling all that code to happen right before move-out?

I've attached a picture of the only line of code I've changed, so that has to be where my screw up is; cuz Inge's object works. Right?
Screenshots
Advertisement
Retired Duck
retired moderator
#2 Old 7th Aug 2012 at 1:26 AM
It shouldn't be looking at "Stack Object's Attribute 0x0010", it should be looking at "Stack Object ID".

I know there's a "Just Moved In" function hook, but I don't think there's a "About to move out" equivalent. There's something called "Global Awareness" which might be receiving global hooks, but to be honest I don't think I've ever actually seen it used, and I've certainly never used it, so that's a wild stab in the dark from me!
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#3 Old 7th Aug 2012 at 2:10 AM
What about a global hack that would always prevent these objects from disappearing on move out? Would I just import the semi-globals from each category and set the flag in each ones Init line? Would that affect custom objects as well?
Retired Duck
retired moderator
#4 Old 7th Aug 2012 at 4:08 AM
You could... Sort of. Most objects have a semi-global fallback for init, so it would work for them, but there are a lot which don't.

There is a hook point you could use, I considered using it once for a "challenge/storytelling gameplay mode" project, but it's a delicate one.

Pretty much every object in game calls up to global "0x010F: Init - Object" in its initialization tree. That can include tokens, props, controllers, sims, not just regular catalog objects... So it's something you really, really want to handle with care. It's the most basic, low-level point I've found where you can intervene with BHAVs, and it will intervene, to the best of my knowledge, with pretty much everything.

So you could put it in there. But, you know... There be dragons, etc etc...
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#5 Old 7th Aug 2012 at 4:49 AM Last edited by Phaenoh : 7th Aug 2012 at 7:39 AM.
That sounds scary and bad and considering how badly I suck at BHAV coding, maybe I should just stick to the object version. I'll mesh it into a For Sale sign, so users will likely place it last. I can still make all of that code run on the placement of the object, so I won't need a sim to interact with it?

Edit: Awesome. That fixed it. It was highly amusing to see a completely blank house with nothing but toilets in it. Epic lulz. Now to add in all the other things that are supposed to stay. And, I got it to work on object placement too. I have learned a few tricks!

Edit: Everything is awesome and working perfectly. I just need to mesh up a cute little sign. Project piece (pretty much) done! Yay! Now I just have to get the moving boxes to work, and this whole thing is ready!
Retired Duck
retired moderator
#6 Old 8th Aug 2012 at 1:41 PM
Yay! Glad to hear it was so easily sorted!
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#7 Old 12th Dec 2012 at 7:01 PM
Site Helper
#8 Old 15th Dec 2012 at 12:56 AM
Were you thinking about allowing the user to ask all furnishings to stay, similar to the existing Stay-Things Shrub, or is this just for specific objects?

My logic for reimbursing the family for the lost object value is coming along. There seems to be a small problem with some lots that the value reimbursed is slightly larger than the value lost, but I'm having problems finding the problem.
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#9 Old 15th Dec 2012 at 2:03 AM
Originally I had planned on not doing that, but I suppose it could be included back in as a pie menu option and just the regular built in fixtures as the default.

I was working on something else and I noticed that in the OBJD there is a line that says 'move out with'. Couldn't technically I change all the (maxis) objects that I always want to stay and they'd stay put on their own to begin with? I imagine that's how trees and flowers stay put, and they still get to count in lot value. Could that help at all with the lost value? It wouldn't help at all with any CC objects, but it was an idea I had.

Glad to hear you are making progress with the value issue. I don't use the original shrub enough (cuz I always forget to place it when I'm building) at the right time so I never noticed it. That was my reason for having the objects predetermined. Here's my current version of my object.
Download - please read all instructions before downloading any files!
File Type: rar Phaenoh_MovingSign.rar (193.7 KB, 23 downloads) - View custom content
Site Helper
#10 Old 15th Dec 2012 at 2:19 AM
Yes, I believe that modifying the objects to stay would solve the problem permanently. And, yes, that would fix the lot value since the objects would be added correctly to the appropriate objects total. It's a completely different approach and would probably work well, but would require a lot of object fixes if people want their lots to remain fully furnished.
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#11 Old 15th Dec 2012 at 5:11 AM
Yeah, but it wouldn't work on CC at all unless every single piece was modded as well, and my fave thing to download tends to be sexy CC bathroom sets... I prefer the route you are going if you can make it work. With the categories though, we could have a 'Everything Stays' pie menu, as well as 'bathroom fixtures', 'lights', 'kitchen built-ins', and go down the line from there. That gives more options and more options is always better.
Site Helper
#12 Old 15th Dec 2012 at 6:07 AM
I grabbed it and took a quick look. Looks great. It seems reasonable to add a menu to allow people to choose all objects, and to add my reimbursement code to both sets of objects. I'll look into doing that tomorrow and get it back to you. Then, if you want to add more categories, that would be great.

What if someone deletes the for-sale sign? Does it restore the moveable flag, or does it just leave everything as is? It might make sense to restore the objects to their normal state if the for-sale sign is deleted.
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#13 Old 15th Dec 2012 at 6:28 AM
I have no idea what happens if you delete it. I didn't test it much. I put it some of the Desdirata's houses and then booted out the families and checked to see that they still had all their stuff. Then I put the family back in and deleted the sign. : shrug :
Site Helper
#14 Old 15th Dec 2012 at 5:43 PM Last edited by Mootilda : 16th Dec 2012 at 12:41 AM.
OK, I'll take a look at deleting it; I believe that it should probably reset the objects on deletion.

[Update:]

Just FYI: You've made your main logic run in Init. That means that the object just needs to be created to change the value of your lot. Since the object is created when you view the catalog, you don't even have to place the sign on the lawn for your sim to lose money. I understand that you want the objects to become stayable as soon as the object is placed, but you probably don't want the current behavior, so I'll see whether I can fix that too.
Site Helper
#15 Old 16th Dec 2012 at 5:53 AM
OK, I'm stumped. How do you run code when an object is actually purchased and placed on the lot, rather than when it is selected from the catalog but not yet placed on the lot?
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#16 Old 16th Dec 2012 at 6:10 AM
While not 100% confident, I think that the code from the Main line gets run on placement. I have a calendar that manages to watch until 6am on the lot and then does something and its always been right so far. Most other objects just have some sort of idle loop on their Mains. Maybe try that?
Site Helper
#17 Old 16th Dec 2012 at 6:16 AM
Nope. I tried adding the call to the beginning of Main and it was called as soon as the object hovered over a valid square.
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#18 Old 16th Dec 2012 at 7:22 AM
In the OBJF there are things like 'Placement' and 'User Placement' that say they run when the object placement is changed or when a user clicks to place an object. You can stuff BHAVs in there. My calendar updates itself on 'Go Live'. There is also an interesting one called 'Just Moved In' that gets called on objects that come to a new lot via inventory it looks like. Not sure if that last one will be useful, but the first two should be.
Site Helper
#19 Old 16th Dec 2012 at 8:01 PM Last edited by Mootilda : 16th Dec 2012 at 8:18 PM.
Both Placement and User Placement run as soon as you grab the object in the catalog, before you place it on the lot. A bit better than Init, but still not right.

Go Live sounds interesting. I'll try that. The nice thing is that this would allow the object to update if you purchase something new.
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#20 Old 16th Dec 2012 at 8:48 PM
You could also try some sneaky work around in Init or main, set the flags so that it has to be placed outside on the ground and then run a loop asking 'am i on the ground' until it's actually placed, it shouldn't return true, right?
Site Helper
#21 Old 16th Dec 2012 at 10:12 PM Last edited by Mootilda : 16th Dec 2012 at 10:29 PM.
I suppose that I should have listed everything that I had already tried in my post asking for help. Sorry.

I tried something similar: checking the room ID, but that also occurred too early... as soon as you hover over the room. My guess is that "am I on the ground" will also return true far too early. Although, there's no harm in trying it. Oddly, the game really doesn't seem to distinguish between getting ready to place an object and actually placing it; you'd think that would be an important distinction.

The for-sale sign seems to be working fairly well with Start Live Mod to make the objects stayable and to reimburse the family for the lost lot value, and Delete to make them moveable again (thus resetting the lot value). Unfortunately, we'd have to warn people about going into Live mod before moving out. We'll also need to explain why the family is getting cash when they set their house for sale.

I was going to do some more testing, and add an option to sell the completely furnished lot, rather than just the "built-ins". Alternatively, we could share several different versions and allow people to choose one. Are people likely to want the same behavior every time? I suspect so.

If you'd like to see what I've got so far, let me know.
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#22 Old 16th Dec 2012 at 10:31 PM
If you have something you think is working, roll with it. As far as sharing it, I haven't done much with this (nor with my original one), so you should totally upload it and just mention me for the 'just the built-ins' feature. I wasn't planning on releasing this all until I had the rest of my set (the boxes) done, and I don't foresee working on that anytime soon. I think I was planning on tweaking at the texture and the mesh a bit more before I released it though. The one you have from me is blatantly borrowed (stolen) from KiaraRawks so I was going to work on that a bit more still. I'll try to get you a changed mesh and texture for it soonish though.
Site Helper
#23 Old 17th Dec 2012 at 1:24 AM
If there's no hurry, I'm going to do some more research. Although it seems to make sense to reimburse the family for their lost lot value, in practice it seems counter-intuitive.

For example, your family has the for-sale sign on their lot. They buy a new toilet for $1000 and they can see their lot value increase by $1000 and their family funds decrease by the same amount. Then, you go into live mode and you can see your family's fund increase by $1000. When you check your lot value, it's decreased by the same amount. But, the new toilet is still on the lot!

It really would be better if your family funds were unaffected and your lot value remained constant regardless of whether the objects will stay on the lot or disappear on move-out.

Because of this, I'm going to try again to find some way to restore the object value to either the moveable or stayable totals. I had another idea which probably won't work, but it can't hurt to try.
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#24 Old 17th Dec 2012 at 3:48 AM
No hurry what-so-ever. If you noticed, I hadn't touched this project since mid August! You are right about it being counter intuitive, so it would be cool if you do find a way of getting it to work the way we think it should. I keep thinking of ways that it might work too, and then I realize they couldn't... >.> frustrating.
Doing all the things, and *mostly* not failing.
retired moderator
Original Poster
#25 Old 2nd Jan 2013 at 5:00 AM
I finally had a moment to change up the mesh and make a new texture for this. How have your holidays been going?

Attached is the new mesh file and texture. I wasn't sure how much you had done to the packages so I thought this might be better.
Screenshots
Download - please read all instructions before downloading any files!
File Type: rar MovingSignUpdated.rar (35.6 KB, 19 downloads) - View custom content
Page 1 of 2
Back to top