implementation of talk window

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: implementation of talk window

Post by Nystul »

For example N0C00Y10 and A0C00Y12
Both have a thief person that is spawned (after pc learned about him/her) depending on time of day in different buildings, vanilla only shows person as talk option in tell me about, not in where is section, I want to reproduce this

What would be enough is an additional flag for person resources that indicates if a place foe has happened for this resource. I think I can do it just have to step through code and find foe placement

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: implementation of talk window

Post by Interkarma »

Looking at quest N0C00Y10, the placement behaviour of thiefFoe is just done by time of day.

First the Foe resource is declared:

Code: Select all

Foe thiefFoe is Thief
And then thiefFoe is placed to a SiteLink depending on tasks S.02-S.04. Each time window will allocate the Foe to a different Place resource. This placement is running from the moment quest begins, as "daily from" is a trigger action that will turn it's action on/off depending on the time of day.

Code: Select all

_S.02_ task:
	daily from 00:00 to 08:00 
	place foe thiefFoe at _house_ 

_S.03_ task:
	daily from 16:02 to 24:00 
	place foe thiefFoe at _inn_ 

_S.04_ task:
	daily from 08:01 to 16:01 
	place foe thiefFoe at _store_ 
Nystul wrote: Wed May 16, 2018 7:19 am For example N0C00Y10 and A0C00Y12
Both have a thief person that is spawned (after pc learned about him/her) depending on time of day in different buildings
Not quite. A Person resource is placed using "place npc". The "Person _thief_" resource is never placed anywhere (ever) in this quest. The Person is just used for story delivery. Only the thief Foe is ever placed anywhere in this quest.
Nystul wrote: Wed May 16, 2018 7:19 am vanilla only shows person as talk option in tell me about, not in where is section, I want to reproduce this
This would make sense, as you can only have talk options about a Person, not a Foe. I'm a bit confused about the problem and might need some more help understanding. :)

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: implementation of talk window

Post by Interkarma »

To put it another way, The Person and the Foe are two completely different Resources and have nothing to do with each other except to give the illusion of a story.

The Foe spawning would happen no matter what else was going on inside the quest. They literally have nothing to do with each other. And there are zero dialog links for thiefFoe (the Foe) in the quest, only for _thief_ (the Person) who never goes anywhere.

It's all smoke and mirrors. :)

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: implementation of talk window

Post by Nystul »

talking about our in dfunity implementation:
the problem is that a person resource for "thief" is generated which leads to an entry in the "where is" section as soon as pc learned about existence of that person. Answer even resolves correctly to the building the foe is currently in (which is cool that this works but unwanted since it does not match vanilla and there would be no way that npc know the location given that the foe changes locations so often).
So the task is "how to hide it?":
I first tried the person resource "IsPlaced" flag but unfortunately this is true for both "thief" as well as "informant" - since informant is static npc placed with "place npc" it should show up in "where is" once it is placed - ", thief must not show up there - so this flag does not do the trick.
Also I did check all other fields in person resource if they differ for those 2 resources which could differentiate them. but no...
So I have to locate that foe resource and find out to link it to the person resource?

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: implementation of talk window

Post by Interkarma »

Nystul wrote: Wed May 16, 2018 8:08 am the problem is that a person resource for "thief" is generated which leads to an entry in the "where is" section as soon as pc learned about existence of that person. Answer even resolves correctly to the building the foe is currently in
This is not possible. The Person and Foe are two completely different resources. The Person is never placed anywhere. How are you determining the Person resource is placed anywhere?
Nystul wrote: Wed May 16, 2018 8:08 am So I have to locate that foe resource and link it to the person maybe?
Nope, you don't have to do anything. They aren't linked in any way. :)

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: implementation of talk window

Post by Interkarma »

Maybe we should take this to a chat interface? It might be a little easier for back and forth than the forums in this case.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: implementation of talk window

Post by Nystul »

sure ;)

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: implementation of talk window

Post by Nystul »

Interkarma wrote: Wed May 16, 2018 8:11 am How are you determining the Person resource is placed anywhere?
I thought boolean field "IsPlaced" in person resource is used for this - sry my misunderstanding then

update: thanks for this enlightening chat session - problem solved (in theory - see below ;))

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: implementation of talk window

Post by Interkarma »

For anyone following along, we seem to have sorted this out. It appears the "hide npc" quest action should also suppress any talk options about that npc. Nystul was the one who figured this out after a few minutes of back and forth.

Edit: It was my pleasure Nystul! :)

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: implementation of talk window

Post by Nystul »

trying to implement this.
it seems that hideNpc action is not performed correctly - the hideNpc Update() function is never reached because in Task.Update() when the corresponding task gets executed both if statements fail:

Code: Select all

if (action.IsTriggerCondition && !IsTriggered || action.IsAlwaysOnTriggerCondition)
and

Code: Select all

if (IsTriggered && !action.IsTriggerCondition)
because values are:

action.IsTriggerCondition == false
IsTriggered == false
action.IsAlwaysOnTriggerCondition == false

Post Reply