Love/Hate + DS setup

Announcements, support questions, and discussion for Love/Hate.
Post Reply
cptscrimshaw
Posts: 105
Joined: Sun Sep 20, 2020 8:21 pm

Love/Hate + DS setup

Post by cptscrimshaw »

I've been meaning to implement your Love/Hate system in my game for a while and am now getting around to it. I'm super excited about all the functionality it offers and plan on using it heavily!

Working through the initial setup, I think I must be missing something, because I'm having trouble getting a simple ReportDeed(). I have some basics set up, such as GetAffinity() which works in Dialogue conversations, but with ReportDeed() to work, I'm getting a console warning: "ReportDeed(AcceptQuest) target is null."

I've provided several screenshots of my setup, so hopefully you can tell me what I'm missing.

Things I've done:
- Added Faction Database.
- Added Faction Manager and Persistent Faction Manager and linked up Faction Database (checked Debug).
- Added Deed Template Library.
- Added Faction info and set a relationship from Hans to the Player with an Affinity of 10(This is just for an earlier GetAffinity() check in the conversation which is working fine.)
- Added LoveHateLua.cs to Dialogue Manager GameObject.
- Added Faction Member and Deed Reporter to Player.
- Added Faction Member, Faction Member Debugger, and Persistent Faction Member to Hans.

https://ibb.co/920YRPv
https://ibb.co/6Dp22cs
https://ibb.co/VNNg1Xv
https://ibb.co/LdysJKN
User avatar
Tony Li
Posts: 20731
Joined: Thu Jul 18, 2013 1:27 pm

Re: Love/Hate + DS setup

Post by Tony Li »

Hi,

That message means it's not finding "Hans" for some reason.

When it looks for Hans, it will try in this order:

1. Is there a GameObject with a DialogueActor component whose Actor value is set to Hans? If so, use the FactionMember on this GameObject, or return null if it doesn't have a FactionMember.

2. Otherwise, is there a GameObject named Hans? If so, use the FactionMember on this GameObject, or return null if it doesn't have a FactionMember.

3. Otherwise, look for a GameObject whose FactionMember component is set to the Hans faction.


Is it possible that the Hans GameObject is inactive at the time ReportDeed() is called?

Or perhaps another GameObject is named Hans or has a DialogueActor component set to Hans?
cptscrimshaw
Posts: 105
Joined: Sun Sep 20, 2020 8:21 pm

Re: Love/Hate + DS setup

Post by cptscrimshaw »

Hi Tony,

Apologies for necroing my own thread. I've run into a little, related issue that I know has a simple fix - just can't figure it out.

I haven't been messing around with any of my setup for DS, QM, or LH as I had everything working (thanks to your help!), but I have managed to screw something up. For some reason DS doesn't like me using LH Lua functions anymore (see screenshot). I have LoveHateLua.cs on the Dialogue Manager game object, so I'm not sure what else I might be missing. Happy to provide any more details, but not exactly sure what to provide.

I'm calling GetAffinity("Hans", "Sairyn") > 0 from a dialogue Condition, and I have everything set up in the faction manager, but I don't think it's even getting that far...

https://ibb.co/8gxLdBk
User avatar
Tony Li
Posts: 20731
Joined: Thu Jul 18, 2013 1:27 pm

Re: Love/Hate + DS setup

Post by Tony Li »

Hi,

If you temporarily set the Dialogue Manager's Other Settings > Debug Level to Info and play, do you see lines such as:

Code: Select all

Dialogue System: Registering Lua function GetAffinity
Is it possible that you're starting from a scene that has a Dialogue Manager that doesn't have a LoveHateLua component? If so, this Dialogue Manager will survive scene changes and replace the one in a later scene that does have a LoveHateLua component.
cptscrimshaw
Posts: 105
Joined: Sun Sep 20, 2020 8:21 pm

Re: Love/Hate + DS setup

Post by cptscrimshaw »

I tried setting the Debug to info already and didn't see it register GetAffinity. It's registering plenty of other things (e.g., QM stuff). Not sure if seeing the list will be helpful, but here it is:

https://ibb.co/3d0xLxD
https://ibb.co/kKqs9K2
https://ibb.co/FYdGVcX
https://ibb.co/PT3bBYC

Doublechecked the scene thing, but it's all in order (using a prefab for the Dialogue Manager, so it should always have LoveHateLua on it - also checked in DontDestroyOnLoad during play, and it's there).

Anything else to look for?
User avatar
Tony Li
Posts: 20731
Joined: Thu Jul 18, 2013 1:27 pm

Re: Love/Hate + DS setup

Post by Tony Li »

Unlike many of the other ***Lua components that register C# methods with Lua in the Awake() method, LoveHateLua registers in the Start() method. That's the only difference I can think of.

After entering play mode, please inspect the Dialogue Manager. Does it still have its LoveHateLua component?
cptscrimshaw
Posts: 105
Joined: Sun Sep 20, 2020 8:21 pm

Re: Love/Hate + DS setup

Post by cptscrimshaw »

That led me to a "fix" - though I'm not sure why I need to do this for it to work?

Code: Select all

		
void Awake()
{
	SaveSystem.saveDataApplied += OnSaveDataApplied;
}

void OnSaveDataApplied()
{
	RegisterLuaFunctions();
}
(and yes, the DS gameobject still had the LoveHateLua component in playmode)
User avatar
Tony Li
Posts: 20731
Joined: Thu Jul 18, 2013 1:27 pm

Re: Love/Hate + DS setup

Post by Tony Li »

Strange. That would only work when loading a saved game.

Does the Dialogue System + Love/Hate integration's example scene work correctly?
cptscrimshaw
Posts: 105
Joined: Sun Sep 20, 2020 8:21 pm

Re: Love/Hate + DS setup

Post by cptscrimshaw »

Yeah, the demo works fine, so I assume it must be something with my build. Still, I have plenty of things that run on Start/Awake that seem to work fine. I am loading/saving the game automatically on play/quit/scene change. It's not a huge issue since it works with the fix, just trying to wrap my head around why :)

Thanks as always for your help!
User avatar
Tony Li
Posts: 20731
Joined: Thu Jul 18, 2013 1:27 pm

Re: Love/Hate + DS setup

Post by Tony Li »

Hi,

If you'd like to get to the bottom of it, please feel free to send me a reproduction project.
Post Reply