0x006A

From SimsWiki
Revision as of 01:20, 21 June 2006 by Trezero (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
IN PROGRESS

Contents

The Basics

(note: This was written by someone with the original sims 2 ONLY. I have no idea if it's any different in the expansions.)

0x006A is the Animate Sim primitive BHAV. Basically, any time a sim moves, it uses this function.

Animate Sim uses at least 12 of the 16 operands, and can use 4 (that I know of) variables from the calling BHAV as well. It must call an ANIM file, and can call another BHAV file as well. So yeah, it's fairly complex, and I'm not arrogant enough to say I understand how it works. These are some generalizations I've made from quite a few tests, and may not be correct. If they aren't, and you know it, there is an edit tab up at the top, calling you.

I used SimPE to find all this, by the way. The screenshot is from SimPE, too.

The Details

Like all BHAVs, Animate sim is called in it's own line, and is passed certain info from the operand list. Just for clarity, this is how I numbered the operands:


A lovely screenshot

Animate Sim basically works like this: When called, it always finds the animation (stored in an ANIM resource) by looking in a STR# (text list) file, gets the animation name out of there, and finds the animation with the right name. Then it applies any changes made in the relevant operands to the animation, and plays it.

Okay: I am not going to cover the Operands in order, because it's too much of a pain (they all interrelate so much).

So, we'll start with

Operand 7

Operand 7 contains the last two digits of the instance number of the default STR# file. (the one it finds the ANIM name in)

instance number 0x00000081 is the most commonly-used STR#. It contains all the names of the ANIMs that adults can perform relative to the object. At runtime, sims 2 looks for this STR# in the same group as the calling object; if not found there, it "fallsback" and looks in the object's semi-globals.

STR# instances 82 (ChildAnims), 89 (ToddlerAnims), 8A (TeenAnims), and 8B (ElderAnims) all work exactly the same way, and one needs to exist for every age group that can use the object.

Note: There doesn't need to be a call to Animate Sim for every age group. Animate Sim 
will find the appropriate STR# file for the age of the sim it applies to.

Instance number 0x00000080 APPARENTLY looks in globals. I don't know whether it actually looks for an STR# there, or if it just looks for the ANIM matching Operands 1 & 2.

Instance number 84 does something really weird, too. As far as I can tell, it fallsback all the way to globals, and reads the LocoAnims text file.

Any other instance number (including 00), if not found in the group, fallsback to the semiglobals, and looks in the ObjectAnims STR# 86. Obviously, object animations cannot apply to sims, and Animate Sim will throw an error and immediately stop whatever the sim was doing.


So: On to

Operands 2 & 1

Why 2 and 1? Why not 1 and 2? Because, like anything else in BHAVs, all 4 digit numbers are stored with the tens and ones first, then the thousands and hundreds. Example: the hex number 1234 would be stored in two BHAVs as 34 12.

Anyways: Operands 2 & 1 can be two things. Either they define the line in the STR# file (defined in opcode 7) that has the desired animation's name, or they define the parameter that has the number that defines the line in the STR# file. How Animate Sims decides which is is is covered next, in

Operand 3

This is THE operand. It defines so much stuff it's easier if I make a graphic.


Opcode-3.png

Basically, anything highlighted in red is decided by this opcode.

Going through them one by one....

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox