implementation of talk window

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

Re: implementation of talk window

Post by Nystul »

does this quest work correctly in vanilla df?

will have to work on this quest when I get the time. There seem to be several problems with this one, starting with _friend1_ and _friend2_ not showing up in "where is"->"person" section. Those 2 should not be hidden since there is no dialog link for them...

update:
ok seems that dfunity does not "place" those npcs currently, so they end up having no place (being null) when TalkManager does in line 2904:

Code: Select all

Symbol assignedPlaceSymbol = person.GetAssignedPlaceSymbol();
that's why they don't show up in the where is -> person list

quest does:

Code: Select all

	create npc _friend4_ 
	create npc _friend2_ 
	create npc _friend3_ 
	create npc _friend1_ 
but this is not placing them...

so this might require some helping hand from Interkarma ;)

but this will not be the only problem with this quest I think. I will definitely have to spend some time to make it work ;)

User avatar
Jay_H
Posts: 4062
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: implementation of talk window

Post by Jay_H »

I'll have to try it in classic at some time. I won't have time for now, but I'll see about it later.

Usually what happens with those is that they get put into a default location (chemist in Apothecary, local in Residence, and so on), but if it's all in a local location like here, it's difficult for DFU to put them all in acceptable places. So quests like this can be problematic and sometimes they spawn in other cities.

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

Re: implementation of talk window

Post by Nystul »

I tried in classic - it is exactly as I expected: friend1 and friend2 are available in where is -> person section.
when talking with them friend3 and friend4 also become available there when they are mentioned in their respective answers.

Note: there are no entries in the tell me about section - since there are no anyinfo or rumors messages assigned to person resources

I was not able to solve the quest in classic... all 4 npcs did not know about the missing person. Will have to spend some more time in a week when I have more time

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

Re: implementation of talk window

Post by Interkarma »

You guys are awesome, I think you just clarified a question I've had since I started work on the quest system.

I never really understood the subtle difference between "create npc" and "place npc". I now see that "create npc" should assign the site link, but resource won't be visible until "place npc" is called.

This will involve a little restructuring, so give me few days to work back down to this.

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

Re: implementation of talk window

Post by Nystul »

What's strange with this specific quest is that create npc is called but place npc is never called. Nevertheless npc can be found in the building and can be asked about under where is -> person in vanilla df when doing this quest

User avatar
Jay_H
Posts: 4062
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: implementation of talk window

Post by Jay_H »

"Create npc" actually doesn't exist in DFU, the player log says. That's what tipped me off about the difference. The moment these NPCs are brought into existence in the quest file, they exist somewhere.

"Place npc" is almost never used in classic, I'm seeing now. At least in the commoner quests.

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

Re: implementation of talk window

Post by Interkarma »

Yeah, "create npc at" exists in DFU (which just reserves the link for later placement) - but "create npc" does not currently exist.

I have unintentionally marked "create npc" as complete on the action roadmap, which is likely why I've never gotten back to it. This should function a lot like "place npc" except will use an automatic location. It might even be selecting a pre-existing NPC in that building - not sure.

I have updated roadmap to reflect current status as not started, and will loop back to this one soon. :)

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

Re: implementation of talk window

Post by Interkarma »

Tipton says of "create npc":
installs the _contact_ npc at a place in the current province, probably not local to the PC, and hopefully in a venue appropriate to the npc's group or faction.
To me this reads like the NPC can be installed anywhere in the region. As virtual NPCs created by the Person resource are granted a birthplace, it would seem that my job is basically place that NPC into a building in that location.

Update: I also believe that when a local group is used, e.g. "Person _friend1_ group Local_3.1 male" then a local building should be selected. Can anybody confirm this appears to be the behaviour in classic?

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

Re: implementation of talk window

Post by Interkarma »

OK, first step here is to completely rework how the NPC's "home" is generated. I was previously generating this just for flavour text, but for "create npc" to function they will need to be assigned a proper Place resource automatically. Currently this is only being done for specific faction types.

Working through the problems now to give each Person a proper "home" and match it to their fixed location if they are a fixed NPC.

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

Re: implementation of talk window

Post by Interkarma »

Update

Have completed first pass at ensuring all Person resources are assigned a complete "home" Place resource. This will be backwards compatible with older code, but any quests currently running might return "BLANK" for home region/town/building strings, as this is generated when the quest is compiled.

This should provide me with the back-end required to properly build the "create npc" action and automatically assign these npcs to a suitable building.

I'm going to post new builds with all the changes I've made so far over the weekend as "Experimental" so you guys can try this. I'll post an article in News when I'm done.

Post Reply