PDA

View Full Version : Custom Craftable Bench


Phaenoh
16th Apr 2010, 6:32 PM
I'm working on making a custom crafting workbench. I started from the robot table and I've successfully cloned and reassigned guids for it. My new table builds robots beautifully, but I'd rather it make custom things instead. What's the next step? I'm looking through the BHAVs to find the guids' of the original craftables, but nothing seems to match up. How does the table call the new object?

Thanks for any help/advice!

Echo
17th Apr 2010, 4:30 AM
Heya Phae,

The crafting tables use the category and subselector fields to find all the valid craftables. It makes craftables "pluggable" in a similar way to TV stations and careers, so you can add new craftable items without hacking the table itself. To change the types of craftables a table produces, you need to go into the various guard functions for Make/Make many, and find the line calling "Interaction - Make One and Make Many TEST". The second parameter to that function is the type of craftables to make available. 0 = toys, 1 = flowers, 2 = robots.

If you want to create your own custom "family" of craftables, clone one of the existing craftable objects (in this case, a robot), then in the OBJD's raw view, set its "Selector Sub-Category" value to an unused craftable code. Then, to make your craft bench detect it, change the second parameter in the function I mentioned above to that new value.

As a word of warning though, I've never actually tried this, I'm just guessing from looking at the code. YMMV. :D

Phaenoh
17th Apr 2010, 5:52 AM
Tried your suggestion Echo (knew you'd be my rescuer here, you always are) but that just resulted in the craft table having no interactions available what so ever. I tried using the number 27 because I think I've seen other craftables from other sites and didn't want to conflict. Maybe there is more to it or I did it wrong? I'm attaching it so you can peek at it easy if you need to. The 'toy lantern' package is a quick and dirty clone of the toy robot with its mesh slashed and replaced (and not properly either). I just wanted to see if I got something different than toy robot.

I get an error when I hover over the object with testingcheats. Object Error, error: Invalid Constant.

Echo
17th Apr 2010, 8:05 AM
Always happy to be the daring knight to modding damsels. ;) Or is it knightess? Knightress? Hmm...

Sorry! I should have said "Literal" then your new value, you don't want the "Constant" data type in this case. :) Try the attached version?

Phaenoh
17th Apr 2010, 5:48 PM
Lol, Echo, you could have said 'SpaghettiCheeseSauce' and I still wouldn't have known my head from my tail but would have dutifully gone looking for it. BHAVing is still some lofty blue sky intangible thing to me.

Ok, I tried that and got some interesting results. I was able to have my smith create my 'Toy Lantern' (got the text strings figured out) but when he was done crafting, it was still a robot. The first time I direct him to make a toy lantern it drops out of the queue. The second time I tell him to go to it, everything starts to work normal except the Toy Robot interface box is the one that pops up. I can name my robot and pick it's color. Is my table recognizing that there is something missing and going to its fallback instead?

I had also wondered if he was just making robots, so I skilled him up to the next badge level, but there wasn't anything else he could make, so on that note we are on the right track.

Echo
18th Apr 2010, 12:14 AM
I think that's more likely to be a problem with the lantern/robot clone than the crafting table. The table creates the object by GUID using the "Selector Sub-category", then it just "Runs tree by name" on a bunch of CT functions in the craftable object.

I suspect self-referencing GUIDs in one of the BHAVs starting with "CT". There are a lot of GUIDs showing up in the lantern, so I suspect one or more of those to be the culprit. SpaghettiCheeseSauce them.

Phaenoh
18th Apr 2010, 2:45 AM
I applied the spaghetticheesesauce process to them changing all instances of 0xB088B05D to 0x00397B4D as I could find in all the BHAVs. No change. Still failed out the first time, then pulled up the robot UI box.

Echo
18th Apr 2010, 9:17 AM
*Tries to navigate through EA code* Dammit EA, be consistent! Grr.

Okay, the table is only half using the selector id. The other half of the time it's loading them from a BCON. Goodness knows why.
So the call sequence in the table looks a bit like this:
Interaction - Make >> Initialize Craft Obj >> Get in Temp 0 & 1 - Object GUID by Craft Obj Type
That last function takes the object type to generate an offset into the BCON "Craft Obj - GUIDs". It then reads the GUID from there.

Now, that "object type" number seems to be coming from the "CT - Menu - Make One" and "CT - Menu - Make Many" functions in the craftable object. The number is getting put into the Stack Object ID just before calling the "Add/Remove Action String" line.

So, in summary, here's what I think you probably need to do:
- In the robot object, find the "CT - Menu - Make One" and "CT - Menu - Make Many" functions. In the line setting the Stack Object ID, change it to point to a literal value of your choice (higher than 0x1D).
- In the table object, import all three of those BHAVs I mentioned from the call sequence above, and the BCON "Craft Obj - GUIDs" and have them fix package references (using the checkbox on the "import semiglobals" window)
- Confirm that the "fix references" worked by looking at the "Get in Temp 0 & 1 - Object GUID by Craft Obj Type". Lines 2 and 4 should be looking at your local const (in the 0x1000) range, not the semi-global const.- Open the imported BCON. Now, take your (literal) number from step 1, and multiply it by 2. Go to that line in the BCON, and put in the second half of your robot's GUID. Go to the line immediately below, and put in the first half of the robot's GUID.

Hopefully that'll stop if from being quite so pesky?

As a heads up, it looks like somewhere along the way the scenegraph for the robot has gotten a bit mangled. The CRES referencing a bunch of SHPE files which aren't there. Might want to keep an eye on that. :)

Phaenoh
18th Apr 2010, 7:54 PM
Ok, all of that went right over my head, except that last bit about the shape and the cres, I did that because there were extra gmdc files I wasn't using. Its all garbled and junky and I know it.

This is looking like it WAY more effort than I want to do for a project that I've already submitted, and to think I'd have to do this 6 more times to get a full set of craftables, no wonder no one else has bothered with this before, its a real pain. This is a real good source of info though if anyone else (or myself who knows) wants to pick up a project like this in the future so I'm glad you read through it for me. From my thread it looks like barely anyone has any interest in lower level craftables, but they all want a non replacement version of the servo. I'm gonna try poking at that for a bit. If we can figure that out, there can suddenly be a whole bunch of different robots clunking through our hoods, and it will be a regular star wars / steampunk / futuristic scene.