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!
Instructor
Original Poster
#1 Old 7th Apr 2017 at 10:17 PM
Default Stack Object's VS Neighbor's Person Data
I thought I understood this ...

As I understand it
Sim NID is a fixed id that never changes for the Sim
Sim OID changes depending on what else is on the lot, but is always the same once the lot has been entered for play

Stack Object ID := Sim OID
Local 0 := Stack Object's (person data) PTO

Local 0 has the amount of PTO accrued by the Sim - this works (as I understand it!)

Stack Object ID := Sim NID
Local 1 := Neighbor's (person data) PTO

Local 1 is always 0 (even when the Sim has accrued PTO), this is NOT what I expected, I expected it to be the same as Local 0

Stack Object ID := Sim NID
Stack Object ID := Neighbor in stack object person instance id
Local 2 := Stack Object's (person data) PTO

Local 2 has the Sim's PTO (same as Local 0 above), this is what I expected

Clearly Neighbor's person data doesn't work how I thought it did. Or is it perhaps reading the initial data the Sim was created/instantiated with and not the current data (PTO is changing)

But then, in other code I have,

Stack Object ID := Sim NID
Neighbor's (person data) PTO -= 0x0064

which appears to correctly subtract 1 day of PTO from the Sim (in that the UI updates and shows one day less)

So confused!

Just call me William, definitely not Who-Ward
Advertisement
Scholar
#2 Old 8th Apr 2017 at 5:08 PM
You are correct that the Nid doesn't change but Id does each time the lot is loaded.
Mostly while a sim is running any changes are made to the sim's person data which is transferred to the sim's neighbour data only when the game is saved. There are some exceptions, relationship changes almost always use the Nid. For code like that it should check if the sim is on the lot and use the sim's person data if available and only use the neighbour data if the sim is not available. A typical example of that is in the global 'Death - Is Sim Dead? (NID)' (0x0301) even though the code expects an Nid it still checks for the sim to be available and uses the person data if possible in case there has been a change since the lot loaded.
Instructor
Original Poster
#3 Old 8th Apr 2017 at 6:09 PM
Many thanks. (and for your other insight re create/delete object - which I'm still trying to get my head around)

So, if I assume, Neighbor's person data is the last saved state of the Sim while Stack Object's/My person data is the current state of the Sim, I should stop confusing myself!

Just call me William, definitely not Who-Ward
Back to top