A quick and dirty motive hack using IffPencil2

Choose and clone the object you wish to hack.  I'm going to use the good old flamingo for my example, and show you how to raise your Sim's motives when he views it.

Open your cloned flamingo or other object in IffPencil2, and check it doesn't have a BHAV numbered 5119.   If it does, then open motives.iff, which was included in the .zip, and change the BHAV number of "Process motives" to an unused number between 4100 and 8000.  This can be done by right-clicking on it and choosing Properties.

Fig 1: How to change things like BHAV number and name

With your cloned object open, choose Edit | Import, make selections in the dialog as below, and after clicking OK, browse to motives.iff

Fig 2: The Import dialog

Say Yes or OK to everything that happens after that, until the import sequence has finished.  Then File | Save.

Now with your new object still open, double-click on "Process motives" in the list of BHAVs.   When opened, it should look like the illustration below.  If the lines are muddled up, right-click on some blank white space in the window, and use Rewrite.

Fig 3: Process motives showing how to re-order jumbled lines

If you don't edit the Process motives BHAV, it will run from line 0 to line 9, making the mood go up by 10, the energy go up by 20, the comfort up by 30 and so on.  Lines 10 and 11 won't run, because line 9 returns True and that's the end of it.  I only included them as easy examples of other ways to adjust the mood.

Given that the lowest a mood can be is minus-100 and the highest is 100, choose what effect you would like and edit the lines using the fields illustrated below.   Don't worry about accidentally taking your Sim over 100 or under -100 as the game process takes care of that.

 

Fig 4: IffPencil2's input boxes

This is what your parameter input boxes will look like before editing if you select line 5.  I am sure there are other tutorials explaining the functions and parameters in general, so I'm just going to concentrate on the parameters you need for this purpose, where you can directly adjust the mood effects.

The value 8 in Parameter 1 means "Hygiene" - but only when used together with the "0E" in the 7th hex box at the bottom.  That means "my motives".  We have to use "my", and not "stack objects", because the Sim who is doing the action will be running this code, and he thinks of himself as "me".

The value 50 in Parameter 2 means 50 - but only when used together with the "07" in the 8th hex box, which means "a literal number value".  You will want to change the 50 to a value of your choice.  If you don't want that particular motive being affected, use a zero (but not with Assign To obviously, see below)

The 6th hex box contains the type of maths you're going to do; the example shows "03" for the += operator. += means you take the value that hygiene already is, and add your chosen value to it.  That is to say it will increase by 50, or whatever you change the 50 to.   If you click on lines 10 or 11 instead, you will see the "03" change to "05" for Assign to (which means make it that specific value), or "04" for -= which means reduce the motive by the given amount.  Experiment with different entries in hex box 6 and see if there are any other operators you wish to use for the purpose.

When you think the BHAV will have the effect you want on your Sims, click OK.

Below is what you can expect to see now.  Notice the BHAV we imported, "Process motives", at the end of the list.

Fig 5: List of BHAV resources after importing motives.iff

Double click on BHAV #4097: "View".   Use Rewrite to make sure your lines are in the same order as the illustration.   Then right-click on some white space and choose Add.  That will add the new line you can see highlighted at the bottom of Fig 6.  New lines always start off filled in like that!

Fig 6: After adding new line

First change that new line so it at least does what we wanted it to do - calls our imported BHAV.  Use the Function: box that you can see in Fig 4, and type in the number of the Process motives BHAV, which is 5119 in this example.  You needn't worry about the numbers you can now see in brackets in line 15 (Fig 7), as they will simply be ignored by Process motives (this isn't true of every function you might call).  But if you want to make it look neat, typing FF into every hex parameter box for that line will make them disappear.

Fig 7: After editing new line to call our motives function

I'm going to suggest you make your motives effect take place just as the Sim finishes viewing the object.  If you look at lines 6 and 13 they are both successful (True) end-of-function lines, depending on what happened earlier on in the function we're in now.  If the program routes through either of those lines it means the Sim did actually get to view the object, so it's ok for him to get the motives raise.  Instead of ending right there, we want to execute our new line.

That means, on lines 6 and 13, you must replace the True with the number of our new line so it will happen next.   Then of course you must put the "True" on the new line, line 15, instead, or the program will complain it ended in an error.

In Fig 8 you can see the cursor in the input box labelled "True line:", and this is where you tell the program what line to execute next.  The False line: box, which we don't need to use for this, would be used if you wanted to tell the program what line to go to next if the current line didn't work out.

Fig 8: What the finished View BHAV should look like.  Circle shows box being edited.

Now what we've just done with the flamingo zooms the Sim's motives up all in one rush at the end of his interaction.  Another possible use for the "Process motives" function, if you feel you are ready to try it, would be to put smaller increases in the function itself, but use it in such a way that it is called at intervals while the Sim is using the object.  There isn't an obvious place on the flamingo, but in a bed for example there is usually a BHAV called "tweak finish sleep" which runs every few minutes while a Sim is in bed, so you could have that call Process motives to change one or more of his motives a bit at a time.

Don't forget, changing motives as outlined in this tutorial will always be *in addition* to what the object originally did, so take account of that when you're deciding what numbers to use and what motives to change.

Any problems with this tutorial or .iff file, please email Inge Jones