PDA

View Full Version : Object Placement


lemoncandy
8th Aug 2009, 06:55 PM
Hello.
Maybe this question does not belong here, but I don't want to start a new thread.

I need some information about, where to find in a package, the part that determines how the object will be placed.
For example, some objects can only be placed on floor, some can be placed on floor AND tabletops/counters. etc.
I'd like to find where this information is stored and how to edit it.
Any smart people help me please? :report:

Srikandi
10th Aug 2009, 12:44 AM
I split this post from Xanathon's painting tut thread, because indeed, it does not belong there. Please start new threads when you have questions on a new topic :)

Each object has flags that determine where it can be placed. These flags can be modified using the grid in s3pe, or in a hex editor. Some of these flags have been identified, some haven't (if you look at an OBJD in the grid view in s3pe, you'll see many fields labeled "unknown"). For those that are known, the information should be in the wiki.

Somebody else may be able to tell you exactly what flag needs to be set for what you want to do. What object are you trying to place, and where do you want to be able to place it?

HugeLunatic
10th Aug 2009, 01:10 AM
I think what you want is in Slot Placement, found in OBJD as Srikandi said. The seem to have a true or false value.

lemoncandy
10th Aug 2009, 01:12 AM
Thank you for the reply and sorry about the off-topic.

What I was attempting to do is cloning some of the objects that sims use and make them buyable. I'd like them to be placeable on countertops, but some will only go on the floor.
Good to know where I should look for it, thanks :)
I'll read the wiki too then.

Srikandi
10th Aug 2009, 01:16 AM
Thank you for the reply and sorry about the off-topic.

What I was attempting to do is cloning some of the objects that sims use and make them buyable. I'd like them to be placeable on countertops, but some will only go on the floor. I'll take a look at the wiki then, thanks :)

You're talking about animation props, then? Snaitf did one of those a while ago, a buyable/placeable toilet brush. You can download that here, and see how he set the flags: http://www.modthesims.info/download.php?t=357141

The difficulty we encountered with that object is that making it buyable and placeable was no problem, but we couldn't figure out at the time how to stop it from intersecting the surface it was placed on; it sinks in to the halfway mark. We experimented with other objects but had the same issue.

That was a while ago, though. Now that we have more meshing tools and more information about scenegraphs, maybe somebody knows how to set the object's bounding box correctly.

lemoncandy
10th Aug 2009, 12:16 PM
Yes the animation props. I checked the flags in the toiletbrush file and some other similar files and they match exactly what I had in my OBJD so I didn't have to change anything. The problem must be lying elsewhere, I'll keep looking.

HugeLunatic
10th Aug 2009, 06:37 PM
Well the bounding box appears to be in the VPXY. It has 5 values. I can only guess this refers to all points from the center, N, S, E, W, and a maybe depth (front/back). I've been comparing some windows and it *somewhat* holds.

But the bounding box may not be what is determining *where* the objects lies, in TS2 that was the mesh itself or the CRES. The bounding box is the grab points of the mesh. I have not seen the equivalent of the CRES yet.

lemoncandy
17th Aug 2009, 12:53 AM
I gave up on this for now, after looking through all the resources in the package and checking every string in them. Even with everything matching the reference files, the objects still refuse to be placed anywhere else than the floor.

TigerM
17th Aug 2009, 01:01 AM
What prop were you trying to change?

lemoncandy
17th Aug 2009, 11:10 AM
What prop were you trying to change?
Salt shaker, watercan, milk carton, pen, wrench, TV remote, etc, these are the ones that are stubborn.

MetalKat0642
17th Aug 2009, 03:43 PM
I tried that too, and I think the problem might be in the OBJK, not the OBJD. I experimented with the Toilet Brush (a "stubborn" object which only stays on the floor).

If you open Snaitf's "Pink Toilet Brush" package, in the OBJK there's a section named Keys, and in Keys there's something called ScriptClass.
If you clone the normal toilet brush package, there is no ScriptClass key.
Non-stubborn props, like pots & frying pans (which can be placed anywhere), do have a ScriptClass key. I suspect that it can be added to any object via a hex editor, but I haven't tried yet.

lemoncandy
17th Aug 2009, 06:30 PM
I tried that too, and I think the problem might be in the OBJK, not the OBJD. I experimented with the Toilet Brush (a "stubborn" object which only stays on the floor).

If you open Snaitf's "Pink Toilet Brush" package, in the OBJK there's a section named Keys, and in Keys there's something called ScriptClass.
If you clone the normal toilet brush package, there is no ScriptClass key.
Non-stubborn props, like pots & frying pans (which can be placed anywhere), do have a ScriptClass key. I suspect that it can be added to any object via a hex editor, but I haven't tried yet.

Wah you're a genius!! It's there, and I missed it. You found the solution, thank you so much! Now I just need to find out how to edit that thing :P

Inge Jones
17th Aug 2009, 07:00 PM
Unfortunately s3pe grid view still doesn't allow you to add a new key. Maybe you could "borrow" a copy of the OBJK of a pot or pan. Keep a safe copy of the original toilet brush OBJK so you can look up what the model key and VPXY reference etc were to edit the imported OBJK

lemoncandy
17th Aug 2009, 07:31 PM
Success!!
http://i28.tinypic.com/a4tt7l.jpg
I exported/imported an OBJK with Postal, but I guess S3PE can do the same :)

MetalKat0642
18th Aug 2009, 01:30 PM
Congratulations!!!

Yes, you can do it using S3PE as well. It works fine.

By the way, assigning different script classes to the same object gives different slot placement options. For example, the FryingPan class gives fewer slots than "...MimicsTablePerfumes" (the one that Snaitf's brush uses).

http://img80.imageshack.us/img80/4672/yayq.jpg (http://img80.imageshack.us/i/yayq.jpg/)
(just wanted to share a pic of my success... a bit of the knife gets under the surface, but it still looks ok)

lemoncandy
18th Aug 2009, 02:57 PM
I already uploaded some of them :lol: so many people want more clutter!

And yeah I noticed the placement, also influenced by the flags in the OBJD, for example if you flag an object as "small", then no matter what size it actually is, you can even place it on the edge of sinks which is cool.

But many of the props suffer from what Srikandi mentioned above, sinking in the surface.

Thanks again for the solution :)