[1.3.0] Hospitality

Started by Orion, March 13, 2015, 11:19:16 AM

Previous topic - Next topic

faltonico

Against all common sense... i made another colony in A16 (because i'm hyped over rimushima).
Your update is faring well for me, though i didn't install it until i was ready to receive visitors.
I don't usually recruit through your mod unless i see some outstanding prospect, i have yet to do it with the new update, but so far, i have had the possibility to recruit several guests.
Correct me if i'm wrong, guest make friends easily with pretty/beautiful pawns, and they are most likely to befriend colonist if they are set to entertaining them, event if they are not that good at social, a nice cowboy hat helps them.

I see them coming loaded with silver, but sometimes i worry that they'll run out of money and thus can't buy any more food because they expend a lot buying crap i leave around their area. ¿Do they come with enough food for their stay? or is their load-out random?

AngleWyrm


The guests that arrive have a friendship requirement; a count of the number of people in your colony they consider friends. Social chats increase (and sometimes decrease) the relationship until it crosses over to friendship.

Once they have their needed count of friends in the colony, they can join the colony as their new home.

The bar that indicates how many friends they need, and how many they currently have can be seen by selecting a guest and then clicking on the guest tab.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

Orion

The silver and item loadout is indeed random. With me, in fact, they usually bring enough food that they never need to buy anything. I'm not touching that part of the code.

Some people have reported that visitors just take food when they're hungry. That's most likely a mod conflict, though.

Another thing about the required friends, by the way - should they meet someone in the colony they don't like, they will need an extra friend to be recruited. So for example they'd require 3, but there are 2 colonists they don't like, they will require 5 instead of 3 to make up for it. The base amount of friends needed is dependent on how many colonists you already have.
Also the required friendship level increases over time and with game difficulty. It uses a similar formula to the one used for recruiting prisoners.

faltonico

Quote from: Orion on April 01, 2017, 07:20:54 AM
Another thing about the required friends, by the way - should they meet someone in the colony they don't like, they will need an extra friend to be recruited. So for example they'd require 3, but there are 2 colonists they don't like, they will require 5 instead of 3 to make up for it. The base amount of friends needed is dependent on how many colonists you already have.
Also the required friendship level increases over time and with game difficulty. It uses a similar formula to the one used for recruiting prisoners.
That would explain why some guest says that they can't be recruited even though i have over the amount of friends required... I'll have to make a new area to separate problematic pawns from guests.
Thanks for clarifying that.

Also, when i first installed it, visitors never came... and then, shyly, ambassadors came very infrequently, i bribed the other factions to 100 good will, and gradually the kept coming back, to the point i got this:

2 different factions visiting at the same time.

bob112

does anyone know what counter (300) = 300 means in the debug log? because for some reason when the hospitality mod is installed it stops visitors from arriving both naturally and when I try to spawn them in via dev mode it doesn't stop caravans or travellers/wanderers just visitors I don't know what caused it to happen or how to stop it but I'd like to know because it pretty much makes the hospitality mod useless and I quite like the hospitality mod can anyone help?

Orion

I've released a new version:

Update
- Fix: Exception when guests are taken prisoner
- Fix: Strange behavior when arresting guests
- Tweak: Charming guests now adds less mood
- New: Spanish translation
- New: Now supporting Dubs Bad Hygiene mod
- Tweak: Guest need satisfaction behavior
- New: Now using HugsLib

Dr_Zhivago

New update causes an error log with "Psychology"

[HugsLib] Exception during DetourMethodByAttribute: System.Exception: Failed to detour method Pawn_RelationsTracker.Notify_RescuedBy to Pawn_RelationsTracker.Notify_RescuedBy (assembly: Hospitality) ---> System.Exception: method was already detoured to Psychology.Detour._Pawn_RelationsTracker._Notify_RescuedBy.
  at HugsLib.Source.Detour.DetourProvider.CompatibleDetourWithExceptions (System.Reflection.MethodInfo source, System.Reflection.MethodInfo destination) [0x00000] in <filename unknown>:0
  at HugsLib.Source.Detour.Helpers.DetourMethodByAttribute (System.Reflection.MemberInfo info, System.Attribute attrib) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at HugsLib.Source.Detour.DetourProvider.ThrowClearerDetourException (System.Exception e, System.Reflection.MemberInfo sourceInfo, System.Reflection.MemberInfo targetInfo, System.String detourMode) [0x00000] in <filename unknown>:0
  at HugsLib.Source.Detour.Helpers.DetourMethodByAttribute (System.Reflection.MemberInfo info, System.Attribute attrib) [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
HugsLib.Utils.ModLogger:ReportException(Exception, String, Boolean, String)
HugsLib.Source.Detour.Helpers:DetourMethodByAttribute(MemberInfo, Attribute)
HugsLib.Source.Attrib.AttributeDetector:CallHandlersForAttributes(List`1, Dictionary`2)
HugsLib.Source.Attrib.AttributeDetector:ProcessNewTypes()
HugsLib.HugsLibController:ProcessAttibutes()
HugsLib.HugsLibController:LoadReloadInitialize()
HugsLib.HugsLibController:Initalize()
HugsLib.Core.UnityProxyComponent:Start()

cladicus

I can't seem to make enough friends when I try to charm / recruit people.

I only ever make it to 2.

I tried assigning everyone to negotiating but it doesn't seem to change anything.
Secondly, I tried making my colonists "hang out" in the guest room. They wouldn't stay, even when it was the sole source of joy, so I drafted them all and made them stay in the guest room.

Not much "hanging out", in the end they just left the room to eat and sleep with no change on visitor friendship.

I've searched all night, can you please dumb down, like I'm 5 years old, how to become friends with visitors, mainly reaching the goal of friends to the visitor.

Thank you.

System.Linq

Quote from: Dr_Zhivago on April 05, 2017, 11:56:08 AM
New update causes an error log with "Psychology"

[HugsLib] Exception during DetourMethodByAttribute: System.Exception: Failed to detour method Pawn_RelationsTracker.Notify_RescuedBy to Pawn_RelationsTracker.Notify_RescuedBy (assembly: Hospitality) ---> System.Exception: method was already detoured to Psychology.Detour._Pawn_RelationsTracker._Notify_RescuedBy.
  at HugsLib.Source.Detour.DetourProvider.CompatibleDetourWithExceptions (System.Reflection.MethodInfo source, System.Reflection.MethodInfo destination) [0x00000] in <filename unknown>:0
  at HugsLib.Source.Detour.Helpers.DetourMethodByAttribute (System.Reflection.MemberInfo info, System.Attribute attrib) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at HugsLib.Source.Detour.DetourProvider.ThrowClearerDetourException (System.Exception e, System.Reflection.MemberInfo sourceInfo, System.Reflection.MemberInfo targetInfo, System.String detourMode) [0x00000] in <filename unknown>:0
  at HugsLib.Source.Detour.Helpers.DetourMethodByAttribute (System.Reflection.MemberInfo info, System.Attribute attrib) [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
HugsLib.Utils.ModLogger:ReportException(Exception, String, Boolean, String)
HugsLib.Source.Detour.Helpers:DetourMethodByAttribute(MemberInfo, Attribute)
HugsLib.Source.Attrib.AttributeDetector:CallHandlersForAttributes(List`1, Dictionary`2)
HugsLib.Source.Attrib.AttributeDetector:ProcessNewTypes()
HugsLib.HugsLibController:ProcessAttibutes()
HugsLib.HugsLibController:LoadReloadInitialize()
HugsLib.HugsLibController:Initalize()
HugsLib.Core.UnityProxyComponent:Start()

This error always existed, and is only noticeable now that Hospitality is using HugsLib.

Orion: What exactly does Hospitality do in Notify_RescuedBy? It would likely be easiest for you to implement the limited functionality Psychology places there (it's very easy and simple to do this) and then tell people to load Hospitality before Psychology.

Orion

#1509
@Linq: This is what it's adding:
                var compGuest = pawn.GetComp<CompGuest>();
                if (compGuest != null)
                {
                    compGuest.OnRescued();
                }

Essentially it starts tracking the person and marking them as rescued.

What does Psychology do there?


@cladicus: How many colonists do you already have? It gets progressively harder with the amount of colonists you have. Since most storytellers think that 13 colonists is optimal, around that amount it becomes quite tricky to recruit more. It definitely helps to have some people around with "instant rapport" traits, like pretty or beautiful. Also highly skilled negotiators are handy, since they will promote your other colonists. Don't let beginners do this, they will just annoy the guests and ruin the chance for the better ones.

System.Linq

Psychology simply adds this:


                rescuer.needs.mood.thoughts.memories.TryGainMemoryThought(ThoughtDefOfPsychology.RescuedBleedingHeart, t.GetPawn());


For which you can do this:


                ThoughtDef kp = DefDatabase<ThoughtDef>.GetNamedSilentFail("RescuedBleedingHeart");
                if(kp != null)
                {
                        rescuer.needs.mood.thoughts.memories.TryGainMemoryThought(kp, t.GetPawn());
                }

Orion

I've uploaded a new version that does this. However Psychology should use a detour fallback handler to not throw an error when Hospitality is loaded first.

bob112

#1512
Quote from: bob112 on April 05, 2017, 07:38:05 AM
does anyone know what counter (300) = 300 means in the debug log? because for some reason when the hospitality mod is installed it stops visitors from arriving both naturally and when I try to spawn them in via dev mode it doesn't stop caravans or travellers/wanderers just visitors I don't know what caused it to happen or how to stop it but I'd like to know because it pretty much makes the hospitality mod useless and I quite like the hospitality mod can anyone help?

Can anyone please help me with this?

EDIT: After a little more testing it seems as though counter (300) = 300 is not what was stopping visitors from spawning naturally or via dev mode but for some reason visitors are not spawning and i don't know why admittedly i'm no expert in reading the debug log but i can't see anything that gives any clues as to why visitors won't spawn I've tried going debug actions menu -> Execute incident with... -> visitor group and tried every point size but there nothing appears in the debug log in response at all there's no white text or yellow text or red text nothing appears to give me any sort of clue!

Dr_Zhivago

Appreciation for resolving the conflicts with Psychology. Even if it wasn't a real issue, it's nice to not have the red error logs. Cheers!

Orion

@bob112: Look, there's a real easy solution here. Just upload your debug log somewhere and I'll take a look at it.
@Dr_Zhivago: No problem! It's not every day I get the solution spoon fed. Usually I have to dig it up myself, and I'm not always inclined to do that.