Title: Question regarding Set to Next: Verify Neighbor ID in Stack Object Post by: syberspunk on 2005 December 21, 23:38:49 I'm trying desperately to mod something, and the code appears to be correct. I had to debug this the brute force way with Break Points, and I've narrowed it down to the following issue, namely: Sims that I would think are supposed to be considered alive (well... maybe they're brain dead :P), but for some reason they are returning true for the test: Quote 0: Death - Is Sim Dead? (NID)(Param 1); true: false, false: 1 Operands: 0901000A00000A00000A000001000000 Specifically, I've been testing this on the Pleasant family. I further narrowed it down to this line: Quote ### # Group = 0x7FD46CD0, Instance = 0x301 # Title = Death - Is Sim Dead? (NID) # # Format = 8009, Params = 1, Locals = 1 # Tree type = 0, Header flag = 18, Tree version = FFFF800B (-32757), Cache flags = 0 0: Verify - Neighbor is Linked(Param 0); true: 1, false: true And even further still: Quote # Group = 0x7FD46CD0, Instance = 0x39D # Title = Verify - Neighbor is Linked # # Format = 8009, Params = 1, Locals = 0 # Tree type = 0, Header flag = 0, Tree version = FFFF8008 (-32760), Cache flags = 0 0: Stack Object := Param 0; true: 1, false: error 1: Set to Next: Verify Neighbor ID in Stack Object; true: 2, false: 3 2: Neighbor's Object Definition type (0x9) == 17 (0x11); true: false, false: true What exactly does this line do? And why, Why, WHY? is it returning false? From just reading it, the name itself implies to me that it is verifying if the NID in the Stack Object is in deed a true NID. There is a bit more info in SimPE,where it says: Set to Next: (Verify Neighborhood ID in Stack Object, result in Stack Object, excluding disabled objects) Is this last part about excluding disabled objects tripping me up? I guess I shouldn't bother checking if these sim's are dead? ::) The thing is, one would assume that Daniel and Mary-Sue Pleasant are indeed alive. But for some reason, they are retuning as not linked. I can't figure it out, and I've checked the node version and operands, and it looks like it should be ok. I must be missing something. I'll post the error log as well. Incidentally, I Feel free to burninate this thread if it is far too trivially weak and feeble. :P Ste [attachment deleted by admin] Title: Re: Question regarding Set to Next: Verify Neighbor ID in Stack Object Post by: J. M. Pescado on 2005 December 22, 00:18:20 What exactly does this line do? And why, Why, WHY? is it returning false? From just reading it, the name itself implies to me that it is verifying if the NID in the Stack Object is in deed a true NID. That's what it is doing, yes. That would return false if the NID being fed into it is invalid for some reason. Is the sim's character-data shredded? That might cause it.Title: question about norandomflirtwants? Post by: syberspunk on 2005 December 22, 02:44:20 I think I know what the problem was. I was assuming that the params I should be passing in were supposed to be Stack Objects of type person/sim. But I think they are actually supposed to be of type person's data 0x1f - Neighbor ID.
So far... that seems to have fixed the errors I was getting. Anyways, I was looking at the code below, and for the most part I understand it. However, I have a few questions about the following lines of code, in particular the ones I made bold. Quote A: Stack Object := 0; true: B, false: B B: Temp 0 := Param 0; true: C, false: C C: Temp 1 := Const 0x11C(Relationship - UI Flags):0x2; true: D, false: D D: Set to Next: NeighborID with rel var 1 & temp 1; true: E, false: F E: Death - Is Sim Dead? (NID)(Stack Object); true: B, false: false Above, you are looking for the next NID that is in love with the object in Param 0. The Set to Next finds that NID and stores it in the Stack Object. You then test if that Stack Object is a Dead sim. Essentially, this tests if there are any living sims that the subject (Param 0) is in love with. If this is true, then you exit since we don't want them to get random flirt wants. Otherwise, if all of the sims they loved are dead, or if you couldn't find any at all, we move onto the checks for Engaged or Married. Quote F: Stack Object := 0; true: 10, false: 10 10: Temp 0 := Param 3; true: 11, false: 11 11: Temp 1 := Const 0x11C(Relationship - UI Flags):0x3; true: 12, false: 12 12: Set to Next: NeighborID with rel var 1 & temp 1; true: 13, false: 14 13: Death - Is Sim Dead? (NID)(Param 3); true: 10, false: false 14: Stack Object := 0; true: 15, false: 15 15: Temp 0 := Param 3; true: 16, false: 16 16: Temp 1 := Const 0x11C(Relationship - UI Flags):0x4; true: 17, false: 17 17: Set to Next: NeighborID with rel var 1 & temp 1; true: 18, false: true 18: Death - Is Sim Dead? (NID)(Param 3); true: 15, false: false In the above lines of code, why is that you are checking Param 3 instead of the Object Stack? Does the Set to Next in this case also change the value of Param 3? When I looked at the lines in SimPE, it still says the Set to Next instruction is storing the result in the Stack Object. Does it additionally change the value of Param 3? I'm still not quite sure how these relationship checks and comparisons work. Setting flag bits and what not, it's kinda confusing to me. I was just curious why this was different, since I'm Ste Title: Re: Question regarding Set to Next: Verify Neighbor ID in Stack Object Post by: crammyboy on 2005 December 22, 02:57:50 where did you get that code. I can't find it in my object listing.
Title: Re: Question regarding Set to Next: Verify Neighbor ID in Stack Object Post by: syberspunk on 2005 December 22, 04:08:27 where did you get that code. I can't find it in my object listing. The code I quoted? It's from FFS norandomflirtwants.package The original "CT - Flirt with Sim" is only two lines. This additional code I think prevents sims from rolling up wants to flirt with random sims other than their own steady, finacee, or spouse, unless they are already in love as well (having an affair). Ste Title: Re: Question regarding Set to Next: Verify Neighbor ID in Stack Object Post by: syberspunk on 2005 December 23, 01:18:37 Quick question about the new code in norandomflirtwants:
Quote 10: Temp 1 Set Flag Const 0x11C(Relationship - UI Flags):0x2; true: 11, false: 11 11: Temp 1 Set Flag Const 0x11C(Relationship - UI Flags):0x3; true: 12, false: 12 12: Temp 1 Set Flag Const 0x11C(Relationship - UI Flags):0x4; true: 13, false: 13 13: Temp 1 Set Flag Const 0x11C(Relationship - UI Flags):0x7; true: 14, false: 14 14: Set to Next: NeighborID with rel var 1 & temp 1; true: 15, false: true So you are setting all the flags now, does this return sims with any of these flags set? Or with all of these flags set? My guess is the former, but I just wanted to be certain. Thanks! :D Ste |