View Full Version : Importing semi globals for changing wall adjacency
3rd Jan 2009, 8:44 AM
I'd like to make my sink behave like stoves and fridges in that it will link to the counters when placed near a corner. I have found the counter config and some related bhavs in the stove and fridge semi globals but importing either of them has done nothing, obviously. I'm lost since I have no idea what I am supposed to be looking for and what would need altering for the set up to work. Is this a feasible project or just too complicated for limited bhav knowledge? I'm including the package just in case.
3rd Jan 2009, 10:27 AM
Don't forget you also have to edit the OBJf to point to your new inits and other functions otherwise your object will still be using the semiglobals.
3rd Jan 2009, 11:11 AM
Yes, I have edited the OBJf. Here's my trial package with the changes if you care to have a look at the butchering, (alas, this is a deja vu moment).
3rd Jan 2009, 11:46 AM
Hi, I have Dl'ed your package, and I think that part of your problem may be that you are trying to make a sink AND a counter all in one package. Maxis made sinks to go in counter slots so that you can have a counter that behaves like a counter and a sink that behaves like a sink. I have no idea if you can combine like this, but I think that an additional problem may be that your main and init functions still point to the original semi global functions (sink functions) and as far as I can see your new bhavs are not connected to the init and main, so never get called. When I tested this in game you have no sink functions, and only half of the counter functions.
Continuing to snuffle at object as it looks interesting
3rd Jan 2009, 12:12 PM
This is just a sink and its been uploaded now for 7 or 8 months and works...as a sink. But due to its round shape I had to put it in a "decorative" counter ( a simple subset with no functions whatsoever). Now I'd like it to "link" up with the real counters to make a corner. I don't want any other counter functions.
Sink is the the package already uploaded and sinkBHAV trial is the one that I have truly messed with. I gave it a another guid so both can be tested in game.
I hope thats clear :D
3rd Jan 2009, 12:16 PM
ok, now I get it - I will get the sink package as well as I think that might be better to work with - do you want me to try and get this working or would you rather do this yourself?
3rd Jan 2009, 12:28 PM
I'd really like to do this myself but I shall need alot of help depending on how complicated it is. So, yes if you can tinker with it to see how much needs doing that would be terrific.
3rd Jan 2009, 10:58 PM
Well, I don't have an exhaustive answer to your question, because the problem is complex (and I don't have studied it throughly anyway :P ); however, put in simple words, here is how counters work.
As you know, when you move a counter around the room, the counter itself "detects" the other counters in the room, and changes its own shape accordingly; the other counters do the same, at the same time.
In order to do that, each counter, autonomously, creates a "map" (stored into an array) of the adjacent counters, and updates this "map" continuously, whenever there is a counter that is being moved around the room.
The problem is that each counter includes in its own "map" only the surrounding objects whose category is "counter" (and also, in some cases, fridges and stoves).
If your object is assigned to the category "sink", it won't be detected by the surrounding counters. And if you try to modify your object's category to "counter", you'll have many problems, because the game expects the counters to have specific functions (a surface where to prepare etc), different than sinks.
Solutions? A couple, neither of which is simple, anyway.
1) You can control your sink only, forcing it to change its own shape according to the surrounding counters; but you can't force the surrounding counters to react to your sink. This solution requires that you import in your package the counter semiglobals that manage the array (the "map") of surrounding counters; however, I would be surprised if they'd work without modifications, and I can't imagine - at the moment - which parts of those BHAVs need adjustments.
2) You could create a global mod, modifying the counter semiglobals, and forcing the counters to detect your sink (not all the sinks, or you'll have unwanted side effects). Not an easy task.
3rd Jan 2009, 11:56 PM
I spent quite a while looking at this and as Numenor says, this object is a challenge because it wants to be two things at once; interesting thing though; in the BHAV it asks to check if a certain GUID is present, and that GUID is not in your original sink object, yet the object works - what is that GUID looking for?
Numenor, do you have any idea on this?
4th Jan 2009, 2:26 AM
@buggybooz, the semiglobals you cloned are still refering to [semi] attributes. These would only make sense to counters.
eg. this is what happens when you place your object.
[prim 0x0002] Expression (Stack Object's [semi] attribute 0x0000 ("Base Break Percentage") != Stack Object's 0x0001 (direction))
The sinks 'break percentage' is clashing with counters 'direction'.
So even if you changed the category to counters so that the surrounding counters could read this and adjust their meshes, you've then broken your sink.
This is just the tip of the iceberg. Just one of the modifications Numenor mentions.
There's a huge amount of bhav work to do to make your sink/counter work.
It would be far easier to create two objects; a counter part, and a sink part.
Not sure what bhav you're seeing the GUID check in.
But have you seen the Tools/PJSE/Simantics Resource Finder ?
4th Jan 2009, 3:09 AM
HI Tuna - I did think if buggybooz just really wanted it all to work we could do a graphics change, but that trick soon gets boring. Re finding the GUID, I have enough problems getting SIMPE to load OW - when I try and search for GUID PC stops responding....:(
4th Jan 2009, 9:48 AM
Best to set up two seperate profiles, a full one for using OW and then switch to a cut-down profile for actually doing the modding. Otherwise SimPE has full data from all the EPs loaded into memory as well as possibly all your downloads, and it is just too big in memory to work comfortably.
4th Jan 2009, 12:15 PM
I think I have just one word..."oh". I have fully understood that this is way beyond my reach. Thankyou all for the information.
4th Jan 2009, 12:22 PM
Leester, the CountersGlobals don't look for a specific GUID: the counters are identified by their category. For example, Buggybooz's sink contains a Init BHAV that points to the SinkGlobals Init, that in turn contains a line:
Expression (My 0x003B (category) := Const 0x0106:0x1C ("Sink" Value: 0x001C))
This is how the "category" is set for any object. You can change it, but as said, it's like opening Pandora's vase :lol:
4th Jan 2009, 1:12 PM
I have a quick question regarding another option. Sinks that are placeable in counters use a "cut out" like the wall masks for windows. Would it be possible to make a custom cut out that my sink could reference?
4th Jan 2009, 3:57 PM
Yes, but you need to add a "mask" to your package. SimPe doesn't pull it automatically, because - back at the time when the Object Workshop was developed - we didn't know about the existance of the mask at all.
I suggest to extract a mask (TXMT and TXTR) from the game files; any mask is good. Here is how to preceed:
In SimPE, select the "finder" tab; choose Type: NameMap and Match: sinkcounter; click Start and wait.
When the file list is displayed, double click on sinkcounterclub_sinkmask_txmt and wait a moment: the game package containing that TXMT will be automatically loaded.
Extract the mentioned TXMT and save it on your disk.
with the same method, extract the files: sinkcounter-club-mask_txtr, sinkcounter-club-mask0_lifo and sinkcounter-club-mask1_lifo.
Load your package and load the 4 extracted files into it.
In all the four filenames, replace the "sinkcounterclub" part with "sinkysinknewedition-[buggyb-31.12.2008-d1336]" (so to match exactly your CRES name).
When done, perform a "Fix Integrity": it will fix the TGI values of the 4 imported (and renamed) files, and will merge the TXTR and the LIFOs into one single resource.
Last step: edit the mask image to match your sink's shape. IMPORTANT: don't modify the dimension of the image and leave alone the lower half of the image itself; just edit the shape of the hole in the upper half of the image.
4th Jan 2009, 5:12 PM
This is a perfect solution. You are awesome, thankyou.
5th Jan 2009, 10:29 AM
I have cloned a new countersink and followed the steps described above but the sink is still referencing the in game mask. I am including the package just in case I missed something.
5th Jan 2009, 3:37 PM
Perhaps the sink masks are picky...
What I have written earlier was based on an observation of the game files, but I never created a custom sink anyway.
Maybe the problem is that the game looks for the sink masks only in the general scenegraphic GroupID, i.e. 0x1C0532FA. Try changin the GroupID of the mask TXMT (not the texture) from the current 0x1C050000 to 0x1C0532FA.
Using the general scenegraphic group is not something I see with favour, because it's somewhat like "invading" Maxis' reserved space, but if this is the only way to make it work, it definitely worth a try.
No, wait! I've discovered something new.
Don't change the GroupID as I suggested above. Instead, select the CRES, Hyerarchy tab, and select the node "objectCutout". I didn't know it existed! It's obviously related to the counter cut-out.
The node contains a reference to "sinkCounter-loft-mask", i.e. the old Maxis mask; replace it with:
and I'm quite sure it will work (crossing fingers :P )
5th Jan 2009, 7:34 PM
I got really excited...thinking yes, this is it and then in game unfortunately no cut out at all. I guess there is still a missing link somewhere within the package. Any ideas?
5th Jan 2009, 9:11 PM
Then let's back up to my older idea: the general scenegraphic group.
Change the GroupID of the mask TXMT to 0x1C0532FA, then go to the reference in the CRES and delete the "##0x1c050000!" part (this way, the game will automatically search for the file in the general group).
However, I'd like you to post here the package before doing these changes.
6th Jan 2009, 8:54 AM
Ok, here's the package so you can check through to see if I've missed a step. *crosses fingers*
6th Jan 2009, 11:23 AM
Bad news. It doesn't work, even setting the groupID to 0x1c0532fa. There must be something else that I still haven't discovered, but I couldn't find anything interesting in the CRES or in the other resources.
7th Jan 2009, 9:44 AM
Grrr indeed, its fustrating to think that you're so close and then...not. Thanks for trying:)
7th Jan 2009, 3:05 PM
I was still thinking to this sink... Are you the very first modder who creates a custom sink with a different shape? Or maybe there are, on the Net or even MTS2, some working custom sinks?
If so, maybe some sinks can be cloned and some other can't...
8th Jan 2009, 5:14 PM
I looked at this yesterday and then I started looking at the downloads here and searching elsewhere and so far I haven't found any in counter sinks that would seem to use new masks.
Actually I thought of another solution last night and I can't believe its taken this long to find it. It is not particularly eloquent but it will work. My counters have invisible recolours for both subsets so as long as I include just a countertop section with the sink I can pretty much make any shape I want. The downside is that it will be limited to only my kitchen set. I've been testing and it works.
If you do stumble across sinks that use custom masks please let me know:)
8th Jan 2009, 10:46 PM
You too! :D And that's a clever solution anyway; after all, it'syour sink and your counter :P -
11th Jan 2009, 1:53 PM
I've been working on them, they are finished though not uploaded yet and I just wanted to show the final results:http://www.modyourpanties.com/hosting/4689_090111083144use-of-sink.jpghttp://www.modyourpanties.com/hosting/4690_090111083241sinkoptions.jpgI would never have thought of this simple solution without you Numenor :lovestruc
11th Jan 2009, 4:54 PM
Excellent! :D Just a couple of suggestion (let's pretend we are in the Creator Feedback forum :P ).
In the last screenshot (top row, frames #2 and 3; bottom row, frame #3) the profile of the sink is quite narrow, and it's odd NOT to see any plumbing peeking beneath the sink. Maybe you could add it, the game already contains some good meshes for that...
Still in the last screenshot, bottom-right frame, the gray wood seems too uniform and dull; perhaps it's just the snapshot that it's too dark, but maybe it requires a better texturing?
Hope you don't mind if I give you some "aestethical" suggestions, but I know what the other moderators look at, when approving stuff.
11th Jan 2009, 7:26 PM
I'm happy to pretend its the Creator Feedback forum:)
Here's a clearer picture of the sinks in the normal counters:http://www.modyourpanties.com/hosting/4700_090111133055Sans-titre-3.jpg Ignore the middle sink since that uses a normal mask. I thought it would be nice to give people more options than a simple in counter sink.
I did actually think of plumbing but was not sure whether to add it or not since most people I presume would not think of recolouring all these extra bits which are the recolourable parts of the sink: countertop and counterfinish. All this remains hidden in the big counters and adding plumbing will add quite a few polys. So I am still in two minds about this. I do see what you mean by too narrow.
As far as the colours are concerned they are taken from the counters (which did get approved :giggler: ) so it will be up to the individual to decide what colourschemes will work best for them; there are plenty of possiblities already out there so I don't think it's a major concern. To answer your query though, yes that particular recolour is quite uniform and dull and I should not have used it as an example, silly me :D
11th Jan 2009, 8:02 PM
This screenshot (along with the depicted content ;) ) ip perfect. When I said "too narrow", I was referring to the sink without counter, with a simple frame around; the one with the gray legs and the similar one in lightwood: these are the ones that allow looking underneath, and would require a visible plumbing, imho. If the Maxis plumbing is low-poly, there's no reason for not including it, I guess.
12th Jan 2009, 8:35 AM
Oh I LOVE that undermounted one!
13th Jan 2009, 10:18 AM
Thankyou. I am a bit stuck now though since I am now slightly fixated by the void of the plumbing. I got rid of the "counterfinish" part of the sink since that was too complicated so now there is only the countertop subset included.
Numenor, which maxis plumbing are you referring to? The eps I have don't have a single sink with plumbing present, in fact one sink in particular has taps that produce water out of nowhere. Googling "stylish plumbing" didn't get me the desired pictures I was hoping for:)
Inge, I'm presuming you are referring to the sink that I said should be ignored:)
Since I am not uploading officially yet I'll include the sinks plus the other neccessary bits for testing purposes (only the narrow counter(no4) will effect what happens beneath the sink. I was also wondering if the description for using them is clear enough because I don't really want to be bombarded with a thousand questions.
13th Jan 2009, 11:17 AM
Yes but I couldn't ignore it, it looks so real.
13th Jan 2009, 11:32 AM
I'll gladly take that as a compliment:D although I think maxis lighting is also partly responsible.
13th Jan 2009, 4:37 PM
Buggybooz, try placing a normal Maxis sink on the wall-mounted counter that comes with University; the plumbing (that is part of the counter!) will appear underneath.
Clone the UNI counter and extract the plumbing from the "counteronly" GMDC.
13th Jan 2009, 5:24 PM
Looking in the rightplace always helps, cheers.
vBulletin v3.0.14, Copyright ©2000-2019, Jelsoft Enterprises Ltd.