A mod idea about marriage candidates

Quirinea

Farmer
I don't know how easy this would be to make (and whether it would require C#-coding), I've been doing just CP-mods. There are mods that add romance to more characters, so I suppose it's not impossible.
I think it feels silly that all the bachelors and bachelorettes dream of marrying the new farmer...
How about a mod that gives you only a few possibilities (and maybe of a bit larger pool -- especially I'm thinking of Clint and Sandy who make sense as characters)
My idea would be following:
1) give a number of possible candidates (maybe from one or two to six, or whatever
2) choose gender (bachelors, bachelorettes or both)
3) either ask for a random choice or pick manually a selection (in the latter possibility 2) is of course unnecessary)
The characters left out ould develop "normal" friendship.

BTW I've never liked it that the full friendship is 8 hearts for marriage candidates and 10 on the other townspeople. Base 10 (or whatever) for everyone and then extras for sweethearts would be more logical. Besides the difference messes up the NPC list, especially when you are nearing the full friendship for most and look whom to give gifts
 

SomeoneEls

Sodbuster
I can see this being done in

*a class that implements this new data that reads from a stored json file/ text file
*Harmony patching to augment any hardcoded methods that are tricky to write around, like how freindship works [if applicable, might be]
*Transpliers as a last ditch resort if some part of a method is unruly and being a.. bad thing. [If applicable, probally isnt]
*Changing the data and diolouge using C#

So yeah. I think is totally possible. I did a little glimpse of the game methods and it looks like (don't quote me on this) that its mostly non hardcoded game data that needs to be changed. Of course, I might be wrong but it does seem like smooth sailing.

for anyone who might want to take this up, here are some resources.


And if you DO have to use harmony

 

Quirinea

Farmer
Yeah. I was thinking that as it is possible to add new characters as either romanceable or not, and there are a lot of mods that make this or that character romanceable it should not (added) be technically very hard (I haven't done any mods adding characters simply because I suck at graphics and don't want to make characters by making someone a twin with different hair colour)
Actually I wanted to throw this idea for anybody wishing to do a mod. I have a bunch of mods I should check and rerelease and haven't got the time and energy (I finally posted the update of Stardew Finnish, half-tested, I hope there aren't skeletons outside the mines....)
 
Last edited:

SomeoneEls

Sodbuster
Ive decided to take this idea and try to incorporate some of it into my mod, well, kind of.
Im just making it so based on your character name you will randomly be able to romance literally everyone. Like you might not be able to romance the bachelors and might be able to romance clint. Or Pierre. Or Robin.

Though, im having some issues trying to set it up so ill make another thread dealing with that.
 

SomeoneEls

Sodbuster
Fixed the issues, though there isnt any real sprites for it. Also made it that you can't date someone that is married.
Here is the code for anyone who wants to use it for their own stuff. Its kinda cursed though.


int seed = 0;
for (int i = 0; i < Game1.player.Name.Length; i++)
{
seed += Game1.player.Name;

}

doRomance(seed);


C#:
void doRomance(int seed)
{
    int x = 2;
    bool can = false;
    bool noCanidates = true;


    foreach (var data in Game1.characterData)
    {
        Netcode.NetBool t = new Netcode.NetBool(true);
        Netcode.NetBool f = new Netcode.NetBool(false);
        NPC n = getCharacter(data.Key);
        if (n == null)
        {
            continue;
        }
        foreach (var data2 in data.Value.FriendsAndFamily)
        {
            Console.WriteLine(data2.Value);
            if (data2.Value == "[LocalizedText Strings\\Characters:Relative_Husband]" || data2.Value == "[LocalizedText Strings\\Characters:Relative_Wife]")
            {
                can = false;
                Assembly.GetAssembly(typeof(NPC))
                     .GetType("StardewValley.NPC")
                    .GetField("datable")
                     .SetValue(n, f);
                goto NPCoverride; //either its a goto or ANOTHER flag. It just reads better for me using goto, and the label is pretty clear on what it does.
            }
        }
        if ((seed % x > x / 2) && (data.Value.Age == NpcAge.Adult))
        {
            can = true;
            noCanidates = false;
            Assembly.GetAssembly(typeof(NPC))
            .GetType("StardewValley.NPC")
           .GetField("datable")
            .SetValue(n, t);

        }
        else
        {

            can = false;
            Assembly.GetAssembly(typeof(NPC))
                 .GetType("StardewValley.NPC")
                .GetField("datable")
                 .SetValue(n, f);
        }

    NPCoverride:
        data.Value.CanBeRomanced = can;
        x++;
    }


    if(noCanidates)
    {
        doRomance(++seed);
    }


}






NPC getCharacter(string npcName)
{
    foreach (GameLocation loc in Game1.locations)
    {
        if (loc.characters.Count > 0)
        {

            foreach (NPC npc in loc.characters)
            {
                if (npc.Name == npcName)
                {
                  
                    return npc;
                   
                }

            }
        }
    }
    return null;
}

Btw, if there is anyway to do this better, uh, do it that way. It is very labor intensive and happens once a day at the start. However, due to how the seeds work it doesnt change. Also it has a little thing where 2 farmers with the same name will have the same canidates.
 
Last edited:
Top