how IFFSnooper displays BHAV resources

Once we've opened the second window, we can navigate any resource via the popup menus. Following the SimCollege lesson we choose BHAV 4097, Sit.

data overview

Since IFFSnooper does not display BHAV data in quite the same way as the programs used in the SimCollege illustrations, it is a good idea to stop for a moment and look at the hex data window more closely.

This window can display any resource in the object. For many resources it shows little more than raw hex data on the left and the literal text equivalent on the right, but for certain resources, including BHAV resources, IFFSnooper is able to interpret the hex data, making it more obvious what the resource does.

The data display for BHAV 4097 includes the resource ID and name followed by a "BHAV resource header" section, which we can ignore for the moment. The part we want to concentrate on is the "BHAV resource data" section:

BHAV 4097

If we look at the BHAV hex data section we can see that it is arranged into columns, a bit like a spreadsheet, with two bytes per column. The first column, highlighted in green, is for line numbers, starting with line 0. Each line is a SimAntics function. In this BHAV we only have one line.

The next column, in orange, lists the function number in hex code. Since numbers in hex code are hard to interpret, the decimal equivalent is repeated over on the right hand side of the data display.

The next column, in green, lists the possible function outcomes in hex code. The function is usually a test which can end up true or false, so this column is labelled F and T. The hex data in this case is FF FE, which the game interprets as "return false" and "return true".

The next set of columns, in yellow, are for hex data used by the functions. The data is usually interpreted in four chunks or parameters so these columns are labelled p(0), p(1), p(2) and p(3).

The next column, in white, notes whether the function is a SimAntics primitive.

The next column is the text interpretation section of the data display, which interprets the function. Some interpretations are more detailed than others. In this case we see that the function is 4100, which is another BHAV resource from this object. This is what SimCollege refers to as a private function. We will examine what it does later on.