More Awesome Than You!

The Bowels of Trogdor => The Small Intestines of Trogdor => Topic started by: rufio on 2011 December 24, 21:01:54



Title: Set to Next family member Spouse
Post by: rufio on 2011 December 24, 21:01:54
Does anyone know what this actually does?  It appears to be made of fail, since I tried to use it, and could not see for all the Too Many Iterations errors.  (For comparison, using rel var 1 & temp 1 with temp 1 = marriage bit, as in x261 had no problems in the same context.)  What's it for, and why does it suck so much?  The only place I've ever seen it is in x20E.


Title: Re: [Modding]Set to Next family member Spouse
Post by: J. M. Pescado on 2011 December 25, 02:29:45
It iterates to the next NID that is the spouse of the input NID. It also probably loops endlessly rather than terminating upon reaching the highest NID (and there's NORMALLY only supposed to be ONE anyway), so that's why you get too many iterations: You need to record your starting point and stop if it repeats itself.


Title: Re: [Modding]Set to Next family member Spouse
Post by: rufio on 2011 December 25, 02:56:25
Ah, I did not know Set to Next could loop endlessly on some settings - good to know.  By "loop", you mean it would go back to NID 0 at some point, so you could just check for 0 and break?  Well, and start with 1.  Does it actually go all the way to unsigned -1, or is there some hard-coded maximum NID? 

ETA:  Now that I am not tired, I can think better.  You'd actually have to call it once to save the NID of the first spouse and then compare for that in the loop body, and now that I think about it, it must return false if it never finds any spouse at all - I had a good 30 seconds of error-free game before a sim with an actual spouse showed up and tried to interact with people.  I get that EA never imagined that you'd ever want to call this more than once in succession, but you'd think the primitives would at least be consistent.

I know there is not supposed to be more than one spouse (which kind of raises the question of why EA decided that should be a StN option, really), but that can't be assumed when you have e.g. the polygamy arch, and it's nice when having polygamous sims doesn't break in-law relationships.


Title: Re: Set to Next family member Spouse
Post by: J. M. Pescado on 2011 December 26, 00:46:28
Actually, they did imagine you would want to call it in succession. Multi-calls are used for things like checking for multiple siblings, parents, etc., where multiples actually exist. Calling it in this way for spouses is an abnormality and not normally how you locate a sim's spouse.


Title: Re: Set to Next family member Spouse
Post by: rufio on 2011 December 26, 05:30:41
Is there another common method of locating the sim's spouse?  Granted, I haven't done a thorough search, but the methods I've seen involve calling BHAVs which themselves just call Set To Next, although they usually use Set to Next 9C or A4.  For example, EAxis's original borked in-laws check called 0x261, which calls Set To Next A4, as I mentioned.


Title: Re: Set to Next family member Spouse
Post by: J. M. Pescado on 2011 December 26, 08:13:00
No idea. Haven't done anything there in ages.