Error message

  • Warning: opendir(sites/all/libraries): failed to open dir: Permission denied in libraries_get_libraries() (line 100 of /home/darkdna.net/fishmonger/white/sites/all/modules/libraries/libraries.module).
  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /home/darkdna.net/fishmonger/white/includes/menu.inc).

Basic Codex Tutorial

This is exported from the original GoogleDoc (later GoogleDrive) version which can be read here.


Beginning with Codex

Beginning with Codex

        Codex is a tool for modifying objects in The Sims 1. There are not many tutorials for it, but it's actually better for objects than IFFPencil2. You'll still want that for other files, probably, but this is about Codex. In this tutorial we'll use Codex to make what I think is a sort of fun, and in a way realistic object.

What you'll need…

Beginning with the Transmogrifier

In the Transmogrifier

Cloning an Object

On Magic Cookies

Editing the CTSS in T-Mog

Now for Codex...

The Tower of SimAntics will Fall

Now for the actual coding…

Tune your BCONs

Should I Piss? - Making a BHAV

Connecting the Dots… or Expressions

Back to the Shower Core

Congrats!

 What you'll need…

  1. The Transmogrifier by Don Hopkins, available from The Sims Transmogrifier Home Page
  2. Codex by K, which I'm offering here for you
  3. This tutorial (oh look you already have this)
  4. The Sims installed (you can do this with the base game, even though I do have Complete Collection installed).

Beginning with the Transmogrifier

        We're going to start by cloning an object. It's actually not too painful to make an object wholly from scratch but sometimes it's just not worth it. If Maxis already did more than half the work for us, well it would be rude not to build off of them. Usually people call it T-Mog because the name is long.

In the Transmogrifier

        Once T-mog is installed, launch the program. If you can manage this you're golden. Use the search feature to find a shower. I'm going to use the basic, cheap maxis shower in "showerc". You can select the shower in the other window and click "view" to make sure it's the shower you want.

That's the shower I'm using, and I recommend you use that one too if you're trying to follow along. We're going to clone this sucker.

Cloning an Object

        With the object still selected, click the clone button. The Clone window will pop up. For your file name, it's customary to use a prefix like your initials. I prefix mine with dd_, as I am damondamore. I'm calling mine dd_tutorialshower but you can use whatever name you like. I don't own you.

On Magic Cookies

        Magic cookies are a nine digit number to ensure your objects have a unique GUID. We ran out a long time ago, and the service to get one has been broken for a while. I recommend people in the US or Canada with 10-digit phone numbers drop the last digit off the phone number. People in other countries may adapt as they see fit.

Anyway, click OK to clone that mofo.

Editing the CTSS in T-Mog

        We're not quite done with T-mog yet, make sure your new shower is selected and click "Edit Object". Let's change the title. Let's call it "The Enhanced SpaceMiser Shower" and make it cost just a little more at §700, even. Let's change the description to be "Codex Tutorial Shower. Created following a great tutorial. Paypal fishmonger@lsyo.com to donate." Really you can put whatever you want. Normally you would describe the object a bit and include a URL or E-mail to where people can find your objects or contact you but you can take a creative writing class yourself, later. Just click "Set all…" to set this for all the languages. It's easier in the long run, and English is the primary language among sims 1 players, anymore. Now we're done with T-mog. Close it.

Now for Codex...

        Codex can look scary, but it's not. I promise.

        You're probably thinking what the fuck is this shit?. And I really don't blame you. It's a big list of all the objects in your game. To help you find the tutorial shower you just cloned, click the little box that says "writeable only". Now you see the virtue of using a prefix. If you can't find it in the list you can use File… Open… at the top, navigate to your sims game's downloads folder and find it in the subfolder Transmogrified. I just used the alphabet to find mine in the list.

I have the "Show I.D." box ticked at the bottom. Codex does not really use IDs but it can help helpful to see them here, and I'm going to use them as a second way to refer to the primitives (or BHAVS). Now, we're going to open "Shower Core" ID 4104. It should look something like…

The Tower of SimAntics will Fall

        It could be my wide monitor but you'll notice it goes down and off the window. You can pan around and such but that's not really a great way to view it. Depending on your monitor it might look a little different, but by default most objects will be very… tall. Grab the little "tab" area on the right to re-arrange things until you can look at it better.

        

Because I have a wide monitor, I like to snake mine around but you can do whatever you like.

Now for the actual coding…

        First, we're going to use one of my favorite features… the ability to actually add notes. In the bar near the top there's "Add new:" and the first option is "Comment". I added a comment near the "set motive change" primitive to say "this is where I'm changing things". Now that we have a bright cyan rectangle so we can easily spot our changes, let's continue.

        Right click the current "Set Motive Change" for hygiene and copy and paste it. On the new one you just pasted, click the text and this little guy will pop up.

You will notice the third Hex argument is 08. Make it 09. 09 is the ID for bladder. But wait… it uses tuning BCONs to determine both how much to raise per hour and when to stop raising it. Hmm…

Tune your BCONs

        Making a new BCON is surprisingly painless and Codex even lets you name them. You can't imagine how happy a verbose guy like me is over that. The advantage to using tuning BCONs is that if you decide you want it to go faster, slower or maybe you shouldn't be THAT satisfied from piddling in the shower a little you can change it easily.

        Remember where we selected the tree? Change the "Categories" drop down to "Constants" and you'll notice there's one listing called "Tuning". Open it up.

        First, click the "Add Labels" button near the top right. If you don't see it, make the window a little bigger. This is a life saver. Next click the "New" button. Double click your new one (it'll be at the bottom with a "0" for everything, should be ID 11. I find that just a name is descriptive enough, but you can give it a full description if you want. Decide how quickly a sim can pee (how much it increases per hour). I used 300, because most values in the game are based off of 1000 or 10000.

        Add another new BCON (ID 12) and give it a name. I used "Piss tuning total". I set mine for 1000 because it seemed like a good number at the time. Click "Apply" and close the window. Also go to "File… Save…" now. Good to remember to do that every so often.

Go back to shower core, click the text of the box that alters the bladder motive. Now that we've made out new entries in the decimal arguments box, make the fifth and seventh and 11 and 12, because that's the ID in the BCON table we used. You should now have "Set Motive Change (my motives Bladder += #Piss tuning per hour per hr, stop at #Piss tuning total)".

        Now that your BCONs are in order, you need to route the code around a bit. Find "tweak shower begin" and right click that, select "set true branch" and point that to your motive change bladder. Then point the bladder to the motive change hygiene.

        "But Damon" I hear you say through the internet, time and space, "Not everyone pees in the shower!" and you'd be right. Now, here I am going to say that I do some women who pee in the shower too, so let's make a new BHAV so that only more sloppy sims will pee in the shower.

Should I Piss? - Making a BHAV

Back on the Tree list find the "Main" (ID 4096, Maxis' favorite ID for a main BHAV). This is one of my few gripes with Codex. You can't just add a new resource. You need to copy and paste. I'm using the main for this one because it has the least extra crap to clean out. I'm pretty sure you can copy and paste between objects, so at least there's that. After you paste your tree, rename it. I used "Should I piss?", keeping with the most mature way of referring to urination.

Up at the very top of the window, next to "Type", change it to "Primitive". From the bigger drop down list, select "Expression". Click Create. Now, you're going to have a LHS (Left hand side), and operator and a RHS (Right hand side). Use the drop down lists to get "my person data" then "neat / quiet personality". Note that it is "Neat/Sloppy" for humans and "Loud/Quiet" for pets. Select less than ("<"). Make the RHS a "Literal Value" then put in 500. Personality points are out of 1000 so that means you need to be less than halfway neat. You could actually use a tuning BCON here too if you think you'll want to fiddle with just how much of a slob a sim needs to be.

        Now we need another expression, you can make a blank one the same way as before, clone the one we have use the "add new" button that says "expr."-- expressions are used a lot.

        In the new one, LHS needs to be "My person data" again, but this time use "gender". Use "Equals?" for the operator and use a literal value of "Zero" for the RHS. This will test if a sim is male. Note that gender also identifies pets, but as pets can not use the interaction only humans are male or female.

And we're going to us one more test of neatness, so clone the original and make this literal value on the RHS even less. I set it so it must be less than 200.

        Now we're going to need some endpoints, after all it has to return true or false-- that's just the way trees like this work. Add one true point and one false point.

Connecting the Dots… or Expressions

        Now, right click the first expression we make, the one that checks if neatness is less than 500. Select "Set as entry point". This is one feature IFFPencil2 is sorely lacking. Now, right click it again and choose "set true branch", make that go to the expression checking gender. Make the false branch go to the false endpoint.

        Now, make the gender check-- which we now go to if a sim is less than half neat, or more than half sloppy-- and make the case line simply return true by pointing it to the true endpoint. Make the false case point to the the check if neatness is below 200 (or whatever value you wanted).

        Finally, at least for this step, make the neatness < 200 box point to the true endpoint if it's true and the false endpoint if it's false.

        What this all does is make the object see if a sim is at least half sloppy, then if they're a guy it returns true. If they're a female, it will see if they're even a little more gross. You could actually arrange these checks in any number of ways, such as checking gender first and seeing if the sim has the appropriate amount of sloppyness. Click apply and close the window. Save the object.

Back to the Shower Core

        So now that we're a bit more selective about who pisses, next to type make sure "Subroutine" is selected. Under that make sure "Private" is selected. Find "Should I Piss" (or whatever you named it) in the list Click create.

        If you don't see it, save the object (from file… save) close it and re-open it. There's a light bug where sometimes the drop down lists don't update otherwise.

        Now we need to point the true line for "tweak shower begin" to "Should I piss?". Even though "Tweak shower begin" always returns true, "Should I piss?" may be true or false. Point the true line to the motive change bladder we made before (which in turn points to hygiene) and point the false line directly to hygiene.

That area of the code should look something like this...

Congrats!

        You're done! Well, unless you want to fiddle with it more, but it works and you've learned the basics of Codex.


You can download the object here as an .iff, hosted by GoogleDrive

Uncaught exception thrown in shutdown function.

PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] =&gt; 11488071325dcd422ca78f98.08071311 ) in lock_release_all() (line 269 of /home/darkdna.net/fishmonger/white/includes/lock.inc).