Linux #148: "remote" quest location is local [RESOLVED 0.11.5]

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

Linux #148: "remote" quest location is local [RESOLVED 0.11.5]

Post by Jay_H »

I've been testing a custom quest, and in one instance it chose a shop in the local city instead of a remote one. Many other instances worked fine.

Code: Select all

Place _shop_ remote weaponstore
Full quest text:
Spoiler!
Quest: JHFG018
DisplayName: Rights of Commerce
-- Message panels
QRC:

QuestorOffer: [1000]
<ce> A shop in another town keeps getting robbed
<ce> by the Thieves Guild and they need a guard.
<ce> Wanna take this up?

RefuseQuest: [1001]
<ce> A bit too boring for you?

AcceptQuest: [1002]
<ce> The place is called _shop_.
<ce> It's in ___shop_. The job's nighttime guard duty.
<ce> Hopefully you won't have to wait too long for them
<ce> to show up. Your payment's going to be =reward_ gold
<ce> pieces, and I'll have them if you're back in
<ce> =timer_ days. Good luck, %pcf.

QuestFail: [1003]
<ce> The Fighters Guild wanted you back from protecting
<ce> _shop_ by now.

QuestComplete: [1004]
<ce> Welcome back! Easy stuff? Well, I'm glad you
<ce> made it. Take your money. Good job.
<--->
<ce> Three fewer thieves ____qgiver_ has to
<ce> worry about. Nice work. Here's your pay.

Message: 1010
<ce> There's no more movement in the store.
<ce> Looks like this job is finished.

Message: 1011
<ce> Hey, hold on! This one knows how to fight, here!
<ce>
<ce> Let's be smart about this. Help us out, 'cause you don't
<ce> wanna get on the wrong side of the Thieves Guild.
<ce> How's about you go wait outside and make sure nobody
<ce> shows up? We'll pay you =bribe_ gold.
<ce> Everyone leaves alive, and we put in a good word
<ce> with the guild for you. Sound good?

Message: 1012
<ce> That's smart of ya. Okay, head on out and we'll get
<ce> started. You made the right choice, %ra.

Message: 1013
<ce> One of the thieves whispers to you.
<ce>
<ce> "Nobody come by? Nice work. The guild's gonna hear
<ce> about this. They're always lookin' for smart
<ce> people. Take this gold."
<ce>
<ce> The troupe leaves, carrying several valuable
<ce> pieces of equipment.

Message: 1014
<ce> You're surprised by a member of the town guard.
<ce> The fellow appears to have thrown on his equipment
<ce> at this hour of the night.
<ce>
<ce> "Excuse me! I heard some noise around here and
<ce> thought I'd see if there was a problem. Is there
<ce> something happening inside _shop_?"

Message: 1015
<ce> The guard's eyes widen at the news. He shouts loudly
<ce> and rouses a few others to surround the building.
<ce> In a matter of moments they burst through the entrance
<ce> and haul the thieves out one by one, their mouths
<ce> and hands bound. One of the criminals gives
<ce> you a dirty look while being hauled away. The city watch
<ce> thanks you for your help, leading their captives off.
<ce>
<ce> This may not have been exactly what _qgiver_
<ce> assigned you to do, but if the shoe fits...

Message: 1016
<ce> "Really? That's odd. Well, thank you for helping,
<ce> but you should really be in a tavern this time of
<ce> night. It can get dangerous out here."
<ce>
<ce> The guard waves and heads for the warmth of home.

Message: 1017
<ce> Upon seeing one of their number dead, the other thieves
<ce> change their mind. This will only end one way.

Message: 1018
<ce> You set yourself outside the store and watch for
<ce> any risk to the thieves' work.

Message: 1030
%qdt:
The Fighters Guild of ___qgiver_
is paying me to go to ___shop_
and protect _shop_ from
night burglars. I have to fend them
off and return in =timer_ days.

QBN:
Foe _q1_ is Thief
Foe _q2_ is Nightblade

Item _reward_ gold
Item _bribe_ gold

Person _qgiver_ group Questor male
Person _dummytg_ faction The_Thieves_Guild

Place _shop_ remote weaponstore

Clock _timer_ 00:00 0 flag 1 range 0 2
Clock _rob1_ 00:03
Clock _rob2_ 00:03

-- Quest start-up:
start timer _timer_
log 1030 step 0
pc at _shop_ do _inside_

_day_ task:
daily from 4:30 to 23:30

_inside_ task:
stop timer _rob1_
stop timer _rob2_

_spawn_ task:
when _inside_ and not _day_ and not _slain_
start task _spawn1_

_spawn1_ task:
create foe _q1_ every 0 minutes 2 times with 100% success
create foe _q2_ every 0 minutes 1 times with 100% success

_weap1_ task:
when skill LongBlade is at least 1
start task _skilled_

_weap2_ task:
when skill ShortBlade is at least 60
start task _skilled_

_weap3_ task:
when skill Axe is at least 60
start task _skilled_

_weap4_ task:
when skill HandToHand is at least 60
start task _skilled_

variable _skilled_
_inj_ task:
injured _q1_
injured _q2_

_prompt_ task:
when _inj_ and _skilled_ and not _s1_ and not _s2_
prompt 1011 yes _deal_ no _refuse_

variable _refuse_
_deal_ task:
say 1012
restrain foe _q1_
restrain foe _q2_

_ffa_ task:
when _deal_ and _sa_
start task _ffc_

_ffb_ task:
when _deal_ and _s2_
start task _ffc_

_ffc_ task:
say 1017

_job_ task:
when _deal_ and not _inside_ and not _ffc_
start timer _rob1_
say 1018
remove foe _q1_
remove foe _q2_

variable _rob1_
_job2_ task:
when _rob1_ and not _inside_ and not _ffc_
pick one of _e1_ _e2_
start timer _rob2_

variable _e1_
_e2_ task:
prompt 1014 yes _squeal_ no _hide_

_squeal_ task:
stop timer _rob2_
say 1015
start task _win_
change repute with _dummytg_ by -10

_hide_ task:
say 1016

variable _rob2_
_thiefwin_ task:
when _rob2_ and not _squeal_
say 1013
get item _bribe_
change repute with _dummytg_ by +5
end quest

_sa_ task:
killed 1 _q1_
change repute with _dummytg_ by -5

_s1_ task:
killed 2 _q1_

_s2_ task:
killed _q2_
change repute with _dummytg_ by -5

_slain_ task:
when _s1_ and _s2_
say 1010
start task _win_

variable _win_
_victory_ task:
when _qgclicked_ and _win_
give pc _reward_
end quest

_qgclicked_ task:
clicked npc _qgiver_

_clearclick_ task:
when _qgclicked_ and not _win_
clear _qgclicked_ _clearclick_

_timer_ task:
say 1003
end quest
Attachments
SAVE1.zip
(100.7 KiB) Downloaded 171 times

User avatar
pango
Posts: 3048
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Linux #148: "remote" quest location is local

Post by pango »

Seems it still happens; Just saw a stream by TalonHatesNames doing a predef thief character, and rank 0 "Fedex" quests end up being deliveries in local town.
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

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

Re: Linux #148: "remote" quest location is local

Post by Hazelnut »

Is this Linux specific do you know?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Tamalak
Posts: 14
Joined: Sun Jan 31, 2021 8:00 pm

Re: Linux #148: "remote" quest location is local

Post by Tamalak »

I just created an account specifically to report this. Hilarious that it's the top topic.

I am using the windows version and MANY quests that clearly should be 'remote' are local.

1. This quest: https://en.uesp.net/wiki/Daggerfall:The_Courier has been local every single time I've gotten it.
2. One of the two Thieves Guild apprentice quests (smuggle this (Gear) to (Name) in (Town) and get (Name)'s loot back to us) should clearly be remote, but it is always local.
3. A royal "this guy left without his (equipment), go get it to him" quest is always local when it should be remote.

User avatar
Ferital
Posts: 279
Joined: Thu Apr 05, 2018 8:01 am

Re: Linux #148: "remote" quest location is local

Post by Ferital »

I did some reverse engineering around these cases and I can confirm that one of the byte of the NPC quest section of a QBN file does indicate if the NPC should be local (0) or remote (1). This field is the third one and is wrongly considered as the NPC gender since the early hacking days of the QBN file format in the 90s:
https://en.uesp.net/wiki/Daggerfall_Mod ... Cs_Section

As an example, a quest like A0C00Y17.QBN, which says:

Code: Select all

Person _questgiver_ group Questor male
Person _mage_ faction The_Mages_Guild female
Person _thief_ faction The_Thieves_Guild female
Person _darkb_ faction The_Dark_Brotherhood female
should actually says:

Code: Select all

Person _questgiver_ group Questor local
Person _mage_ faction The_Mages_Guild remote
Person _thief_ faction The_Thieves_Guild remote
Person _darkb_ faction The_Dark_Brotherhood remote

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

Re: Linux #148: "remote" quest location is local

Post by Interkarma »

Thank you Ferital. This is a great insight for correct placement of NPCs. Though I would still keep the gender specifier in DFU, we can add this expression to Person for handling in future. It's much less ambiguous than using groups for this purpose. Once this is added, we can start tidying up any quests where Person resource is misallocated.

I'll still need to look closer at this bug report though, as the issue reported in first post is for selection of a building resource using Place rather than an NPC resource using Person.

User avatar
Ferital
Posts: 279
Joined: Thu Apr 05, 2018 8:01 am

Re: Linux #148: "remote" quest location is local

Post by Ferital »

Indeed, the first post issue from Jay_H seems unrelated to this find. And I agree with you that it is still better to keep the gender specifier in DFU internal mechanics, especially since it can be already in use in custom quests.

For classic quests, it seems that TEMPLATE does not always decompile the place scope byte to gender, sometimes it does nothing at all, as with A0C00Y14 and A0C00Y15 (I confirmed it). This explains why there is no gender for persons in these two, even if the flags are set in the QBN files. So I'm making a small routine to extract this information for all classic quests, so we can add it to DFU quests later.

User avatar
Ferital
Posts: 279
Joined: Thu Apr 05, 2018 8:01 am

Re: Linux #148: "remote" quest location is local

Post by Ferital »

More information about quest NPC types which were not understood yet:

Local_3: questor's ally, whose faction is taken at random from the list of questor's allies.
Local_4: questor's enemy, whose faction is taken at random from the list of questor's enemies.
Group_5: NPC who is in the same faction as the questor.
Group_6: NPC who is in relation with the questor.
Group_7: questor lover.

Classic does some processing on these NPCs to assign them the correct faction and gender, I will try to replicate this in DFU, this should not be too difficult. Now, should we rename all the above groups in DFU, or leave them as they are?

User avatar
pango
Posts: 3048
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Linux #148: "remote" quest location is local

Post by pango »

Amazing... And amazing reverse-engineering here Ferital, kudos!

In my opinion we should use symbolic constants when we can in the quest texts, to increase their readability. (same thing for dungeon types, etc. by the way)
For "writability", constants should be documented, and the quest mode for VS Code should autocomplete those...
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

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

Re: Linux #148: "remote" quest location is local

Post by Interkarma »


Locked