[Modding Question] How do you detect what a sim is doing?

(1/2) > >>

rufio:
I know there is something called an "Iteraction Index", which I believe I've seen used by BHAVs in BookshelfGlobals to find out what the sim was trying to study, but I don't know if that's something whose interpretation is specific to particular objects, or if it's a global indication of what interaction they're performing.  If the latter, is there a table of which interaction indexes correspond to which objects, and if the former, how do I determine the current interaction from a BHAV not associated with said interaction?

J. M. Pescado:
The Interaction Index corresponds to the interaction index on the TTAB. So if a sim is performing an action upon an object you have determined to be a bookshelf, and is doing action 0x22, then you consult the TTAB and that is what he is doing. Be sure that you have correctly identified the interaction object, though, or else you will get nonsense results.

rufio:
Yeah, that's what I was thinking.  How do you identify the object?  That's actually more what I'm interested in here.

J. M. Pescado:
Objects can be identified by category, using BHAV 0x199 (Object, Category), Is Category, or by GUID, using primitive 0x20 "Test". If this information is not sufficient to identify an object, then you can't. However, this should be sufficient to identify any standard object. Having identified the object, additional state information can be retrieved by examining its attributes, if necessary.

rufio:
Is that a "is object X of category Y" function, or a "is sim X using an object of category Y" function?  (I'm not on a computer with SimPE on it right now).  I need something like the latter.

ETA:  Or it is always safe to assume that the Stack Object is the object being used?

Navigation

[0] Message Index

[#] Next page