syberspunk
3rd Apr 2006, 06:13 AM
I did a quick search, and didn't see anything on this yet.
I am trying to use Set to Next to iterate through a sims relatives. I figured that the best way to narrow the search down and avoid the dreaded too many iterations was to use a narrower search to begin with. So I opted for this:
[prim 0x001F] Set to Next (Neighbor with non zero var3 relationship to neighbor ID in temp 0,
result in Stack Object ID,
excluding disabled objects)
Operands:
000000009C0A00000000000000000000
If I understand it correctly, it should return a 'neighboring' sim that has a 'non zero var3 relationship' to the nID that I supply in Temp 0 and stick it in the StO.
As I understand it, this means it should find a sim whose var3 relationship is not zero. Although I'm not quite sure what the var3 relationship is... I am going by examples that I have seen elsewhere (I forget where though... :P).
Anyways. After this, the next line is:
[prim 0x001A] Relationship (var 0x03 ("Familial Relationship") of Stack Object ID to Param 0x0000 ([No TPRP label for BHAV 0x1014 Param 0x0000]),
fail if too small: False,
use neighbor IDs: True,
result in: Temp 0x0000,
don't check presence of second object: False)
Operands:
03020A00000900000800000000000000
So... revisiting this... I have a vague idea of what the line does. I think I understand it as checking the var3 relationship of the StO (which was just set by the Set to Next line) and putting it into T0, failing if it is 'too small' (whatever that means, I'm not sure how 'too small' would be defined... 0? or a negative value?)
Anyways... I would expect that the StO should now be the nID of some neighbor sim that has a non-zero relationship to the nID I supplied previously.
I then use a line to verify that the StO is indeed an nID:
[global 0x014B] Verify - Person ID (1 arg: Neighbor in stack object 0x0000 (person instance id))
Operands:
1800000A00000A00000A000001000000
However... it seems to throw an error on this (according to an error log I received from a user of my mod that contains this code). Unfortunately, I have yet to reproduce this error in my own game. For some reason... the StO is being set to some food object? :confused:
Does this mean that the Set to Next can return Objects instead of sims?
Or am I misusing any of the above lines? I thought that 'Neighbor in stack object' is a way to get back the Object ID if the StO contains an nID? Is this wrong?
If so, then how can I properly get back the Object ID if the StO is an nID?
I'm going to try a couple of things as a temporary fix... perhaps setting the false target of this verify line to loop back to the Set to Next line instead of throwing an error... but I would have expected that the Set to Next should only return neighbors, which I thought was another name for sim objects?
As always, any help will be greatly appreciated. :)
Ste
I am trying to use Set to Next to iterate through a sims relatives. I figured that the best way to narrow the search down and avoid the dreaded too many iterations was to use a narrower search to begin with. So I opted for this:
[prim 0x001F] Set to Next (Neighbor with non zero var3 relationship to neighbor ID in temp 0,
result in Stack Object ID,
excluding disabled objects)
Operands:
000000009C0A00000000000000000000
If I understand it correctly, it should return a 'neighboring' sim that has a 'non zero var3 relationship' to the nID that I supply in Temp 0 and stick it in the StO.
As I understand it, this means it should find a sim whose var3 relationship is not zero. Although I'm not quite sure what the var3 relationship is... I am going by examples that I have seen elsewhere (I forget where though... :P).
Anyways. After this, the next line is:
[prim 0x001A] Relationship (var 0x03 ("Familial Relationship") of Stack Object ID to Param 0x0000 ([No TPRP label for BHAV 0x1014 Param 0x0000]),
fail if too small: False,
use neighbor IDs: True,
result in: Temp 0x0000,
don't check presence of second object: False)
Operands:
03020A00000900000800000000000000
So... revisiting this... I have a vague idea of what the line does. I think I understand it as checking the var3 relationship of the StO (which was just set by the Set to Next line) and putting it into T0, failing if it is 'too small' (whatever that means, I'm not sure how 'too small' would be defined... 0? or a negative value?)
Anyways... I would expect that the StO should now be the nID of some neighbor sim that has a non-zero relationship to the nID I supplied previously.
I then use a line to verify that the StO is indeed an nID:
[global 0x014B] Verify - Person ID (1 arg: Neighbor in stack object 0x0000 (person instance id))
Operands:
1800000A00000A00000A000001000000
However... it seems to throw an error on this (according to an error log I received from a user of my mod that contains this code). Unfortunately, I have yet to reproduce this error in my own game. For some reason... the StO is being set to some food object? :confused:
Does this mean that the Set to Next can return Objects instead of sims?
Or am I misusing any of the above lines? I thought that 'Neighbor in stack object' is a way to get back the Object ID if the StO contains an nID? Is this wrong?
If so, then how can I properly get back the Object ID if the StO is an nID?
I'm going to try a couple of things as a temporary fix... perhaps setting the false target of this verify line to loop back to the Set to Next line instead of throwing an error... but I would have expected that the Set to Next should only return neighbors, which I thought was another name for sim objects?
As always, any help will be greatly appreciated. :)
Ste