View Full Version : Does anyone know how to add slots and routes to an object?
Targa
19th Oct 2005, 06:01 PM
Trying to figure out how to add slots to an object to make it useable by more than one Sim. Added routing and slot info to the CRES and SLOTS files, but that doesn't seem to make any difference. Anyone know what tells the game how many Sims can use an object, and makes them use the secondary routing and slot? Thanks!
-T
Crammyboy
19th Oct 2005, 06:35 PM
I know there is a text list instance 0x0101 which contains the names of the slots in the resource node. I think the slot number referred to in-code is a pointer to this.
Inge Jones
19th Oct 2005, 08:16 PM
But I wonder how you stick one onto an object? Like "x marks the spot" - you don't see them in Milkshape
Crammyboy
19th Oct 2005, 10:10 PM
They are defined in the resource node.
Inge Jones
19th Oct 2005, 10:39 PM
Mmm yes, I wish I knew what euler and stuff meant. Joints are slots? Is that the same as bones?
Crammyboy
20th Oct 2005, 12:26 AM
It's more like slots are connected to joints.
Take for example the wedding ring that a sim wears. The slot is attached to the finger, and the ring is placed into the slot. The slot will move with the finger,hand,arm,etc.
Euler is just a way of representing a point in space, based on current position.
You would rotate a bone (between two joints) about each axis in turn, at the end of which the bone is in the desired position. Normally the rotation is applied as XYZ but can be any combination. In the sims 2 it is applied as XZY.
Inge Jones
20th Oct 2005, 07:32 AM
I hope this thread stays open, and people can add to it from time to time :)
SnowStorm
20th Oct 2005, 01:50 PM
Ok these are the notes I have on slots. They are by no means complete and may not work for all instances. They also are for decorative slots, so I don't know if you can use the info for other slot usage.
1) Clone the item
2) Remesh the item
3) Find the X, Y, Z location where you want the new slots to go.
Update the Text Lists
4) Click on the text lists, select 0x90 - Model - Bones. If it doesn't exist you will need to import it via the import semi-globals.
5) "Add String" two times
6) Set the first new string to slot_left
7) Set the second new string to slot_right
Update the CRES
8) Select an appropriate node to be the parent. If there are other slots, it's possible you can use it's parent. Each item is different.
9) Add a cObjectGraphNode (trans) for each new slot.
10) Select the new cObjectGraphNodes from the block list
11) Change the filename to slot_left and slot_right
12) Change the translation x,y,z to where you want each slot to be.
13) Select node you want as the parent to the new slots in the block list.
14) Link the new slots nodes to the parent node. Add an entry to the Child Nodes for each new slot.
15) The UnKnown 1 should be set to 0x0001 for each. The child Index will be the index number for each new slot as showin in the blocklist drop down.
Update the Slot File.
16) In the slot file add a container type for each new slot.
I9 is the text list position converted to decimal.
Not sure what the rest are. Usually populate with values i already had.
Update the init bhav
You need to update the support strength of the object.
Add a line My 0x001c Assign To Literal Value 0x0032
For rotation in the cres, if you are rotating on a single axis it isn't too bad, put 1.0 in the axis you want to rotate, and the number of degrees in the degree box. If you are going to rotate on more than one axis it will require some calculations. I found these programs:
Dizzy & Spin Doctor (http://www.vapourtech.com/) (unfortunately I just checked and their site seems to be down)
Degree/Radian Conversion (http://www.mathwizz.com/practical/page6.htm)
Inge Jones
20th Oct 2005, 03:23 PM
Thanks SnowStorm! I have dedicated the last half hour or so to exploring a chair with your message as a guide. I won't post a question until I think I have a half way intelligent one :D
Targa
20th Oct 2005, 08:11 PM
Thanks for the replies. :) If this ever gets completely figured out, it needs to be rewritten as a tutorial. Very helpful info SnowStorm, but it didn't work for me. That appears to be only a part of the process, probably depending on the object.
Some things I noticed:
Your new route needs to be made a child of your new slot.
In the Slot File, Integer 10 appears to be the "physical location" of your Text Lists: bones items. In looking at a shower, bed, and table, they all seemed to follow Integer 9, except bumped up by one. So 0x0000 in your Text List Bones should be value "1" in Integer 10, and so on.
Also noticed in the table and bed that it appears BHAV programming is needed to tell the Sims which route and slot to use. The BHAV's have checks they run through, and send the Sim to the appropriate slot via 0x002D (go to routing slot). The table has an "Is Slot Empty?" BHAV, and a "Slot-In Use-Set" BHAV among others. It's beyond me... :)
-T
jaxad0127
29th Oct 2005, 04:29 AM
I had a look at several tables and they only had two bhavs (int and main). Also, Int 10 wasn't always one more then Int 9. Which table did you look at?
Inge Jones
29th Oct 2005, 08:28 AM
jaxad, the remaining BHAVs needed will be on surfaceglobals or whatever it's called. If you look in your table package there will be one or more OBJf files, one per tile of the table. If you look in those you will see entries for things like "Surface" or "Pick up from slot". Against those will be BHAV numbers for what to run as those events. They will probably refer to semi-global BHAVs that apply to all tables of that type.
Numenor
29th Oct 2005, 09:09 AM
I'm not very experienced in BHAV modding, but I think that the game manages the slots automatically, once you have added them; i.e., if the sim has to put a newspaper on the table, the lot is scanned for tables with free slots (and the scanning will include your new slots), and then the sim is routed to the first empty slot found.
Inge Jones
29th Oct 2005, 09:32 AM
Numenor, this definitely was not the case in Sims 1, and hasn't been my experience with Sims 2, where I have successfully prevented Sims putting bills and other items on a hacked desk merely by disabling the functions in the function table. I have done quite a bit of work in the functional area and have not observed anything to make me doubt this theory.
Numenor
29th Oct 2005, 06:12 PM
Sorry, I wasn't clear...
Obviously, the function of finding a free slot and routing the sim to it is done via some BHAVs; but I think (I may be wrong) that those BHAVs are capable of automatically spot and use the new slots added into a custom object. If I'm right, there's no need to edit any BHAV, after having added a slot to an object: the game will be aware of it without further intervention by the modder.
jaxad0127
29th Oct 2005, 07:39 PM
jaxad, the remaining BHAVs needed will be on surfaceglobals or whatever it's called. If you look in your table package there will be one or more OBJf files, one per tile of the table. If you look in those you will see entries for things like "Surface" or "Pick up from slot". Against those will be BHAV numbers for what to run as those events. They will probably refer to semi-global BHAVs that apply to all tables of that type.
Sorry, I forgot to look at the object functions.
ebruere
4th Nov 2005, 08:29 PM
I agree with Inge : Testing the slots is not automatic.
When you call a "find best object for function" the game will call the guardian of this function for each available object. The guardian has to check the slots.
Numenor
5th Nov 2005, 03:18 PM
Ebruere, we are saying the same thing :)
Testing a slot is not automatic, but using a free slot is.
If I clone an end table (that has only one slot) and add a second slot, along with its route, I don't need to modify any BHAV, nor local nor global: the new slot will be checked and used either in autonomous and in user-directed interactions, because the surfaceglobals (guardian and action ones) are already capable of managing the newly added slot.
Fat D
9th Nov 2005, 09:27 PM
I added a surface slot to a tub, but now the sims can no longer use it. it is placed onto a seperate OBJd in the main CRES. The slot was taken from an original coffee table. does the name have to equal the function (coffee table)
Numenor
10th Nov 2005, 12:14 AM
Do you mean that you want to add a container slot, where the sims can put object on?
In my experience, if a slot can contain objects picked from the catalogue, it doesn't necessarily mean that the sims can use it; if a correct routing slot is provided, the sims can pick objects from the slot, but if you want e.g. that they put the newspaper on that slot, some other elements are involved, among which the "surfacetype" attribute.
The name of the container slot should be irrelevant, as lon as the name in the CRES is identical to the one in the Text List.
ebruere
10th Nov 2005, 02:03 AM
You need the anims for the objects, and the CT-Reach-Grab and CT-Reach-Put bhav functions that call these anims in the object's code, the CT-Route-to-Reach for the surface object, a pie menu string and function for the surface object with "Put" option,
another pie menu with "Get" for the object.
Some objects already have code for additionnal slots, but it's not as automatic as it could.
Fat D
10th Nov 2005, 01:30 PM
i did not change the tub slot in any way and i don't want my sims to use the slot.
EDIT: Adding the slot to the existing slot file works better.
suceress
9th Mar 2007, 11:43 AM
Does the number of slot files matter?
I'm making a 3 tile surface out of a dresser (yes I'm STILL trying to get this to work). I got it to work pretty well except for a bounding mesh issue. I made 4 different slot files and had the slots for each tile in the different slot files. I'm wondering if it would work if I just put all of the slots into a single slot file, would it work?
I suppose I could try it and find out, but I was wondering if anyone else happens to know.
Echo
9th Mar 2007, 12:21 PM
Wow, old thread!
If you put all the slots in the same slot file, then changed each OBJD to use that slot file, then yes, it would work. It may not work quite the same way though.
If you think about the way the sofas work, there is a different slot file for each "seat" tile. Depending on which tile you select a sim to sit on, the sim will respond by looking for the slot in the SLOT file for that tile (OBJD). If you had all tiles pointing to the same SLOT resource, then I have a feedling that regardless of which tile you select, the sim will always pick the same slots in the same order. (That is, the first available slot according to the shared SLOT resource).
The other thing to note is that sims will most likely not be able to use all the container slots if they're part of a "surface" like a table. Most of the "surface" function calls only expect one sim-friendly slot per SLOT/OBJf pair, and will ignore any additional slots added to it. If you add them via multiple tiles, then each OBJf's surface functions will be pointing to a different SLOT resource, and consequently to a different slot. :)
Did that make any sense at all? It makes sense in my head, but my words seem to be coming out all muddled today. :(
suceress
9th Mar 2007, 12:54 PM
Wow, old thread!
If you put all the slots in the same slot file, then changed each OBJD to use that slot file, then yes, it would work. It may not work quite the same way though.
If you think about the way the sofas work, there is a different slot file for each "seat" tile. Depending on which tile you select a sim to sit on, the sim will respond by looking for the slot in the SLOT file for that tile (OBJD). If you had all tiles pointing to the same SLOT resource, then I have a feedling that regardless of which tile you select, the sim will always pick the same slots in the same order. (That is, the first available slot according to the shared SLOT resource).
The other thing to note is that sims will most likely not be able to use all the container slots if they're part of a "surface" like a table. Most of the "surface" function calls only expect one sim-friendly slot per SLOT/OBJf pair, and will ignore any additional slots added to it. If you add them via multiple tiles, then each OBJf's surface functions will be pointing to a different SLOT resource, and consequently to a different slot. :)
Did that make any sense at all? It makes sense in my head, but my words seem to be coming out all muddled today. :(
Ahh! Ok. That makes perfect sense to me! Thank you!
*hugs*
wndy26
8th Oct 2007, 01:23 PM
I have been following this thread and have a few questions about slots. I am working on my Ticket Booth Window and have added a ledge to both sides of the window. My intention is to have a slot available for the NPC sim who is working the booth to set the ticket on the ledge and the sim buying the ticket to pick it up (from the other side of the window). My window has 3 OBJD's (I believe one is the master and the other two are the tiles - front and back - pls correct me if I am wrong) and two OBJF's that correspond to the front and back tiles (I believe). How would one go about allowing the ledge to be a surface? Would I need to add another footprint and slot - set the slot location to the ledge? By adding another footprint and slot - I could then add another OBJF and OBJD - is that right? Then I could use that slot to allow the interactions. Please tell me if I am way off. The Ticket Booth Window is cloned from a single tile window.
The more I think about how the window will work - I keep thinking maybe I should use a counter base instead of a window base for cloning. I found where Delphine created a working bar on a wall and will be disecting this to take a look at how it was created. This may give me better insite into getting the functions I want for my ticket booth.
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.