Stack object attributes
|
#32
11-01-2017
Borrowing my own thread for another question related to stack objects. I want to check if stack objects guid is a specific guid, in order to determine which object is running the bhav. Does anyone know how to set that up? Perhaps @NixNivis? I figure I'm using stack object, and I think object id, but not sure. Basically I want an expression that will check if stack objects guid equals the guid I set, and if true go to one line and if false go to another line. I think I've seen it somewhere, but can't remember where at the moment.
#33
11-01-2017
No, Object ID isn't going to do you any good. Any time you place a new object on a lot, that object gets an object ID. The first object gets ID 0x0001, the second gets 0x0002, etc. That, therefor, has nothing to do with the object's GUID, alas. Next time I'm on my desktop (iPad right jow), I'll check if there's a way to read an object's GUID. It might be in Object data, but I'm not certain where exactly.
EDIT TO ADD:
Ok, I've been snooping around in SimPE for a bit, and it seems like the following might do it:
In the Instruction Wizard, where you would normally select "Stack Object ID", you now go to the very bottom of the list, and select "Stack Object's master definition" instead.
In the field after it on the same line, you can then open the scroll menu and find "guid_1 - Read Only" and "guid_2 - Read Only". These supposedly are the two parts of the GUID of the object in Stack Object ID.
Thus, if you wish to know whether you stack object has a GUID of 0x01234567, you would compare guid_1 to 0x0123, and guid_2 to 0x4567. At least, that is what I suspect that it should in theory look like. Could also be the other way around, after all.
I cannot be certain that it'll work, because I've never had a need for this kind of code. But I hope that this will help you on your way.
EDIT TO ADD:
Ok, I've been snooping around in SimPE for a bit, and it seems like the following might do it:
In the Instruction Wizard, where you would normally select "Stack Object ID", you now go to the very bottom of the list, and select "Stack Object's master definition" instead.
In the field after it on the same line, you can then open the scroll menu and find "guid_1 - Read Only" and "guid_2 - Read Only". These supposedly are the two parts of the GUID of the object in Stack Object ID.
Thus, if you wish to know whether you stack object has a GUID of 0x01234567, you would compare guid_1 to 0x0123, and guid_2 to 0x4567. At least, that is what I suspect that it should in theory look like. Could also be the other way around, after all.
I cannot be certain that it'll work, because I've never had a need for this kind of code. But I hope that this will help you on your way.
#35
15-01-2017
The interpretation would - of course - be that, as these values are marked "read only", you cannot alter them. They can only be used to identify the object.