Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Lab Assistant
Original Poster
#26 Old 14th Aug 2007 at 6:39 AM
Actually very helpful, confirmed some of my suspisions. Pseudo C++ code helps out a lot, something I can speak

So basically a stack object id is basically a "hidden" function parameter, each function gets one and the existing value from the caller. It is alterable but when the call stack pops (i.e. function returns) it dies.

If family id is for families, wonder why he needed it then? dunno...

My InitConfig looks like this:
Code:
0 local 0 := stack object id
1 idle
2 if (my container id > 0) goto 3 else goto 1
3 stack object id := my container id
4 if (stack object's gender > 0) then goto 5 else return false // return for female
5 if stack object's person age > 2) then goto 6 else return false // no children thank you
6 attribute 1 (age) := stack object's persons age
7 attribute 2 (neighbor id) := stack object's neighbor id
8 attribute 3 (family id) := stack object's family number
9 attribute 0 (owner) := my container id
A stack object id := local 0


Although I don't think I need the last statement now and my LoadSettings is similar with just using literals for the moment. Once I've cleaned up his code some of those attributes, like family may no longer be needed.
Advertisement
Lab Assistant
Original Poster
#27 Old 16th Aug 2007 at 5:42 AM Last edited by ScoobyDoo : 16th Aug 2007 at 5:49 AM.
A debugging question...

How do you display attributes or whatever variable to the screen? I know it's possible because I've seen it done with Insim and some of the MATY stuff. All I've seen is $Object NID = $NeighborLocal.

I'm currently trying to look at an attribute. I set it to 5 but sometime before the SetSkin is called, I think it's getting changed. I want to plop several dialogs around and do some tracking.

Btw what is Debug op? (0x073) The parameter list isn't available for it.

Edit: Second question, can attributes be altered by modifying stack ids and object id's without using Expression?
Retired Duck
retired moderator
#28 Old 17th Aug 2007 at 1:37 PM
For the first one, I think you're probably looking for this?
http://www.modthesims2.com/showthread.php?t=140309

For the second one, it may be possible, although it doesn't happen very often and the decoding of the primitive will normally specify if it is doing so.
Lab Assistant
Original Poster
#29 Old 17th Aug 2007 at 11:28 PM
Bookmarked the link. I found the reason for the second one, the attribute was being assigned as my attribute, while i was reading it as a stack object attribute.
Lab Assistant
Original Poster
#30 Old 22nd Aug 2007 at 6:31 AM
Ok different problems now. I updated the GUID (0x03BC000). Updated all MMATs and committed. I went into the controller package and replaced all the occurs of the old guid.

It appears but I can't click on it anymore. Any guesses to what I've messed up?
Retired Duck
retired moderator
#31 Old 22nd Aug 2007 at 1:22 PM
Do you mean that you're getting the "no options associated with this object", or you can't even get that when you hover?
Lab Assistant
Original Poster
#32 Old 22nd Aug 2007 at 10:16 PM
Ya I'm getting the "no options associated with this object" and the cursor is a greyed out arrow. Is there a setting that hidden for this that I'm over looking?
Retired Duck
retired moderator
#33 Old 23rd Aug 2007 at 12:31 AM
There are a few things which can cause that... Generally it either can't find the pie menu functions, or they're guarded by something which is failing. Have you checked that none of the guards are self referencing? (It might help if you post the relevant package so I can run my usual checks myself. )
Lab Assistant
Original Poster
#34 Old 23rd Aug 2007 at 4:43 AM
I think the problem might be related to the controller package. I seem to have lost control of the accessory. There must be an old GUID value thats lurking around that I didn't catch. If I can't find it, I'll PM you the packages.
BTW why is Create New Object Instance (0x002A) disallow you to modify the parameters with the wizard? You have to manually enter the guid backwards.
Alchemist
#35 Old 23rd Aug 2007 at 5:02 AM
Now, I do not know if this is truly related, but I have had my problems in the past when modifying accessory items with the accessory.cache file. That seems to file them by GUID, and then reload the cache object from there. Just replacing the file without changing the guid (a common developer test situatiuon) will leave the old object in the game.

In my case, I was changing texture and texture overlays. I have been bit before by simple mistakes, but after a number of attempts at redoing my work, I delete the cache and bang, my changes showed up.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
Original Poster
#36 Old 23rd Aug 2007 at 6:45 AM
Actually things were going good until I changed the guid. I've deleted the cache files and no difference.
Lab Assistant
Original Poster
#37 Old 26th Aug 2007 at 10:16 PM
Alright heres the setup so far:

Heres Create Token Version 1 (param 0 = My object id)
Code:
0 Manage Inventory (Add Token to guid (03bc000, neightbor:param 0))
1 Temp := 0
2 Manage Inventory (Set To Next Token of GUID (03bc000, index:temp, neighbor:param 0))
3 Manage Inventory (Push Property (index: temp, value: 666, neighbor:param 0))
4 Manage Inventory (Save Token in Temp)


and heres part of Save Settings (param 0 = My object ID) [all return false if fail unless noted]
Code:
0 Check for existing tokens (param 0) true->3 false->1
1 Create Token Version 1 (param o)
2 Dialog ("Created token list") goto 4
3 Dialog ("Token already created")
4 Manage Inventory (Set To Next Token of GUIDE (03bc000, index:temp, neighbor:param 0)
5 Dialog ("Set to next")
....



Right now LoadSettings once done will call Save Settings, the values it stores is irrelavent. This is just for understanding purposes mostly.

Now as the program goes, it will message me saying:
Code:
Created token list.

and thats it, no "Set to next" so it appears Set to Next Token is failing.
Retired Duck
retired moderator
#38 Old 27th Aug 2007 at 11:09 AM
The set to next needs the sim's neighbor id, not its object id. Does that help at all?
Lab Assistant
Original Poster
#39 Old 27th Aug 2007 at 11:25 AM
Well that gives me "Illegal owner field in data reference." on this line:
Load Settings (my neighbor id) [my person data: neighbor id]

Does neighbor id suffer from the "i'm not assigned yet" syndrom?
Retired Duck
retired moderator
#40 Old 27th Aug 2007 at 11:36 AM
Wait... what? I'm a bit lost... You only want the neighbor ID in the "set to next" line, all the others should keep using the object ID. What exactly is "I'm not assigned yet" syndrome?

And which stack is this being run in? Is this as an interaction?
Lab Assistant
Original Poster
#41 Old 27th Aug 2007 at 11:36 AM
Sorry, this is being called from main. Main calls load settings, load settings currently calls save settings after it's done its work (that way I can put data onto the token).

The i'm not assigned yet is what happens with my container id, where you have to keep idling incase it's value is 0.
Retired Duck
retired moderator
#42 Old 27th Aug 2007 at 11:50 AM
Well if this is running from main, then "My" will be the object, not the sim. That means "my neighbor id" will not exist (a non-sim object has no neighbor id field).

You said you have the sim's object ID in param 0? Then you want something like this:
Stack Object ID := Param 0
Local 0 := Stack Object's neighbor ID
Manage inventory ([whatever else], Local 0)
Lab Assistant
Original Poster
#43 Old 27th Aug 2007 at 12:22 PM
Ok did some redoing...

main calls InitConfig, which includes this code:
Code:
stack object id := my container id
my attribute 6 (neighbor id) := stack object's id


now I've fixed the Manage inventory in Save SEttings to this:
Code:
Manage Inventory (Set to Next Token of GUID 3bc000 [index:temp 0, neighbor: my attribute 6 Neighbor ID])


It's still failing.

Edit: opps forgot the my container code bit.
Retired Duck
retired moderator
#44 Old 27th Aug 2007 at 12:35 PM
Quote:
my attribute 6 (neighbor id) := stack object's id


1 - Is the stack object definitely the sim when this is called? (edit - your edit covers this one)
2 - Don't you mean "Stack Object's neighbor ID"?
Lab Assistant
Original Poster
#45 Old 27th Aug 2007 at 11:12 PM
Correct, my mistake. I was getting a little tired at that point.

I added a few Neighbor = $local:0 dialogs at key areas.

InitConfig reports the Neighbor ID as 360.

Save Settings first checks to see if the token exists (at this point it shouldn't).

If it does'nt it calls Create Token Version 1. Create Token adds a token, reports 360 as Neighbor ID attribute and set to next, pushes property, and finally save token. Finally informing me it has finished (another dialog).

Once it's done, Save settings resumes, it reports 360 as the id, then calls set to next again, which fails.
Lab Assistant
Original Poster
#46 Old 27th Aug 2007 at 11:44 PM Last edited by ScoobyDoo : 28th Aug 2007 at 3:05 AM.
Ahh this more helpful..
Save settings first calls check for existing token.
Dialog reports it didn't find one (naturally)
I then call Create token.
It reports create token ended successfully (got to the end without premature returning)
i recall check for exisiting token.
it reports it couldn't find one....

heres the Create Token code: (everything returns false if it fails)
Code:
 
Manage inventory (add token of guid 3bc000 neighbor:my attribute Neighbor ID)
Temp := 0
local 0 := my attribute Neighbor ID
Dialog (Neighbor id = $local:0)
manage inventory (set to next token 3bc000 index: temp, neighbor: my attribute Neighbor ID)
Manage inventory (push property on token at index index:lit 0, value: lit 666, neighbor: my attribute Neighbour id)
Manage Inventory (save token in temp)
Dialog "Create token finished"


Edit: playing around i learned that the first time the object gets displayed it informs that i can't find the token (obviously), but if i hide it (destroy it) then make it reappear it'll find it. Can Set to Next token be only called once (it should be by looking at the harry potter cauldron code)? Also I assume it doesn't matter if the GUID for the token differs from the object's GUID. Could Set to Next require some cpu time before it takes effect (idling)?
Retired Duck
retired moderator
#47 Old 28th Aug 2007 at 12:30 PM
Set to next normally continues from the point in the list where it previously left off. Not sure if that information is helpful to you though!

If you dump an error log at that point, can you find your token in the sim's token list?
Lab Assistant
Original Poster
#48 Old 28th Aug 2007 at 11:39 PM Last edited by ScoobyDoo : 29th Aug 2007 at 1:32 AM.
Ahh, that explains it. I assume theres no way to reset it?

I guess I'll have to set to next token, then read it into Temp. Whenever the user adjusts the settings, use the Set nth and then Save Token. Repeat each time user adjusts.

Is there a bhav that forces a debug dump? Right now I'm not getting any errors so it won't spit out an error log.

Edit:btw can that temp token be placed in a local or attribute? Because Temp is needed for my graphic.
Retired Duck
retired moderator
#49 Old 29th Aug 2007 at 4:14 PM
As far as the set to next, if you set whichever variable you're storing the index in to 0 just before you make the call, it should start again from the start. In this case, I think that's temp 0x00?

For the debugging - I just point all paths to error whenever I need an error log. It's irritating because I have to restart again once I have it, but they're pretty good for that sort of debugging. You can check out the debug command, I never quite figured that one out myself.

Not sure what you mean by "Temp is needed for my graphic"... Could you clarify?
Lab Assistant
Original Poster
#50 Old 29th Aug 2007 at 10:58 PM
I believe that did it. I was always wonder why using Error for return would give me undefined transition...

Set to Next works, got Read token to work. But now it's stuck at Get Nth. Also I can not located my token within the log, 666 should stick out well.
Page 2 of 4
Back to top