Coding Help How to override Universal Hate with Personal Love?

Peridactyl

Newcomer
Hi! I did a quick search and surprisingly didn't see this question asked yet. Is there a simply rule for how to consistently override a universal hate (for gift tastes) with a personal love? I am trying to make a new NPC love trash. I would rather not take trash out of the universal hate category, I just want this one NPC to love it. I couldn't find a way to do it based on these conditionals from the Wiki, but maybe someone else is better with the logic than I am or just knows the trick. Thanks!

From the wiki:
// part IV: sometimes override with personal tastes
if ((npc loves itemID OR (item has a category AND npc loves category)) AND (item has no category OR npc doesn't personally love category OR no universal taste for itemID)
return love
if ((npc hates itemID OR (item has a category AND npc hates category)) AND (item has no category OR npc doesn't personally hate category OR no universal taste for itemID)
return hate
if ((npc like itemID OR (item has a category AND npc likes category)) AND (item has no category OR npc doesn't personally like category OR no universal taste for itemID)
return like
if ((npc dislikes itemID OR (item has a category AND npc dislikes category)) AND (item has no category OR npc doesn't personally dislike category OR no universal taste for itemID)
return dislike
if ((npc neutrals itemID OR (item has a category AND npc neutrals category)) AND (item has no category OR npc doesn't personally neutral category OR no universal taste for itemID)
return neutral
 

SomeoneEls

Sodbuster
Instead of resorting to harmony in this case, it would be best to use content patcher to add onto the Data/NPCGiftTastes asset. Basically, it caches all of the unique tastes per person alongside the universal loves and hates. This also includes hate and love dialouge in the value for that person.

Oh yeah, the important part. So basically beside your npc's name, is the string with all of that juicy data. It is in the pattern that the quote for the tier of gift (hate, love, ect) that comes before the Category ids (the numbers with -'s) and object ids (the numbers with no -'s) that are loved/hated/ect. Its in the order best loved to worst and seperated by /'s. Dont remove the /'s.

What you need to do is change the ids for loved with "-20". Thats the category id for junk. It should be inside the /'s. That, or if you didnt create the string yet, create the whole thang.

You can do that either with content patcher or harder with C#. I usually use c#, so uh, you probally want to use editdata with a dictionary lookup.
This is what it probally looks like..?

{
"Format": "2.6.0",
"Changes": [
{
"Action": "EditData",
"Target": "Data/NPCGiftTastes ",
"Fields": {
"[NPCNAMEHERE]": "[STRING WITH THAT DATA HERE]"


}
}
]
}

An example where robin now only loves trash.

{
"Format": "2.6.0",
"Changes": [
{
"Action": "EditData",
"Target": "Data/NPCGiftTastes ",
"Fields": {
"Robin": "This is for me? Wow, I absolutely love it!!/-20/Thanks! This is really nice!/-6 -79 424 709 SkillBook_2/Um... why?/16 330/What the...? This is terrible!//Thank you. This might come in handy.//"


}
}
]
}

Anyways, here are some resources ya can look into for this. They probally explain it better than me.



 
Top