Linux #127: "The Crow" NPC opens conversation when not logical [RESOLVED]

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

Linux #127: "The Crow" NPC opens conversation when not logical [RESOLVED]

Post by Jay_H »

This is inside a custom quest I'm writing. I'm putting it in bugs instead of quest support since these quest actions are well settled in DFU development, but it can be moved.

Code: Select all

Person _crow_ faction The_Crow

_begin_ task:
    clicked npc _crow_
    give pc _reward_
    prompt 1011 yes _join_ no _refuse_
    stop timer _initial_
Expected behavior:
When The Crow is clicked, quest actions should proceed immediately.

Current behavior:
The Crow opens a normal dialogue window. Once it closes, he moves on to the quest actions.

Full quest text
Attachments
SAVE6.zip
Saved at time of conversation
(90.83 KiB) Downloaded 88 times
Last edited by Jay_H on Fri Sep 07, 2018 7:37 pm, edited 1 time in total.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Linux #127: "The Crow" NPC opens conversation when not logical

Post by Hazelnut »

That shouldn't happen, definitely a bug I think. Will see if I can take a look tonight.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Linux #127: "The Crow" NPC opens conversation when not logical

Post by Hazelnut »

I think that this is occuring due to a mis-match between your definition for the crow person and the faction id you're using. The faction id is of type individual, and this doesn't match when the quest behaviour code is running because the person definition doesn't define a named individual.

Try changing it to:

Person _crow_ named The_Crow faction The_Crow

You may also want to add gender too as DFU thinks the npc is female (when i tested) but you seem to have a male sprite:

Person _crow_ named The_Crow faction The_Crow male

Lastly, I could be wrong - Interkarma may come to a different conclusion since he knows the quest code much better than I do.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: Linux #127: "The Crow" NPC opens conversation when not logical [RESOLVED]

Post by Jay_H »

Yes, that's fixed it. Thank you for taking the time, and for the reminder to set him to Male each time :lol: I'll remember this when it comes up in the future.

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

Re: Linux #127: "The Crow" NPC opens conversation when not logical [RESOLVED]

Post by Interkarma »

Jay_H wrote: Fri Sep 07, 2018 3:56 am This is inside a custom quest I'm writing. I'm putting it in bugs instead of quest support since these quest actions are well settled in DFU development, but it can be moved.

Code: Select all

Person _crow_ faction The_Crow

_begin_ task:
    clicked npc _crow_
    give pc _reward_
    prompt 1011 yes _join_ no _refuse_
    stop timer _initial_
Expected behavior:
When The Crow is clicked, quest actions should proceed immediately.

Current behavior:
The Crow opens a normal dialogue window. Once it closes, he moves on to the quest actions.

Full quest text
Looking at this quickly, it's likely your issue is the use of "give pc _reward_". This variant of the action will always open a dialogue window with QuestComplete message. It's used for finishing up a quest with quest giver in guilds and marking quest succeeded. Here's how I describe the behaviours of different GivePc variants.

Code: Select all

    /// <summary>
    /// Give a quest Item to player. This has three formats:
    ///  * "give pc anItem" - Displays QuestComplete success message and opens loot window with reward. Could probably be called "give quest reward anItem".
    ///  * "give pc nothing" - Also displays QuestComplete success message but does not open loot window as no reward.
    ///  * "give pc anItem notify nnnn" - Places item directly into player's inventory and says message ID nnnn.
    /// </summary>
If you don't want to open that dialog window, you can use the "silently" tag. But this won't fire indoors.

Code: Select all

    give pc _reward_ silently
Probably best to use "get item" instead, but this doesn't mark quest as succeeded for rumours and the like.

Code: Select all

    get item _reward_
If you need the success flag, then structure "give item" to happen at a different point in quest flow. It's meant to be used at the very end of a quest.

For defining your quest NPC, the following should be adequate:

Code: Select all

Person _crow_ named The_Crow male

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

Re: Linux #127: "The Crow" NPC opens conversation when not logical [RESOLVED]

Post by Jay_H »

I'll give it a try. The solution Hazelnut suggested is working well, but if code regressions make it not work well, I'll take a look around and see what'll be more universally compatible :)

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

Re: Linux #127: "The Crow" NPC opens conversation when not logical [RESOLVED]

Post by Interkarma »

I'm not sure why Hazelnut's suggestion would have helped (sorry Hazelnut :)) as named NPCs and faction NPCs are mutually exclusive. You can't use those two together. More than likely, something is just breaking.

But what I'm saying above is the cause. The action "give pc _item_" will always open a message box with QuestComplete. Rather than "not logical", that's exactly what the action does. :) It's only meant to be used at the very end of a quest.

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

Re: Linux #127: "The Crow" NPC opens conversation when not logical [RESOLVED]

Post by Jay_H »

I tried just "named The_Crow" and it's working well. Maybe this'll cause problems down the road, but I can fix it down the road :lol: I agree "get item" would be a catch-all solution but I like the thematic element of the gold delivery for now. If it's irretrievable, I'll be happy to alter it.

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

Re: Linux #127: "The Crow" NPC opens conversation when not logical [RESOLVED]

Post by Interkarma »

Yeah, there really needs to be another variant just for this. I couldn't change that behaviour or it will beak the emulation of classic quests.

I'll see what I can add a bit later. :)

Locked