Replies: 0 (Who?), Viewed: 2218 times.
#1 10th May 2022 at 4:51 AM
Thanks: 9220 in 46 Posts
Tutorial: Adding the Claim Painting interaction to custom easels(Not sure if this counts as "Advanced Modding", let me know if you want me to change the category)
This is a tutorial on how to add the Claim Painting interaction to custom easels and canvases, as seen added to the EA easel and canvas in this hack: https://modthesims.info/d/658180/claim-painting.html Someone requested a tutorial on how to do this, and I have the week off work, so here it is.
What you need:
1. SimPE, and some knowledge about how to use it
2. Packages containing custom easels and/or canvases
3. Knowledge of which custom canvases can be used with which custom easels
4. The original claim painting hack from the link above, either version will work
You'll need to modify every custom easel and custom canvas package individually.
Part 1: Modifying the easel packages
Step 1: Open the custom easel package in SimPE.
Step 2: Locate the TTAs (Pie Menu Strings) resource in the package and add the string "Claim Painting" to it. Commit the resource.
Step 3: Look at the list of BHAVs in the package, and sort them all by instance number. We are going to add three new BHAVs to this package, but they need to have unique instance numbers. Aside from being unique in the package, any number will do, as long as it's a four-digit hex number beginning with 1. Note that since we're using hex, the letters A-F can also be used as digits in addition to the usual ones. Look at which instance numbers are already in use and pick three new ones that are not being used by any BHAV in this package.
Step 4: Open the original claim painting hack in (preferably in a second window), and, in the Resource Tree pane, click on G to select groups, and then click on group 0x7F366FCF to select that group:
In the Resource List pane, right click on the BHAV called "Interaction - Claim Painting - TEST" and select Extract. Save the .simpe file in a location you'll remember and give it a meaningful name so that you can find it later. Do the same with the BHAVs called "Interaction - Claim Painting" and "CT - Claim Painting - TEST".
Step 5: Go back to the easel package. Right click anywhere in the Resource List pane and select Add. Use the file browser to navigate to where you saved the three .simpe files you extracted in step 4 (you will see files that end in .simpe.xml in this dialog, but they will otherwise have the same name), and select one of them and click Open. Do the same for the other two files. This should import those BHAVs into the package. For each of these three BHAVs, click on the Resource tab at the bottom of the screen, and there, change the group number to 0xFFFFFFFF and set the instance of each BHAV to one of the ones you selected to use in step 3. Then click commit. Repeat for each BHAV, giving each one a different instance number.
Step 6: Select the BHAV called "CT - Claim Painting - TEST" and go back to Plugin View. Select the only line in this function, and then, in the OpCode box on the right hand side, enter the instance number you gave to the "Interaction - Claim Painting - TEST" BHAV. It should look like this now:
Step 7: Location the TTAB resource in the easel package. Create a new interaction, and set it up like this:
The actual numbers that appear in the boxes for Pie String ID, Action BHAV, and Guardian BHAV are not important, just make sure that you selected the "Claim Painting" string, the "Interaction - Claim Painting" BHAV and the "Interaction - Claim Painting - TEST" BHAV for those boxes respectively. Click commit, and then File -> Save.
That's it for editing the easel package. You'll have to edit all of your other easel packages the same way.
Part 2: Editing the custom canvas packages
Step 1: Open the custom canvas package in SimPE.
Step 2: Locate the TTAs resource in the canvas package and add the string "Claim Painting" to it. Click commit.
Step 3: Locate the text list (STR#) with instance number 0x12F and open it. If the canvas works the way the EA one does, this should already exist. Add the string "CT - Claim Painting - TEST" to the text list. This string needs to be identical to the name of the BHAV that you imported into the easel package and then edited in step 6, I would actually go open the easel package in another window, copy the name of the BHAV, and paste it into the text list. Click commit.
Step 4: Once again, look at all the BHAVs in the package to see which instance numbers are taken. This time we only need to choose two unused instance numbers for two new BHAVs.
Step 5: Open the original claim painting hack in another window, once again click on the G button to sort by group, but this time click on group 0x7F446D21. Go to the Resource List pane and extract the BHAVs called "Interaction - Claim Painting" and "Interaction - Claim Painting - TEST" the same way you extracted similar BHAVs from the easel package. Make sure you give them different names from the files you extracted from the easel package so you don't get them confused.
Step 6: Import those two BHAVs into the canvas package the same way you imported the other BHAVs into the easel package, using Add. For each one, again, go to the Resource tab, set the group to 0xFFFFFFFF and the instance numbers to the ones you identified as being free earlier. Click commit.
Step 7: Click on the BHAV called "Interaction - Claim Painting - TEST" and go back to Plugin View. It should look sort of like this. The third line that calls Run Tree By Name may have a different string in it, but we'll fix that in a minute:
Click on the Test Object Type line. On the right hand pane, open the instruction wizard by clicking on the button with the tool symbol:
In the instruction wizard, change the GUID to the GUID of the easel that will hold this canvas:
Then click Okay.
If this canvas can go on multiple custom easels, choose one of them and change the GUID to that GUID. Then, with the Test Object Type line still selected, check the Special buttons box on the right pane, and then click the Ins/false button. This will create an identical line below the previous line, connected with the red arrow:
With that second line selected, open the instruction wizard again and set the GUID to the GUID of another custom easel that this canvas can be used with. Repeat until you have entered the GUIDs of all of the easels that can hold this canvas. Make sure that the green arrows on all of the Test Object Type lines go to the Run Tree By Name line. The red arrows should go to the next Test Object Type line, and the red arrow on the last Test Object Type Line should go to "F".
Step 8: Click on the "Run Tree By Name" line, and open the instruction wizard. Click on the >> button that is next to the box labled "Tree":
Then select the "CT - Claim Painting - TEST" string from the list. Note that there is a "fun" bug with the Run Tree By Name instruction wizard - when you select the tree, will put the right number in the box, in hex. However, for some arcane reason, this dialog actually wants that number to be in decimal, and won't set it correctly if it's in hex. So, you will have to convert the hex number that puts into the box into decimal. If the number is less than 10, it is the same in decimal and hex, you only need to remove the "0x000" that precedes the actual number and that will be fine. If it's something else, you'll have to do a conversion. Here is a table (sorry, I'm not sure how to format tables here):
| Hex | Decimal |
| 0x000A | 10 |
| 0x000B | 11 |
| 0x000C | 12 |
| 0x000D | 13 |
| 0x000E | 14 |
| 0x000F | 15 |
| 0x0010 | 16 |
| 0x0011 | 17 |
| 0x0012 | 18 |
| 0x0013 | 19 |
| 0x0014 | 20 |
| 0x0015 | 21 |
| 0x0016 | 22 |
| 0x0017 | 23 |
| 0x0018 | 24 |
| 0x0019 | 25 |
I don't think you should wind up with a number outside that range, but if you do you'll need to find a hex converter online, it should be easy to google. When you've converted the number, click Okay.
When you're done, the Run Tree By Name line should correctly have the "CT - Claim Painting - TEST" string in it. Click commit.
If you had to add a lot of Test Object Type lines to this BHAV, and you have other canvas packages to modify that go with the same easels, you might want to extract this new version of it to a new .simpe file so you can import that one instead later on. You can do that by clicking on the Extract button at the top of the pane.
Step 9: Locate the TTAB resource in the canvas package and as before, add a new interaction with the exact same setup as in the easel package. Again, it doesn't matter what the numbers in the Pie String ID, Action BHAV, and Guardian BHAV boxes are, as long as you make sure to select the "Claim Painting" string, the "Interaction - Claim Painting" and "Interaction - Claim Painting - TEST" BHAVs for those fields respectively. Click commit, then File -> Save.
That's all for modifying the canvas package. You'll have to modify all of your canvas packages the same way.
Addendum: What if the custom easel uses the regular EA canvas?
In that case, you'll need to install the original claim painting hack (which you probably wanted anyway), but make some modifications to it. Basically, just open it in SimPE, go to group 0x7F446D21, and edit the Interaction - Claim Painting - TEST BHAV. Click on the Test Object Type Line, and just like in step 7 when adding multiple custom easels, click on Ins/false to add a new Test Object Type line and set the GUID on that line to the GUID of your custom easel. Repeat for any other custom easels that use the EA canvas. Then just commit and File -> Save the hack.