Replies: 34 (Who?), Viewed: 27174 times.
Page 2 of 2
Retired Duck
retired moderator
Original Poster
#26 Old 22nd Aug 2007 at 2:53 PM
Hey Wndy!

Lol! I did do a little bit of casual Computer Science teaching back when I was at university, but these days I'm just a plain old developer. The pay's better.

You've done a remarkable job of picking all this up though, I'm not at all surprised to hear that you have some programming experience. You've taken to modding the sims extremely quickly and intuitively!

And since you asked so nicely and made lots of lovely comments about me, I went and printed the first 8 pages of this thread (ie, the first post) to pdf. It's attached. I'm afraid you got the first couple of replies at the end of page eight, but hopefully it'll do.
Download - please read all instructions before downloading any files!
File Type: zip simanticsdatatypes.zip (71.8 KB, 84 downloads) - View custom content
Instructor
#27 Old 17th Oct 2007 at 1:00 PM
This will work great! Thanks so much! As you know, I am attempting to tackle a real buggar of a task with cloning your clown. Alas...i did not make the deadline for the contest...but no big deal...I still want my customized ticket booth for a theater setup.

Thanks to many on here I finally figured out where I was going wrong with mapping...now I just need to figure out how to get all my code together! This will make a fine addition to my big book of Simantics and Bhav Info compiled by the great and wonderful AdidasSG2!

Starting tomorrow I will be working graveyard shift at work - so I plan to bring this big book of stuff with me to absorb during downtime. That along with your info here should help with decoding all those bhav's in the bar! And I am sure to have a ton of questions as I delve into this further!

Thanks again!
*shrugs*
retired moderator
#28 Old 30th Jul 2010 at 5:21 AM
Maybe I've missed it, but what would be the difference between "[prim 0x0002] Expression (Stack Object ID 0x0000 := Local 0x0000)" and "[prim 0x0002] Expression (Stack Object's 0x000B (object id) := Local 0x0000)"?

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Retired Duck
retired moderator
Original Poster
#29 Old 30th Jul 2010 at 8:02 AM
Stack Object ID 0x0000 is the variable that specifies what the "Stack Object" should point to. You can set that to any number, and the Stack Object will become the object with that ID.
Stack Object's 0x000B is the 0xB'th variable inside the object pointed to by Stack Object ID 0x0000.

Now the two values should always be equal (in the sense that they will contain the same value) because if you change Stack Object ID, then the object it points to will change to the object with that ID. However, you can't change the Stack Object's 0x000B variable, because that's the thing being pointed to, and it's read-only.
*shrugs*
retired moderator
#30 Old 30th Jul 2010 at 10:17 PM
Ah ok, thanks.

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Test Subject
#31 Old 14th Jan 2011 at 2:47 AM
Thanks for this; it's something I've been struggling with.

If I understand correctly, if you want to have a (permanent until specifically changed) setting for an object, you should store the value in a My attribute, and not a Stack Object's attribute, because the stack object will change and a Stack Object's attribute won't be saved, right?

So I should do: Expression (My attribute 0x0000 ("Locked") := Literal 0x0001)

But I am finding that some things don't work properly when I do that instead of: Expression (Stack Object's attribute 0x0000 ("Locked") := Literal 0x0001)

I was wondering why that is.

(Specifically, I'm trying to make a Sim trap... if the trap is "locked", then they'll go there and do an animation forever, or until the setting is changed to "unlocked" If it's unlocked, they'll leave when you tell them to or when they want to do something else. However, after changing the locked/unlocked variable to a My Attribute one instead of a Stack Object's Attribute one, I find that it can no longer be changed while in use--trying (via selecting another Sim and choosing the menu option) seems to just have no effect. It does seem to be able to be changed when not in use, though.

On the other hand, something else only started working when I used a My attribute for it.)

I was also wondering--why is it that when you make a text list of attribute labels, both My Attribute and Stack Object's Attribute seem to use them?
Retired Duck
retired moderator
Original Poster
#32 Old 14th Jan 2011 at 5:59 AM
Quote:
Originally Posted by tangent888
if you want to have a (permanent until specifically changed) setting for an object, you should store the value in a My attribute, and not a Stack Object's attribute, because the stack object will change and a Stack Object's attribute won't be saved, right?

Not exactly, no... The "Stack Object ID" will get changed all over the place, but if you put a value into an attribute of any object then it will stay there, regardless of how it got in there - whether it was accessed via the Stack Object or by My/Me.

Quote:
So I should do: Expression (My attribute 0x0000 ("Locked") := Literal 0x0001)

Only if you're working from within that object's stack. If you're in an interaction, that'll be setting attribute 0 on the sim, not the object.

Quote:
But I am finding that some things don't work properly when I do that instead of: Expression (Stack Object's attribute 0x0000 ("Locked") := Literal 0x0001)
That will work assuming that the Stack Object ID is pointing to your object, yes. As a rule of thumb, if you're in an interaction, then you'll want to use Stack Object. If you're in a function, you'll want to use "My".

Quote:
I was also wondering--why is it that when you make a text list of attribute labels, both My Attribute and Stack Object's Attribute seem to use them?

Because Stack Object can very easily point to the same object that "My" points to, and because SimPE can't tell what stack a BHAV is going to be run in and thus what kind of object it could be.
Test Subject
#33 Old 14th Jan 2011 at 9:07 PM
I think I understand now--thank you!

Quote:
As a rule of thumb, if you're in an interaction, then you'll want to use Stack Object. If you're in a function, you'll want to use "My".


So--an interaction is the BHAV that's called directly when you choose something from the pie menu, the one listed in the "Action BHAV" box, and BHAVs called by those, or BHAVs used as guardians, are functions? Or do I have that wrong?
Retired Duck
retired moderator
Original Poster
#34 Old 15th Jan 2011 at 12:30 AM
BHAVs called from the pie menu are interactions, as are any BHAVs called from those interactions. Guardians behave the same way, you'll want to use Stack Object in those.

Functions are called from the OBJF, and are things like "Function - Main", "Function - Load", "Function - Init" etc...
Test Subject
#35 Old 15th Jan 2011 at 12:35 AM
Aha, I see. I'll keep that in mind, then--thanks again!
Page 2 of 2
Back to top