View Full Version : [RESOLVED] BHAV Guardian: Can't find the object attributes !
Kabuto
5th May 2008, 01:45 AM
Hi,
It's still about my tattoo salon chair, before I used "My attribute" 0x8 and 0x9 in order to store the current mode (random tattoo ON or OFF) and the selected tattoo but they were stored in the sim attributes instead of the object attributes so I replaced them by "Stack Object's attribute" but the init function still have "My attribute" .
But when I test these attributes in my dynamic menu function, it doesn't find them !
An error occur when I try to put the object and when I click the object !
Please help me !!!
Below my package and the "ObjectError_C001_t8576.txt" file.
Echo
5th May 2008, 02:54 AM
"My" refers to the object executing the code. "Stack Object" refers to the object currently referenced in "Stack Object ID". At the point your log was generated, "My" was sim-Ewan, and the Stack Object was tile 0,1 of the tattoo chair.
My guess (and I don't have SimPE here to check) is that you've got a multi-tile object which you're setting attributes on. If you want to use attributes in multi-tile objects, and you need to maintain those attributes across all the different tiles, then you need to only read and write those attributes on one of those tiles. I recommend putting a line like this:
Stack Object ID := Stack Object's Lead Tile ID
just before you try to read or write any Stack Object's Attributes. Likewise if you're reading or writing from My Attributes.
Try that, and see if it helps. :)
Kabuto
5th May 2008, 03:08 AM
I also tried this line added but the error is still the same !
I did it like that :
The current Stack Object ID was saved in a local variable,
I do Stack Object ID := Stack Object's Lead Tile ID,
the Stack Object's attribute is tested
and I restore the previous Stack Object ID !
Inge Jones
5th May 2008, 08:46 AM
Well, you do also have to make sure the attribute was stored on the lead tile in the first place, or testing it there will not give good results. What did the error say? Can you attach the .txt?
Kabuto
5th May 2008, 10:24 AM
Well I upload the "Kabuto_TattooChair v0.6.package" with the 2 error files :
ObjectError_C001_t8576 init.txt : when I buy the object,
ObjectError_C001_t8576.txt : when I click on it.
The attribute 0x8 and 0x9 don't exist, it's me who added them. Is there a method to declare new custom attributes ?
Inge Jones
5th May 2008, 11:29 AM
Oh I see. I was hoping not to have to download and unzip a zip - just being lazy :D
Kabuto
5th May 2008, 11:39 AM
ObjectError_C001_t8576 init.txt
Build: 1.13.0.148
at Mar 14 2008,19:38:20
Object id: 322
name: Tattoo Chair - Salon - 0,1
Stack size: 3
Error: Attribute number out of range.
Iterations: 1
Frame 2:
Stack Object id: 0
Node: 13
Tree: id 4096 name 'Function - Init' version -32750
from SIMPE_CHAIRSALON_CRES
Prim state: 0
Params: Locals:
Frame 1:
Stack Object id: 0
Node: 0
Tree: id -1 name 'No behavior' version 0
from
Prim state: 1
Params: Locals:
Frame 0:
Stack Object id: 0
Node: 0
Tree: id 4097 name 'Function - Main' version -32754
from SIMPE_CHAIRSALON_CRES
Prim state: 0
Params: Locals:
ObjectError_C001_t8576.txt
Build: 1.13.0.148
at Mar 14 2008,19:38:20
Object id: 264
name: C001_User00223 - Ewan
Stack size: 6
Error: Attribute number out of range.
Iterations: 0
Frame 5:
Stack Object id: 322
Stack Object name: Tattoo Chair - Salon - 0,1
Node: 7
Tree: id 4147 name 'Kabuto - Menu - Settings TEST' version -32755
from SIMPE_CHAIRSALON_CRES
Prim state: 0
Params: 0 Locals:
Frame 4:
Stack Object id: 0
Node: 0
Tree: id -1 name 'No behavior' version 0
from
Prim state: 1
Params: Locals:
Frame 3:
Stack Object id: 264
Stack Object name: C001_User00223 - Ewan
Node: 0
Tree: id 280 name 'Idle' version 2
from global
Prim state: 0
Params: 1 Locals:
Frame 2:
Stack Object id: 264
Stack Object name: C001_User00223 - Ewan
Node: 15
Tree: id 8283 name 'Function - Main - Loop' version 96
from PersonGlobals
Prim state: 0
Params: 5 20 1 Locals: 0
Frame 1:
Stack Object id: 264
Stack Object name: C001_User00223 - Ewan
Node: 6
Tree: id 8193 name 'Function - Main' version 115
from PersonGlobals
Prim state: 0
Params: Locals: 5 20 0
Frame 0:
Stack Object id: 264
Stack Object name: C001_User00223 - Ewan
Node: 1
Tree: id 4096 name 'Function - Main' version 2
from TemplatePerson
Prim state: 0
Params: Locals:
Inge Jones
5th May 2008, 11:42 AM
Lol it's ok I got myself into gear and downloaded :D
Multi-tile lead object is Tattoo Chair - Salon - 0,1. That's the OBJD that needs updating so that its num attributes field has sufficient attributes to hold your data. If your highest attribute is 9, then the num attributes needs to say 0x0a (10 in decimal). That may be sufficient to suppress this particular error.
Kabuto
5th May 2008, 12:16 PM
Ok, Thank you very much, it works completely now !
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.