As fun as it was (see the happy thread), I stayed up to 4:15 this morning trying to hack some stuff in DF the hard way. You know, staring at hexadecimal numbers, converting the endianness so I could dereference pointers, fiddling with numbers, pausing and unpausing the game hoping my changes had a notable (and desirable) effect, and frequently rebooting the game because I did something it didn't like and it crashes.
For what it's worth, don't try to make single dwarves pregnant. Game doesn't like it. Haven't tried males yet, but I bet it'll crash for that too, even if they're married.
My eventual goal is to be able to pick two dwarves and marry them. After quite a bit of effort, I managed to figure out where the pointer to the friendship vector was for each dwarf. Dereference that, and I found the meeting counters for each of their friends. I can change grudges to friends, or the other way around. I can turn friends into acquaintances.
But I can't freaking figure out how to tell the game they're married. There is a relationship entry, just like normal, for their spouse, but its type is just the same as the others (friend). The meeting timer doesn't count up for that relationship though... which is odd, but I can't figure out why that is either.
Fiddling with the relationship struct doesn't do a thing for the spouse, which is frustrating. I did deduce that you can set references to other dwarves for the spouse ID (another currently undocumented field in the dwarf structure), which gives them the "talked with the spouse" thought, even if they've never met the dwarf before. There's another field 0x20 bytes later that does the same thing for lovers. It's amusing, but still doesn't do what I want.
Raaaargh... I'll figure this out if it kills me. I'm tempted to PM Toady and just flat ask him how the game stores the spousal relationships. It must be caching them somewhere outside of the creature definition or their relationship definitions. It must...
By the way, I'll both rage even more and be happy if it turns out someone else has already done this and I've wasted the time...