Back Previous Next

The "gay marriage hack", continued

The (barely!) simple version of the extended gay marriage hack has some imperfections where child move-ins are concerned. The children sometimes have missing animations. In a single-parent family, the child takes all its family members with it. Members of all-child families can't move in with another family.

This is going to be dry and boring, so bear with me. First, those pesky missing animations. I click on whatever trees seem relevant to move-ins and note the numbers in the lines that start with "Animate Sim". These numbers refer to animations under one of the four animation sub-blocks of the STR# block. "A2O" is for adults in situations where height doesn't matter, "A2C" is for animations between differently sized Sims, and "C2O" and "C2A" is the same again from a kid's eye view. Each of these three-letter blocks has a list of numbered animations under it.

In all cases except two, the animation exists under both A2O and C2O. The two missing ones are #367, "a2a-proposee-no-subtle" and #466, "a2a-proposee-no", in tree #4266, "propose deny dialog"; they're only named under "A2O" and there are no child versions for them. Looking at these animations in the Sims Character Makeover, I find that they resemble the "disapprove" and "refuse" animations, which exist for both adults and children.

My choice to supply the missing animations under the C2O heading: "c2o-refuse-subtle" and "c2o-refuse-strong". I fill these in the gaps at #367 and #446 (for the latter, I have to left-click and add a line) and am now confident there will be no more missing animations.

I still get missing animations between adults and children when the proposee is about to say no, however. The abovementioned animations, as well as animation #103, are also missing in A2C and C2A. For #367 and #446, I already know what missing animation to supply: "c2o-refuse-subtle" and "c2o-refuse-strong" for C2A, and, since these animations have adult equivalents, "a2o-refuse-subtle" and "a2o-refuse-strong" for A2C. Animation #103 is "A2A-shrug" in A2O and "C2O-shrug" in C2O. The first is transplanted to A2C, the second to C2A.

The file I'm adding these strings to is "SocialInteractions.iff" in House Party and below, and "HDSI_Propositions.iff" in Deluxe and from Hot Date upwards. The HD+ expansion packs still have the old SocialInteractions.iff, and I suppose it can't hurt to edit that along with its HDSI version. There is also a "HDSI.iff" which resembles both other files, but it looks pretty gutted, that is, all the strings have been taken out, including menu items, so I'm going to ignore it.

Next comes a line-by-line analysis of the guilty code, tree #4241, "do move in". The code in the pre-Unleashed files goes:

#0 Stack Object ID Assign To: Stack Obj's Attribute 6
28,Error
#1 Local Variable 0 Assign To: my person data family number
6,Error
#2 Generic Sims Call (add to family)
30,False
#3 Stack Object ID Assign To: 0
5,Error
#4 neighbor's person data family number Equals? Local Variable 0
11,5
#5 Set to Next (neighbor id)
4,7
#6 Local Variable 1 Assign To: 0
20,Error
#7 Local Variable 1 > 1
23,8
#8 Local Variable 1 > 0
12,9
#9 Break Point (if 1!=0)
False,Error
#10 Local Variable 1 += 1
5,Error
#11 neighbor's person data Person Age > 17
10,19
#12 Stack Object ID Assign To: 0
13,Error
#13 Set to Next (neighbor id)
15,30
#14 Generic Sims Call (combine assets of family in temp 0)
True,True
#15 neighbor's person data family number Equals? Local Variable 0
16,13
#16 Generic Sims Call (add to family)
17,False
#17 neighbor in stack object person instance id Equals? 0
18,13
#18 (glob:) Schedule (01 00 00 00 00 00 00 00)
13,Error
#19 neighbor's person data Person Age Equals? 0
10,21
#20 Local Variable 2 Assign To: 0
3,Error
#21 Local Variable 2 += 1
5,Error
#22 Dialog (message: id#23, icon: neighbor)
True,Error
#23 Stack Object ID Assign To: my person data neighbor id
2,Error
#24 Dialog (message: id#24, icon: neighbor)
32,Error
#25 Temporary Storage 0 Assign To: neighbor in stack object family friend count
26,Error
#26 Temporary Storage 0 -= Local Variable 3
29,Error
#27 Local Variable 3 Assign To: neighbor in stack object family friend count
1,Error
#28 Stack Object ID Assign To: stack obj's person data neighbor id
27,Error
#29 Local Variable 3 Assign To: Temporary Storage 0
31,Error
#30 Stack Object ID Assign To: my person data neighbor id
25,Error
#31 Local Variable 1 > 1
22,24
#32 Temporary Storage 0 Assign To: Local Variable 0
14,Error

In Unleashed, the following lines were added in "HDSI_Propositions.iff" for strays (the stray family ID is apparently "2000"), and the goto-line numbers altered to include them in the checks. They can be ignored, their only significance is that I'll now be adding lines numbered from #42 upwards instead of #33 upwards.

#33 Local Variable 0 Equals? 2000
#34 Temporary Storage 0:=random from 0 to < 20000
#35 Alter Budget (add Temporary Storage 0 as misc income)
#36 Generic Sims Call (add to family)
#37 Stack Object ID Assign To: my person data neighbor id
#38 Local Variable 0 Equals? 2000
#39 Local Variable 4 Assign To: 0
#40 neighbor's person data gender > 1
#41 Local Variable 4 += 1

Going through this line by line:

#0 Stack Object ID Assign To: Stack Obj's Attribute 6

The sixth attribute of the stack object - probably the Move In interaction - is filled with an object ID value. This object, probably the proposer, is made the new stack object. If this works, the program continues with line 28, else it exits. "[number],Error" lines always signify a linear progression.

#28 Stack Object ID Assign To: stack obj's person data neighbor id

The stack object is then set to, by the looks of it, the ID of the family of the proposing Sim. On to 27.

#27 Local Variable 3 Assign To: neighbor in stack object family friend count

The number of family friends of the proposer is stored in local variable 3. On to 1.

#1 Local Variable 0 Assign To: my person data family number

The proposee's family number is stored in locvar 0. (After a while, one starts to abbreviate...) Goes to 6.

#6 Local Variable 1 Assign To: 0

The adult count (that's what this variable will be used for) is set to zero. On to 20.

#20 Local Variable 2 Assign To: 0

The child count is set to zero. On to 3. (In Unleashed, locvar 4 is used for an animal count.)

#3 Stack Object ID Assign To: 0

The stack object is set to nothing in preparation for a loop starting at line 5.

#5 Set to Next (neighbor id)

Go through all the Sims in the neighbourhood one by one. If a Sim was found, go to 4, if all the Sims have passed the loop, go to 7. I'll follow the "Sim found" branch first:

#4 neighbor's person data family number Equals? Local Variable 0

Is the neighbour found of the same family as the Sim proposed to? Then go to 11, else back to 5 (find next Sim).

#11 neighbor's person data Person Age > 17

Is the family member (the proposee goes through this loop too) adult? If so go to 10, else to 19.

#10 Local Variable 1 += 1

Add 1 to adult count and go back to 5, find next Sim.

#19 neighbor's person data Person Age Equals? 0

Is the proposee's family member a baby? If so, go to 10, else, go to 21. So babies are counted as adults! Presumably because a Sim from a family with a baby in it can't be asked to move in or marry anyway.

#21 Local Variable 2 += 1

The Sim (if not a stray, in the UL version) has to be a child. Add 1 to child count and go back to 5, find next Sim.

The False line (no more Sims found) goes:

#7 Local Variable 1 > 1

If more than one adult in proposee's family, go to 23, else go to 8. I know what this means: the last adult in the family takes everyone and everything with them, and leaves an uninhabited house. Otherwise, the Sim just leaves their old family. Going down the branch of one Sim leaving the family:

#23 Stack Object ID Assign To: my person data neighbor id

Fill stack object with family ID of Sim moving in and go to 2.

#2 Generic Sims Call (add to family)

The proposee's data are changed to make him/her/it part of the proposer's family (this also happens to adopted strays). Go to 30.

#30 Stack Object ID Assign To: my person data neighbor id

Fill stack object with family ID of family that Sim just joined and go to 25.

#25 Temporary Storage 0 Assign To: neighbor in stack object family friend count

The old family friends number of the family just joined was stored in locvar3, the new number is stored in TS 0. Go to 26. (Apparently the friends are transferred, and the proposee ceases to be a family friend, in the "add to family" subroutine.)

#26 Temporary Storage 0 -= Local Variable 3

Subtracting the old value from the new will show if the new member had any friends to add, or if the family just loses one family friend. On to 29.

#29 Local Variable 3 Assign To: Temporary Storage 0

Locvar 3 becomes the number of friends gained (or lost) by the move-in. To 31.

#31 Local Variable 1 > 1

As both the simple move-out and the all-move-out use the code from line 30 onwards, another check whether this is one person leaving. or the whole family. If it's just one, go to 22, else go to 24.

#22 Dialog (message: id#23, icon: neighbor)

The simple dialog: "Your household just gained a new member, and any friends of theirs are now friends of yours." Tree #4241 exits here.

Now to the multiple move-in starting at 8:

#8 Local Variable 1 > 0

Is there at least one grownup in the house? Go to 12, else go to 9. (This is why the test "don't move out when you've got a baby" is so important: babies are counted with adults!)

#9 Break Point (if 1!=0)

This is why orphans can't move out - with no grownups in the house, the program exits at line #9. Definitely something to change! The child rules should be like the adult rules, ie. last one to leave takes all. This does matter in UL, where pets left behind when the last orphan moves out can die of starvation with no one to feed them. (Or they might have the sense to become strays, visit the new family and be adopted again...)

#12 Stack Object ID Assign To: 0

The stack object is emptied for the repeating loop that will gather all Sims (kids and pets) to move out with the proposee.

#13 Set to Next (neighbor id)

Go through all Sims in neighbourhood again. Go to 15 if one is found, 30 if there's no more to loop through.

#5 neighbor's person data family number Equals? Local Variable 0

Is the neighbour part of the proposee's family? If not, back to 13 and find next Sim, else to 16.

#16 Generic Sims Call (add to family)

The proposee's family member (this should be a child or pet) is moved in. Go to 17.

#17 neighbor in stack object person instance id Equals? 0

This one checks if the family member is on the premises. If not, summon them; else, go to 13 (find next Sim).

#18 (glob:) Schedule (01 00 00 00 00 00 00 00)

This line summons the absent new family member to the lot, and then goes back to 13.

When the loop ends, on with the move...

#30 Stack Object ID Assign To: my person data neighbor id
#25 Temporary Storage 0 Assign To: neighbor in stack object family friend count
#26 Temporary Storage 0 -= Local Variable 3
#29 Local Variable 3 Assign To: Temporary Storage 0
#31 Local Variable 1 > 1

These should look familiar - the single move-out went through the same routine - so I've lumped them all together, ending on the multiple move-out check. This is why the last child moving out takes its parent with it and the dialog pretends the parent moved out; an orphan trying to move out (if not stopped at line 9) would be treated like the last person to move out here. The outcome this time will be line 24.

#24 Dialog (message: id#24, icon: neighbor)

"Your household just gained a new member whose family friends are now your family friends. And $Neighbor has also contributed $$FamilyAssets:0 to the household account and has brought $Local:2 children." Pets are not mentioned in the UL version. Obviously, a child Sim doesn't bring children, so a child move-in, even if this was the last child to leave, needs a different dialog string.

#32 Temporary Storage 0 Assign To: Local Variable 0

The proposee's old family ID which was stored in locvar 0, is put in TS 0, that is, in a place where another routine can read it. On to 14.

#14 Generic Sims Call (combine assets of family in temp 0)

The old family's money is added to this family's money. Followed by exit.

Time for Deep Thought. Children in families with adults in them should always be able to move out alone (to get away from their horrible stepmother, muahahahaha). For orphans, the last one to leave takes the money (and, in UL, the pets) just as the last adult would. When there's more than one adult, child move-outs go fine. It's when the number of adults is 1 or 0 that things go wrong.

Line 7 asks: are there more adults in the proposee's family? A True leads to a simple move-out, a False to the question in line 8: is this a single-parent family? If the asker is a child this should lead to the simple move-out, so I'm going to add an extra line, which will be #33 for "SocialInteractions.iff" and #42 or another number (depending on the expansion pack) for "HDSI_Propositions.iff" and which I shall therefore call line A.

#A my person data Person Age < 18

Code: 2: 58, 18, 256, 1810; 23, 12
This means: function=expression, followed by the decimal value of the four parameters, followed by True/False outcome. True goes to line 23, single move-out, False to 12. Line 8's True outcome should be set from 12 to the number of line A.

In line 9 I know the proposee is a child, because there are no adults. The question remains: is it the last child? I'll change it to ask this and if so, to go to the mass move-out branch.

#9 Local Variable 2 > 1

Code: 2: 2, 1, 0, 1817; 23, 12

That's fixed the orphan and single-parent problem. Now for that stupid dialog. The line that preselects for closing dialogs is line 31. I'm going to add another line, B (obviously its number will be 34 or 43) to again ask the child question, make lines C and D for the orphan question and line E for a new dialog, which I will also have to add in the STR# section. Line 31's False outcome will point to line B.

#B my person data Person Age < 18
#C Local Variable 2 > 1
#D Local Variable 1 = 1?
#E Dialog (message: id#36, icon: neighbor)

Code B: 2: 58, 18, 256, 1810; C,24
Code C: 2: 2, 1, 0, 1817; 22,D
Code D: 2: 1, 1, 512, 1817; 22,E
Code E: 36: 0, 37, 0, 1024; 32, Error

In the case of one Sim-adult or less, line B asks: is the proposee a child? (If not, show the single parent dialog.) Line C asks, if it is a child, are there more children? (Leads to one-person move-out dialog.) If it is the only child, line D asks, is there one adult? If so, go to one-person move-out dialog, otherwise the child is the last inhabitant, so go to dialog #36 (line E).

In the STR# block in #301, the "Dialog prim string set", I add a line 36 and copy the data from line 24, minus the children bit. I then have to repeat this for all languages. For the Asian ones I simply copied & pasted line 24, as I didn't know how to change them.

It occurs to me that this new dialog, which doesn't have the "and brings [n] children", would also be great for childless adult Sims when they're the last to move out. So I'm going to add line F and adjust line B a little:

Code B: 2: 58, 18, 256, 1810; C,F

Code F: 2: 2, 0, 0, 1817; 24,E

Now the single adult last-to-leave Sim will get the same dialog as the single infant last-to-leave Sim.

One last niggle. When asked to move in, proposee does a bit of maths to see if it would fit: if proposee is the last adult, all other family members are counted in #4161 "count movers and family members" via #4104 "can stack objd move in". The whole family should be counted only if i. there's one adult, and the proposee is that adult or ii. there's no adult and only one child. Otherwise, a child with two parents will count itself as a family of three, even though it will leave the grownups behind when moving out.

I tried to have a separate child tally in #4161, but somehow this stopped move-ins altogether. So instead I put two lines of code in #4104 to the effect that when a child is asked to move in, the number of movers will always be 1. This may cause problems in Unleashed, where a single child may bring pets with it, but should work perfectly well with all previous versions. (Actually, there's no real problem in UL, because as of Deluxe, and possibly HD, a family can have more than 8 members. Only the first 8 icons will show, meaning that family members with a higher number can't be controlled or centered by clicking their icon, but they can still be selected using the Space bar.)

The two lines of code to add in #4104 are:
-Point the True outcome one line 4 at 5.
line 5: 2: 58 18 256 1811 True=6 False=1
line 6: 2: 1 1 1280 1817 True=2 False=Error

The line numbers are the same for "SocialInteractions.iff" and "HDSI_Propositions.iff". The text appearing as these values are entered should explain what these lines do.

There's more I could do with the Gay Marriage hack. Since I've installed Hot Date and Vacation, I could allow adults and children to invite each other Downtown and to Vacation Island. I won't, however. So many obstacles await kid Sims going to the grownups' haunts that unless I hack huge numbers of objects to make them child-friendly, there's no point. I could also enable visitors to stay the night; adults will leave when their needs run out, which invariably happens as there's nothing for them to sleep on or clean themselves (well, maybe the hot tub) while children are programmed to either be picked up by their parents or, if they're orphans, to leave at 9 p.m. I could do something to avert military school for bad pupils, or find the right social interaction files and curb the Sims' jealous tendencies. Some of these alterations can be imported as BHAV blocks with IFF Pencil, others require menu changes. Whatever further customizations I add will be described in Beyond the Gay Marriage Hack.





Back Previous Next