More Awesome Than You!
Welcome,
Guest
. Please
login
or
register
.
2024 November 22, 15:02:51
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
SUPPORT THE MUNICIPALITY!
Have you destroyed a paysite today?
"Jelenedra" is the new "gay".
All Lythdans are stupid and suck!
DEATH TO ALL STUPID HAIRY-BELLIED NESSES!
All Kewians are stupid and suck! Accept no Kewian-based substitutes!
Clearly, BlueSoup has failed us! You must not! BlueSoup has a fat head!
Hobbsee has a
scrawny pencil neck.
Rohina the Ugly Butted is a Horny Turkey
540287
Posts in
18067
Topics by
6545
Members
Latest Member:
cincinancy
More Awesome Than You!
TS2: Burnination
The Podium
[Modding Question] How do you detect what a sim is doing?
0 Members and 2 Chinese Bots are viewing this topic.
« previous
next »
Pages:
[
1
]
Author
Topic: [Modding Question] How do you detect what a sim is doing? (Read 5220 times)
rufio
Non-Standard
Uncouth Undesirable
Posts: 3030
More Nonstandard Than You
[Modding Question] How do you detect what a sim is doing?
«
on:
2009 November 04, 00:42:24 »
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?
Logged
Quote from: Tsenatserix on 2010 December 08, 08:01:19
I was thinking about these things and I am a feminist.
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
Posts: 26288
Re: [Modding Question] How do you detect what a sim is doing?
«
Reply #1 on:
2009 November 04, 00:52:07 »
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.
Logged
Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
rufio
Non-Standard
Uncouth Undesirable
Posts: 3030
More Nonstandard Than You
Re: [Modding Question] How do you detect what a sim is doing?
«
Reply #2 on:
2009 November 04, 02:55:52 »
Yeah, that's what I was thinking. How do you identify the object? That's actually more what I'm interested in here.
Logged
Quote from: Tsenatserix on 2010 December 08, 08:01:19
I was thinking about these things and I am a feminist.
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
Posts: 26288
Re: [Modding Question] How do you detect what a sim is doing?
«
Reply #3 on:
2009 November 04, 03:06:29 »
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.
Logged
Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
rufio
Non-Standard
Uncouth Undesirable
Posts: 3030
More Nonstandard Than You
Re: [Modding Question] How do you detect what a sim is doing?
«
Reply #4 on:
2009 November 04, 03:25:33 »
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?
Logged
Quote from: Tsenatserix on 2010 December 08, 08:01:19
I was thinking about these things and I am a feminist.
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
Posts: 26288
Re: [Modding Question] How do you detect what a sim is doing?
«
Reply #5 on:
2009 November 04, 08:19:02 »
Object X is explicitly passed as mentioned above. How you determine whether a sim is using said object depends entirely on where you got the object from. If you're getting it from a sim, like My/Stack Object's Current Interaction Object (12/13 50 00), then you can pass it in as such. HOW you found the object you want to examine is not something the BHAV cares about.
Logged
Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
rufio
Non-Standard
Uncouth Undesirable
Posts: 3030
More Nonstandard Than You
Re: [Modding Question] How do you detect what a sim is doing?
«
Reply #6 on:
2009 November 04, 14:38:55 »
Ok, so, given a sim NID, if you do something like:
Stack Object := (sim NID)
Local 0x0 := neighbor in Stack Object's Current Interaction Object
you can then say
Is Category (Local 0x0, 0xwhatever)
which will tell you whether the sim is using a particular kind of object, right? The first two lines were basically what I wanted to find out.
Logged
Quote from: Tsenatserix on 2010 December 08, 08:01:19
I was thinking about these things and I am a feminist.
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
Posts: 26288
Re: [Modding Question] How do you detect what a sim is doing?
«
Reply #7 on:
2009 November 04, 15:59:14 »
Quote from: rufio on 2009 November 04, 14:38:55
Ok, so, given a sim NID, if you do something like:
Stack Object := (sim NID)
Local 0x0 := neighbor in Stack Object's Current Interaction Object
Never do that. You should never access a persondata's instance values from an NID. To do it properly, if you have only an NID to work from, you need to set it to stack object, then extract its "person instance" using 18 00 00, assign THAT to stack object, then do stack object's persondata Current Interaction object (13 50 00). If you attempt to access neighbor's persondata through 20 50 00, you will get nonsense values. In fact, you should NEVER consult the Neighbor's Persondata without first verifying that the person is NOT instanced on the lot (always use the neighbor in stack object's person instance ID instead, then read the persondata of that). Neighbor's Persondata contains old information and should never be used unless you're looking for static information that will never change in-game, or the sim is definitely not instanced on the lot.
Logged
Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
rufio
Non-Standard
Uncouth Undesirable
Posts: 3030
More Nonstandard Than You
Re: [Modding Question] How do you detect what a sim is doing?
«
Reply #8 on:
2009 November 04, 16:21:34 »
Ah, right, I'd forgotten the difference between using the NID versus the object ID. I actually can't remember whether it's an NID or an object ID I've got to work with, but I will keep that in mind. Where is data actually being retrieved from when you refer to "neighbor's ___" versus "(object ID)'s ____"? I take it that the NID goes back to some general-purpose census entry in the neighborhood with the name and family relationships and such, while the object ID refers to an actual instantiated object representing the sim that contains all the temporary variable information like skills and so forth for later storage in the census entry when the sim leaves the lot? Family relationship info is something you can access through NID, right? At least, EAxis family relationship BHAVs mostly seem to use NIDs (and my modded BHAVs using NIDs work as expected). Would that cause inconsistencies or errors if family relationships were changed on-lot via hacks? (And have you really got all of the operands for every argument for every BHAV memorized?)
Logged
Quote from: Tsenatserix on 2010 December 08, 08:01:19
I was thinking about these things and I am a feminist.
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
Posts: 26288
Re: [Modding Question] How do you detect what a sim is doing?
«
Reply #9 on:
2009 November 06, 09:43:44 »
Relationships can be accessed through either way safely, as these are global values that are not cached on the instance. Different arguments are needed to access it with instance IDs vs. NIDs, though.
Logged
Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
TS4: The Pee-ening
-----------------------------
=> Insert Amusing Name Here
=> Facts and Strategery
-----------------------------
TS3/TSM: The Pudding
-----------------------------
=> The World Of Pudding
=> Facts & Strategery
=> Pudding Factory
===> World of Puddings
===> Pudding Plots
-----------------------------
TS2: Burnination
-----------------------------
=> The Podium
===> Oops! You Broke It!
=> The War Room
=> Planet K 20X6
===> Building Contest of Awesomeness
=> Peasantry
===> Taster's Choice
-----------------------------
The Bowels of Trogdor
-----------------------------
=> The Small Intestines of Trogdor
=> The Large Intestines of Trogdor
-----------------------------
Awesomeware
-----------------------------
=> TS4 Stuff
=> Armoire of Invincibility
===> AwesomeMod!
=> The Armory
===> Playsets & Toys
===> The Scrapyard
-----------------------------
Darcyland
-----------------------------
=> Lord Darcy Investigates
-----------------------------
Ye Olde Simmes 2 Archives: Dead Creators
-----------------------------
=> Ye Olde Crammyboye Archives
=> Ye Olde Syberspunke Archives
-----------------------------
Serious Business
-----------------------------
===> Spore Discussions
Loading...