Registering deeds without a player

Announcements, support questions, and discussion for Love/Hate.
Post Reply
joeykid6
Posts: 17
Joined: Thu Feb 07, 2019 1:57 pm

Registering deeds without a player

Post by joeykid6 »

Hi Tony,

I'm developing a sim where I'd like the NPCs to commit deeds toward each other based on the state of their PAD, personalities, and relationships. So, for example, if a particular NPC has a range of values in personality and PAD, and that NPC has a relationship with another NPC (or even if they don't), they might kill them or stalk them or give them a kiss, etc.

My question is if there's anything to be aware of when developing this kind of model. I ask mainly because the docs suggest that the main use case is for a player with a deed reporter (i.e. the player is committing deeds toward the NPCs who then react).

I'm assuming I can do something like assign deed reporters to all the NPCs and then trigger deeds based on my own script for reading their personality, PAD, and relationship values. Does this sound roughly correct?

Let me know what you think, thanks!

Best,
Joe
User avatar
Tony Li
Posts: 22085
Joined: Thu Jul 18, 2013 1:27 pm

Re: Registering deeds without a player

Post by Tony Li »

Hi Joe,

Yes, that's correct. You don't even need to add a Deed Reporter to each NPC if you don't want to. You can call FactionManager.CommitDeed() manually if you prefer. Deed Reporter is just a convenience that allows you to define deeds in a Deed Template Library asset and call a simpler ReportDeed() method instead of FactionManager.CommitDeed().

Love/Hate's Farmer Example (in Example / More Examples) has only NPCs. It uses Deed Reporters without any player.
joeykid6
Posts: 17
Joined: Thu Feb 07, 2019 1:57 pm

Re: Registering deeds without a player

Post by joeykid6 »

Great, thanks! I'll take a closer look at the farmer example.

Just to clarify, FactionManager.CommitDeed() would still need a deed template library though, right? Otherwise, how would the deeds be modeled?
User avatar
Tony Li
Posts: 22085
Joined: Thu Jul 18, 2013 1:27 pm

Re: Registering deeds without a player

Post by Tony Li »

No, FactionManager.CommitDeed() accepts raw deed info, so instead of calling DeedReporter.ReportDeed("tag", target), you'd pass all of the individual info that deeds in the Deed Template Library wrap up for you. For example: FactionManager.instance.CommitDeed(actor, new Deed(...), requiresSight, Dimension.Is3D, radius). Personally I find it much simpler to just use a Deed Reporter.
Post Reply