PDA

View Full Version : Anyway to have two sims occupy one slot?


Hunter240x
18th Apr 2008, 08:57 PM
I posted a while back about having two clickable areas on my object that unfortunately would bring up two separate pie menus. That problem was solved by Echo who suggested adding in Stack Object ID := Stack Object's Lead Tile ID into every bhav. That worked out great. But one of the cool things about having the two clickable areas was that I was able to send two sims to the same slot by clicking on the different areas/menus. I would like to still only have one clickable area on the object but I also would like a way to have the two sims go to the same slot.

Is there anyway I can temporary undo the Stack Object ID := Stack Object's Lead Tile ID command to allow two sims to enter the same slot?

Echo
19th Apr 2008, 04:21 PM
Just have two slots pointing to the same joint in the CRES. That's what happens if you have two OBJDs pointing to the same SLOT file anyway, but having two records in the SLOT pointing to the same CRES location is a much less confusing way of handling it. :)

Hunter240x
20th Apr 2008, 01:00 AM
I'm not sure I know how to do that. I don't know anything about the CRES file except how to change the slot locations. The only thing I see in the slot's CRES file that mentions a joint is the GMDC joint index. And all the slots have the same number listed there already. Also, if you point two different slots to the same joint, aren't you inessence making two slots into one thereby actually losing a slot? Or am I just confused.

Last night I did revert the object back into two clickable areas and added a second Pie Menu Function so I could achive this. That is working out good (altho it's not exactlly what I want) but knowing how to have the two sims go to the same slot would definatly help me out in any future projects.

Thanks for the help Echo.

Echo
20th Apr 2008, 09:54 AM
If you're happy with that, then no problems. If you do want a hand adding new slots let me know and I'll run through the process for it. :)

Hunter240x
20th Apr 2008, 08:22 PM
Right now, I think I'm going to keep the two clickable areas. I'm not sure how difficult adding routing slots would be and I think that by adding slots I'll just have the desire to start over...lol There's only two interactions that I'm questionable on that I may have trouble with my current slot set-up. So overall, if in the end I can't put them in, then it's not a huge loss. But be warned, I may take you up on your offer later on :) Hasn't anyone ever written a tutorial about adding routing slots? I scanned through the tutorials and didn't notice any.

There is one other thing I would like to ask you though. I have a "settings" option that allows players to set up the object how they would like it to function. (don't know if you used the shower I made but it's the same settings).

I would like the settings to affect the entire object but with the object split into two sides I'm running into problems. I use attributes to set the settings and then have the guardian bhavs look for those attributes. If I use the Stack Object ID := Stack Objects' lead tile ID then the settings only affect Side A because the attibutes from Side B don't carry over/get set. Side A natually has the lead tile ID.

I've tried multiple things and the only way I can figure out to have the settings be set for the entire object is to only allow the interaction from Side B with the following command (for a settings function)...

Stack Objects Attribute # := Literal 1
Stack Objects ID := Stack Objects Lead tile ID
Stack Objects Attribute # := Literal 1

So with all that explaining and keeping in mind I'd like to have the Settings option avaible from both sides of the object, is there something I can set the Stack Object ID to so I can have it either point to Side B or include the entier object? Something like..

Stack Objects ID := ??????
Stack Objects Attribute # := Literal 1
Stack Objects ID := Stack Objects Lead tile ID
Stack Objects Attribute # := Literal 1

Echo
21st Apr 2008, 09:42 AM
You'd need to save the tile B object ID into an attribute then use that. :)

Hunter240x
21st Apr 2008, 11:25 PM
I actually had thought of that but couldn't find anything in SimPE that sound like it may let me specifiy what the "tile B" is. And even if I had I probably wouldn't know how to specify the tile. I am kinda assuming that side B does have it's own "lead tile ID", right (because there are 3 tiles on the each side)

Echo
22nd Apr 2008, 09:44 AM
Give that tile a different "init" function, then in the first line set "My Attribute (whichever) := My Object ID". That'll be the object ID for whichever tile is running that init function. There's only ever one lead-tile ID per object.

Hunter240x
22nd Apr 2008, 08:45 PM
(slaps himself) Now that is something I should've known had I not been out of practice. I never even thought about the init function. Okay, off to get that function working so I can continue on with the project. Thanks for the help Echo. I have no idea what I would do without your help :)

Hunter240x
23rd Apr 2008, 04:14 AM
Okay, no luck Echo. I don't know if I'm doing something wrong.

Created a second Init function and attached it to Side B's tiles.

The first line of the orginal Init bhav is "Expression (Stack Object ID 0x0000 := My 0x000B (object id))"

If I edit that command to what you suggested, game time freezes when you place the object in the game.

If I leave that command in and place the command you suggested in front of it I get an error message when trying to change a setting. I get "Reference to tree tree parameter when no parameter exists" It seems as if the bhav can't read the information stored in that attribute (or atleast that's what I'm thinking)

In the Settings Bhav I am using "Expression (Stack Object ID 0x0000 := Stack Object's attribute 0x002D" to try to read the Side B tiles. I tried using "Expression (Stack Object ID 0x0000 := My attribute 0x002D" but that only freezes the sim natually. (I didn't think it would work but had to try). I know I have to refer to Stack Object in the Settings Bhavs or otherwise "My" would be refering to the sim.

Overall, I've tried a varity of things but they all have one of three outcomes. Either time freezes, the object isn't placeable or I get the "Reference to tree tree" error.

I remember you saying in my other thread...

"if you want to track values across multiple tiles in a single object, make sure you're setting them on the lead tile, not the clicked-on tile. (That is, put in a "Stack Object ID := Stack Object's Lead Tile ID" in before you do anything else). "

I'm assuming this is why the information in the attributes aren't being able to be read when I click on Side A. What if I were to insert that into the Init file? Guess I'll go give it a try and see what happens.

EDIT: Nope, but atleast now I'm not getting an error message when I choose the setting. So maybe I'm on the right track.

Echo
23rd Apr 2008, 06:23 AM
Well firstly, I really think you'd be better off creating a new slot at this point. This is getting really very complicated, since you're trying to make a multi-tile object behave in a way that they're not really designed for. But that said...

You don't want to edit the first line, you want to add a new line, probably just before the init function returns true, which saves the object ID into the attribute.

Have you created the attribute in the Attributes text list? You have to have a label for it in the attributes STR#, otherwise the object will be unable to save the value and you'll get something like a "Reference to tree/tree parameter when no parameter exists" error.

It *must* be saved into the lead tile's attributes. That is, the save is something like this:

Stack Object ID := My Lead Tile ID
Stack Object's Attribute (whatever) := My Object ID

Then to retrieve that tile as the Stack Object, you'd need to do this:
Stack Object ID := Stack Object's Lead Tile ID
Stack Object ID := Stack Object's Attribute (whatever)

Also, you'd only want to run the alternative init function for one of the 'B' side tiles, not all of them.

Hunter240x
23rd Apr 2008, 04:08 PM
Perhaps you're right. I thought this would be *simpler* then creating new slots but I still can't get it to work. I do have the attribute listed in the text list. I've tried what you suggested and my own variations based off what you suggested and nothing has worked. It no longer returns an error message so it just seems as if the attribute isn't being carried over to Side A. That's the only conclusion I can come up with. So if you'd be so kind to spend a little more time with me to try to teach me how to add slots I would appreciate it. Or do you know of a tutorial that exists already? Like I said, I didn't see one. I'll have to go through and revert the object back to one clickable area, fix my existing slots, and combine the two pie menu functions back into one. Guess I may as well get started on cleaning up this mess. :P

HystericalParoxysm
23rd Apr 2008, 04:12 PM
The title of this thread makes me giggle in the most immature way, knowing where most of Huner's stuff ends up.

I don't have anything useful to contribute besides immature snickering. Sorry. :giggler:

*runs away*

Hunter240x
24th Apr 2008, 06:01 PM
So I did some searching and found this thread http://www.modthesims2.com/showthread.php?t=143252 which explains how to add slots for dining tables. So I followed it but did a few things differently (that I didn't think I needed to do since I'm not making an extended object) and everything appears to be working fine. Now I just have to get the slots into the right places. It was actually easier then I thought it would be. So now my objects can even get more "creative" lol ;) (puts on evil smile) I didn't see that thread listed in the Object Creation Tutorial section. Figured I'd let ya know incase someone wants to add it.

Again, thanks for taking the time to reply/help me out Echo. Had I known it was so easy to add slots, I would've done it in the first place.

HP, get your mind out of the gutter girl :) I wouldn't choose such a "descriptive" title if it wasn't necessary :lol:

Echo
25th Apr 2008, 12:59 AM
Glad you got it all working. :)