Carrigon's Sims2
Basic Hacked Object Tutorial
For the Beginning Hacked Object Creator
Please
do NOT repost this tutorial anywhere. And please do NOT hotlink the pics.
Basic
Simantics Modding Tutorial
by Carrigon
Many people have asked me how to make a hacked object. There was never really an easy answer simply because there are so many things you can do with the codes and so many things to know. What I'm going to do with this tutorial is to teach many lessons packed into one small, simply coded object. I'll explain why the codes work and how you can change them to suit your own needs. I'm giving all of you these codes that I wrote specifically for this tutorial. You can use these codes in your own objects on your own sites, including paysites. All I ask is that you do NOT repost this tutorial anywhere, and it would be nice if you gave me some credit for teaching you how to do this. Also, please do NOT PM me or otherwise bug me if you get stuck or are working on another project. Please just post to the help forum and someone will help you there.
I'm including one Oriental Pottery Maker object and one Oriental vase that it will bring in this tutorial. This object allows a sim to walk to it, do an animation, do a reaction, and have an object either appear on the ground near the sim or have three of them appear in the sim's inventory. It also shows you how to add sound to an object. All very basic codes that you can easily customize for your own needs.
So, to begin, you will need the objects in this tutorial, all the screenshots I'll be adding, and the following: Make a copy of your objects.package file. We'll be working off that to get different codes. I have OFB with FFS installed, so my objects package is found here: C:\Program Files\EA GAMES\The Sims 2 Family Fun Stuff\TSData\Res\Objects
Copy that file and place it someplace safe on your drive. Only work from that file, NOT your original.
You will need the latest copy of SimPe from here: http://sims.ambertation.de/en//
This tutorial assumes you can already clone an object and put your own meshes into. It doesn't matter if you can't, you can just change the GUIDS on this one and recolor it, since I'm giving it to you. I cloned a Venus Statue to make this. Then I took a plain square table and used that mesh for the base, just a dining table. And I used a vase for the top piece. You can find all kinds of meshes here at a free repository. In fact, many of the objects you've already seen people making have come from this site: http://www-c.inria.fr/Eric.Saltel/download/download.php
Download this project's tutorial objects here:
This is the file for those using EP's up to OFB:
Carrigon_OrientalPotteryTutorialObjects.rar
If using PETS or SEASONS, you will need the updated file from the Dinnerbell thread:
Basic Modding Tutorial at Dinnerbell
I'm going to begin the tutorial by explaining how the codes work and how you can change them. So, open the file Carrigon_OrientalPotteryMakerTutorial1.package with SimPe. And look at screenshot one.
On your left you see I have the BHAV highlighted, click that. On your right you see I have a list of the BHAV's in the top window. Click the one I have highlighted. It's instance 1003. Then click the first line, the one I have highlighted that talks about direction. This is your basic walk to code. It works with most objects. Look on your right at the Operands where I have the tiny box circled. See how it has a value of FE? Try changing the value to FF, then look at your code line. Do you see how it now changed from Facing the object to Facing in Any Direction? That's how you change how the sim faces an object once they have walked to it. Change the value to 01 and see what happens. Your sim will be facing a 45 degree angle. You can experiment with this all you like, there are different operand combinations, just change the value till you find one that suits you. When you're done playing around with it, change the value back to FE for this tutorial.
Now, look at screenshot two. I'm going to talk about animation strings and I am going to show you how to change them and where to find different ones.
Just highlight line two like I did in the picture. Now look to your right at the little boxes I have circled. The first box I have circled is your animation. The second box I circled tells the code to look for TXT instance 81. So, we're going to go to screenshot three and I'll show you how this is connected in the file.
Look at screenshot three.
Look on your left. See how I clicked on TEXT LISTS? Do that now. Look on your right to see the list of Text Lists. Look down till you find the one I circled with Instance 81. Click on that one. Do you see the animation strings? See the one I circled has a value of 0 since it's the first one. That matched the first box I circled in screenshot two. Do you see the other animations listed under this one? To change the animation, all you would do is to change the value in the little box I circled in screenshot two.
Where do you get different animation from? Easy. Just clone an object that has something similar to what you want, like in this case, an OFB Flower Station. Then just copy the string exactly as you see it there into your file. It is case sensitive. Most all adult animation have an a2o- in front of them. The bookcase animations are very good to use because they have how a sim reaches for something. There's a high, middle and low reach in there. When changing a string, always click Commit when finished and then go to file save. Now, lets go back to screenshot two.
Just click on lines two and three and look at the first little box I have circled. See how it changed animations? That should be all you need to know to do different animations for your object.
Now, look at screenshot four.
We're going to talk about sim motives and how to manipulate them. Lucky for us, PLJones' plugin has a very powerful little popup box you can use to change the motives. Click on line four the way I have. Now look on your right and click that small tool icon. See the box popup? It has wonderful little dropdown boxes you can use to change the motive from fun to energy or hunger or anything else you like. Just click on Fun and scroll about. Try clicking on social and then click Okay. See how it changed in your code line? Click the little tool icon again and let's talk a bit more about just what this popup box does. Look at the line that has += That is how you are adding motive points. If you click on that and change it to -= you will be taking away motive points. Very easy, right? Now, look at the part that says 0x0010 That is how many motive points you are adding or taking away. So when you are in the game, the green bar would go up ten percent if you were just adding to it, or it would go down ten percent if you were taking away motive. This value can be changed. You can do pretty much any value, but it has to be done in BinHex coding, which means 0x0064 is a hundred percent. Just confused you, didn't I? Look at Screenshot five and I'll show you how to figure out the value really easily.
In screenshot five, see how I've clicked on the BCON on the left and given a list of BCON's on the right? Click the one I have highlighted. Now look at the little value boxes I have circled. You can use this to figure out a BinHex value really fast. See how the 0x0064 is showing 100? Put a minus in front of the hundred and see what happens. You should now have 0xFF9C That's the code you would need to drop your sim's motive to full red. You can play around with this a bit, but don't click commit, don't change this BCON permanently. When you are done with this area, go to screenshot six.
In screenshot six, look at line five. I'm going to talk about sim reactions and where you can find some. Reactions are just another form of animation. They usually start with a- or a-react. I took mine from the toasting set. Reactions are done the exact same way as animations, which I've already explained. How to find more reactions. You need the objects.package file that I asked you to copy. Open it with SimPe, wait for it to fully load. Click on the text lists on the left, then look on the right for a2o animation strings with the same instance of 81. See screenshot seven.
This is also the same area that you would look for new animations to use. Just click on different files in here in the upper box and you'll get all kinds of lists.
Go to screenshot eight and we'll talk about what the last two lines of code are doing.
Line six is "calling a private" What that means is that it is telling the code to go to BHAV 1004 and do something. We're going to skip that for a minute so I can show you how to do sounds with line seven. So just click on line seven and look at operands on the right.
The sound code works very much like the animations I showed you. It points to a Text List of instance 4132. Most all sound files have that instance. And they can be found the same way I showed you with the animations, you would open the objects.package and click on Text Lists, then just scroll all the way down till you find files listed as instance 4132. You will find lots of game sounds in there.
Look at screenshot Nine.
See how I clicked on the Text Lists on the left and we're back looking at Text Lists on the right? Click the one I have highlighted, the sounds. It's instance 4132. See how it's just a string like the animations? It is case sensitive just like the animations. When you change this make sure it is copied exactly. See how this one has a value of 0 and back in screenshot eight our operands also pointed to 0, the little box I circled. That's how it is linked.
Let's move on now to the Private code line six was pointing to and I'll explain what that's doing.
Look at screenshot ten.
We're back at the BHAV's and we're in instance 1004. Click on line one. That's the attribute line. Let's talk about what that does and why.
Many times in simantics you will see attribute codes. Attribute codes are actually some of the most basic programming you will ever see. When we assign an attribute to something we are telling the code this, in very basic layman's terms: "If my shirt is colored red, make one vase and place it on the ground near me" "If my shirt is not colored red, put the object into my sim's inventory". So what you are doing is assigning a number value instead of the shirt analogy I used. You're saying if my attribute is zero put it on the ground, but if my attribute is not zero, put it in my sim's inventory. So, look at the code line and look at the true and false values. How do these work? What we're saying with this code line is, if it's true go to line one. If this isn't true that my shirt is red, go all the way down to line 5 and do that instead. Does that make sense?
Okay, same screenshot ten, look at line 1. Create Object Instance. And you see the GUID. Let's talk about what that's doing. That is the vase GUID, the object this object "makes". I'll explain more of that later. Let's walk down the list of codes first. Look at lines 2 and 3. Find location for and Fade in are your basic summoning codes. It's just telling the code to put it on any unused tile and summon it on in. Line four is just a basic dialogue popup. Line five is creating the object again, only this time the lines under it are saying to put it directly into the sim's inventory. And then popup another dialogue.
Let's go to screenshot Eleven and I'll show you how to change the GUID. You can basically put any object you like here if you know the object's GUID.
In screenshot Eleven click on Line 1. Now look at the operands on the right. See where I circled the GUID? See how it's typed in backwards in groups of two? All GUIDS are typed in this way. So, if you wanted to add a chair or a teddybear, just change the GUID from here. Remember to click commit and file save afterwards. You would do the same thing with Line 5. Line 5 is the one that will lead right into your sim's inventory. You can add anything to it just by changing the GUID.
Now, let's talk about how to do the dialogue codes. Go to screenshot Twelve.
In screenshot Twelve we're on line 4. Look at the little box I circled in the operands. That's the string it's pointing to. Dialogue is done just like the sounds and animations, there's a Text List file for it. So, go to screenshot Thirteen and I'll show you where.
In screenshot Thirteen we are in the Text Lists. Instance 12D is almost always dialogue of some sort. Now you can see where the operand box I circled was pointing to. You can change your words here. The next line is for the other dialogue code line in the BHAV. They're done the same way, except each one is pointing to a different line of dialogue with that little box I circled.
Go to screenshot Fourteen.
This is the main code your menu will call upon to Make One Vase. What this is saying is, "My shirt is red, so go stand in front of this object and go to BHAV 1003 to make one vase." Very simple. See how line 2 is saying Private 1003 and you can see it's going to that BHAV?
Go to screenshot Fifteen and I'll show you where this is in the Pie Menu.
To get to the Pie Menu, click on Pie Menu Functions on the left. Click the pie menu on the upper right and you're here. Look at what I circled. See how your menu choice is pointing to BHAV 1005? That is how it links to your code. We're going to stay at the Menu for a few minutes and I'll show you a few other things.
Look at the Autonomy that I circled. The higher the number, the LESS your sim will want to use this object. The LOWER the number, the more they will want to do it. I have it set for 32, which is pretty high. If you wanted to make this more addictive, set it to sixteen. Now, go to screenshot Sixteen and I'll show you how to really make it addictive.
For screenshot Sixteen, all I did was click the Motive tab. We're still in the menu. Use the scrollbar on the right to scroll down and see where I'm at. See how I'm pointing to the Fun values? I used the same fun values that the Alienware Computer had for playing the video game. That's how I got those numbers. It makes it pretty addictive. You can experiment with different number values to see how addictive you can make an object. You can also put the values into different motives here. Like if you wanted to make a hungry sim use this, just put the values into Hunger and so on. Click on Copy Motive to all and it will set the values for each age group for you. Remember to click on Commit and go to file save to save any changes you choose to make.
Go to screenshot Seventeen.
This is how to change your Menu's words. You can change them to anything you like. Let's talk about why there's a .../ in the lines. The triple dot with a slash is what creates your submenus on the Pie Menu. So you would see in game: Make One... Make Many... and from there you can click on other choices.
Go to screenshot Eighteen.
Let's talk about this BHAV instance 1006. How is this different? Line 0 has the attribute listed as 1, see where my arrow is pointing. So, we'll go back to the shirt analogy, "My shirt isn't red, it's blue, so go stand in front of this and then go to BHAV 1007 and do something". Line two is pointing to our very last BHAV, instance 1007. And that one is telling the code to make three vases.
Go to screenshot Nineteen.
What did I do here? We're in the last BHAV instance 1007. All I did was take the codes from BHAV instance 1003 and I duped them three times. How do you clone a code line? See the little Add button on the right? Just click a line you want to dupe and click add. It will add one. However, you cannot just add any unlinked line. You must link them with the true and false values. See how each line is going to the next line? Like one, two, three, four and so on? You always have to have a line liked to other lines like that. You can't just add a line and not have anything linking to it. So, you'd have to link them all with the true and false values set for each consecutive line. When you get to your last line, you can "close" the code by just putting a value of True and Error on that line. So that last line would basically be saying do this line and don't go anywhere. The true and false targets on your right have drop down boxes so you can set for true/error or you can just type in your line code.
Just a few more quick lessons. If you clone the Venus Vase and you find you don't have a pie string. Go to screenshot Twenty.
Right click on mine, click Extract. Then, when in your own file, right click the white area where I have the words Right Click in this screenshot and choose Add. It will add your pie string in. A few more steps to get a working Pie Menu. See Screenshot Twenty-One.
In screenshot Twenty-One we are setting the Pie String Instance to Match the Pie Menu Function. Here they must both be 83. Look at the bottom of the pic, see how we're in the Resource Tab? Make sure to click Commit when done.
There is one more step for making the Pie Menu work. See screenshot Twenty-Two.
For screenshot Twenty-Two, we are clicking on Object Data. Make sure you are in the PlugIn view tab that's at the bottom of your screen. Now, click on the Raw Data tab like I have in the screenshot. Scroll down to Interaction ID. Set this to 83, just like I have it. Now you will have a working Pie Menu.
Stay in the Raw Data, I'm going to show you how to set your object for showing up in the Community Catalog. Go to screenshot Twenty-Three.
In Screenshot Twenty-Three, scroll up to where I'm at. Set the Function Subsort for a value of 1, just like I have it. Set the Community Sort to 81. Make sure you are in Hexadecimal when you set these values, see where I circled it?
And
that's it for this coding lesson. It should give you enough knowlege to
change this object into whatever you wish it to be. I've packed alot of
lessons into this. I hope you now have a much better understanding of how
some of the Simantics codes work and why they work. I look forward to seeing
all the new objects you will all make. Yes, you can use these codes in
any of your own creations, freely. Yes, you can put your new creations
on a paysite. Yes, you can clone this and change the GUIDs, but please
give me credit for teaching you how.
Carrigon
BEFORE contacting me: Read any readme's that came with the files. All package files go into documents/EA Games/Sims 2/Downloads, unless otherwise indicated as with the Buyable Rewards which go into collections. Backup your entire Sims2 folder before installing anything. If you don't, and you mess up your game, don't bother contacting me. If you still need to contact me, I can be reached at the Subterranean Spoiler Realm board, just leave a message in the Sims2 folder. Do NOT leave a message in the chatbox at the bottom of the board, it will be deleted.
DISCLAIMER: Often times, friends send me graphic files to be made into Sims2 files. I have no idea where the graphics orginated from. If you ever feel something is yours or you didn't get proper credit, please contact me with proof of ownership and I'll be happy to remove the file or give you credit for the design. All files at my site are offered for free for personal home game use.
For more files and to test out my newest files, join us at: