Custom quest support

For all talk about quests. Creating, testing, bugs, and development progress.
User avatar
Jay_H
Posts: 2484
Joined: Tue Aug 25, 2015 1:54 am

Re: Custom quest support

Post by Jay_H » Sat Mar 30, 2019 6:35 am

I'm using a method to hook one quest from a questgiver into another that's totally unrelated. Since this would double the reputation gain, I want to change the chained quests to the non-existent faction "na," like the Perpetual Quests use.

Code: Select all

JHFG020, FightersGuild, M, 1, 0, entry into JHMFB??
JHFGB00, na, P, 0, 0,
JHFGB01, na, P, 0, 0,
JHFGB02, na, P, 0, 0,
JHFGB03, na, P, 0, 0,
However, none of the quests on faction "na" respond to the quest action "start quest." They work fine if they have the Fighters Guild faction like JHFG020 does, but if I change them to na like seen above, they refuse to start. The player log doesn't register anything at all about it. Also, the "na" faction works fine for Perpetual Quests but not here.

For now I'll be using a workaround to prevent huge reputation gains, but this is a bit of a curious problem.
Come join the Unofficial Daggerfall Unity Discord.
Try the first Daggerfall Unity Quest Pack with many all-new quests.
Progress on fixing classic quests here.

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

Re: Custom quest support

Post by Jay_H » Thu Apr 25, 2019 8:39 pm

I forgot to report this as a bug, or at least a design problem: http://forums.dfworkshop.net/viewtopic. ... 130#p23587

I designed this quest using the exiting condition:

Code: Select all

_timer_ task:
    when pc exits anywhere
    say 1003
    end quest
This works fine if you do the quest all in one go, but if you load a saved game inside a building and then exit it, the game tends to consider it leaving a location. If I understood correctly, this condition should only correspond to exteriors like farmhomes and cities, but leaving a building upon game load triggers it.
Come join the Unofficial Daggerfall Unity Discord.
Try the first Daggerfall Unity Quest Pack with many all-new quests.
Progress on fixing classic quests here.

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

Re: Custom quest support

Post by Hazelnut » Sun May 12, 2019 3:09 pm

Jay_H wrote:
Sat Mar 30, 2019 6:35 am
I'm using a method to hook one quest from a questgiver into another that's totally unrelated. Since this would double the reputation gain, I want to change the chained quests to the non-existent faction "na," like the Perpetual Quests use.

Code: Select all

JHFG020, FightersGuild, M, 1, 0, entry into JHMFB??
JHFGB00, na, P, 0, 0,
JHFGB01, na, P, 0, 0,
JHFGB02, na, P, 0, 0,
JHFGB03, na, P, 0, 0,
However, none of the quests on faction "na" respond to the quest action "start quest." They work fine if they have the Fighters Guild faction like JHFG020 does, but if I change them to na like seen above, they refuse to start. The player log doesn't register anything at all about it. Also, the "na" faction works fine for Perpetual Quests but not here.

For now I'll be using a workaround to prevent huge reputation gains, but this is a bit of a curious problem.
Hmm, sorry I've been absent Jay. TBH I forget exactly how it all works, but I think if quests are started with the start quest action then theres no faction id to have rep increase allocated. If you don't want these quests availiable to be dispensed by the quest giver of FG, then they don't need entries in the lists. However, they need to be in same folder as a defined init quest since that defines the directory as a source of quest files. That worked nicely for your perpetual packs but i didn't consider what you're doing. So, is adding an init quest entry something that fits into this? Do you have one in the pack, or does the quest discovery system need a tweak?

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

Re: Custom quest support

Post by Jay_H » Mon May 13, 2019 5:03 pm

Hazelnut wrote:
Sun May 12, 2019 3:09 pm
Hmm, sorry I've been absent Jay. TBH I forget exactly how it all works, but I think if quests are started with the start quest action then theres no faction id to have rep increase allocated. If you don't want these quests availiable to be dispensed by the quest giver of FG, then they don't need entries in the lists. However, they need to be in same folder as a defined init quest since that defines the directory as a source of quest files. That worked nicely for your perpetual packs but i didn't consider what you're doing. So, is adding an init quest entry something that fits into this? Do you have one in the pack, or does the quest discovery system need a tweak?
No, I'm just glad you're back :) If things are as you describe then I'm very happy. In all cases when I'm chaining multiple quests together, I don't want a reputation to gain faction from the subsequent ones. I'll keep the faction IDs unchanged throughout each chain and I think it'll work fine.
Come join the Unofficial Daggerfall Unity Discord.
Try the first Daggerfall Unity Quest Pack with many all-new quests.
Progress on fixing classic quests here.

imsobadatnicknames
Posts: 9
Joined: Sun Jun 02, 2019 4:28 pm

Re: Jay_H's quest writing tutorial

Post by imsobadatnicknames » Tue Jun 04, 2019 12:59 am

Idk if this is the appropriate place to post this but anyway... I'm having a little trouble getting the "toting" condition to work. I coded a simple Thieves Guild quest where you have six hours to steal a shipment of a random drug from a local store that has been acting as a front for a freelance drug-smuggling operation. Here´s the code:

Code: Select all

Quest: QUEST2
DisplayName: Drug bust
-- Message panels
QRC:

QuestorOffer:  [1000]
<ce>	I found out a local store has been working
<ce>	as a front for a freelance drug-smuggling
<ce>	operation. We can't allow any common criminal 
<ce>	to get away with non guild-sanctioned drug
<ce>	smuggling. Do you have a couple hours to
<ce>	help us ruin their business?


RefuseQuest:  [1001]
<ce>	I'm sure someone else can do it, 
<ce>	but I'm very disappointed in you, %pcn, 
<ce>	I expected more entusiasm. 

AcceptQuest:  [1002]
<ce>	That's our %ra! Now listen here. _store_  
<ce>	just got a shipment of _drug_ today. 
<ce> 	Since their smuggling business is just starting out, 
<ce>	a missing shipment should be enough to drive them out of business.
<ce>	Get in, get the _drug_, get out, get back here. You have to be quick.
<ce>	They're in a hurry to get rid of it 
<ce>	before the local guard catches on so it'll probably 
<ce>	be a few hours before they sell it to someone. 
<ce>	Beware, there might be guards hiding at the store.


QuestFail:  [1003]
<ce>	

QuestComplete:  [1004]
<ce>	Good work! That should ruin their business. Here´s your pay.       


Message:  1030
%qdt:
 The Thieves Guild of
 ___questgiver_ has sent me to
steal a shipment of _drug_ from _store_
I should go there and get it before they
find someone to sell it to.

Message: 1020
<ce>     I have the package, I should head back.        

QBN:
Item _reward_ gem

Item _drug_ drug

Person _questgiver_ group Questor male

Foe _enemy_ is Assassin

Place _store_ local generalstore

Clock _timer_ 06:00 


--	Quest start-up:
	start timer _timer_
	log 1030 step 0
	place item _drug_ at _store_
	pc at _store_ set _inside_

_inside_ task:

_spawn_ task:
	when _inside_ and not _slain_
	create foe _enemy_ every 10 minutes 10 times with 100% success

_havedrug_ task:
	toting _drug_
	say 1020
	create foe _enemy_ every 3 minutes 10 times with 50% success

_qgclicked_ task:
    clicked npc _questgiver_
 
_pcgetsgold_ task:
	when _qgclicked_ and _havedrug_
	give pc _reward_ 
	end quest

_timer_ task:
    end quest
 
_clearclick_ task:
    when _qgclicked_ and not _havedrug_
    clear _qgclicked_ _clearclick_
As you can see, once you're at the store, Assassins will occassionally start spawning as you search for the drug. Once you get the drug, a task called _havedrug_ becomes active, a message will be displayed and Assassins will start spawning even outside the store. Completing the quest requires you to activate both the _qgclicked_ and _havedrug_ tasks. The problem is that the debugger shows that _havedrug_ doesn't become active once I have the drug in my inventory, thus rendering the quest unwinnable (and also preventing the message from showing and the Assasins from spawning outside the store).
I also tried getting rid of the _havedrug_ task and changing the _pcgetsgold_ conditions to

Code: Select all

_pcgetsgold_ task:
	toting _drug_ and _questgiver_ clicked 
	give pc _reward_
	end quest 
as seen on Part Five of this tutorial, but it doesn't work either, so I'm pretty certain the problem is the "toting" condition.
Last edited by imsobadatnicknames on Tue Jun 04, 2019 1:11 am, edited 2 times in total.

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

Re: Jay_H's quest writing tutorial

Post by Jay_H » Tue Jun 04, 2019 1:09 am

WOOHOO! Another quest writer! I am ecstatic!! :D

We have a custom quest support topic which is intended for cases like these, when we're writing a new non-classic quest. I'll move your post over there soon.

"toting" itself doesn't identify possession; it's only ever used for "toting ITEM and NPC clicked". What you need to do is a two-parter, with a condition earlier on and the action you hope to achieve later. Do this instead:

Code: Select all

--	Quest start-up:
	start timer _timer_
	log 1030 step 0
	place item _drug_ at _store_
	pc at _store_ set _inside_
	have _drug_ set _havedrug_

Code: Select all

_havedrug_ task:
	say 1020
	create foe _enemy_ every 3 minutes 10 times with 50% success
Come join the Unofficial Daggerfall Unity Discord.
Try the first Daggerfall Unity Quest Pack with many all-new quests.
Progress on fixing classic quests here.

imsobadatnicknames
Posts: 9
Joined: Sun Jun 02, 2019 4:28 pm

Re: Jay_H's quest writing tutorial

Post by imsobadatnicknames » Tue Jun 04, 2019 1:12 am

Jay_H wrote:
Tue Jun 04, 2019 1:09 am
WOOHOO! Another quest writer! I am ecstatic!! :D

We have a custom quest support topic which is intended for cases like these, when we're writing a new non-classic quest. I'll move your post over there soon.

"toting" itself doesn't identify possession; it's only ever used for "toting ITEM and NPC clicked". What you need to do is a two-parter, with a condition earlier on and the action you hope to achieve later. Do this instead:

Code: Select all

--	Quest start-up:
	start timer _timer_
	log 1030 step 0
	place item _drug_ at _store_
	pc at _store_ set _inside_
	have _drug_ set _havedrug_

Code: Select all

_havedrug_ task:
	say 1020
	create foe _enemy_ every 3 minutes 10 times with 50% success
Okay, that makes sense! Thank you so much for your help!

imsobadatnicknames
Posts: 9
Joined: Sun Jun 02, 2019 4:28 pm

Re: Custom quest support

Post by imsobadatnicknames » Tue Jun 04, 2019 11:37 pm

Hey, it's me again. This might be a stupid question, but I just started writing quests a couple days ago so I'm not familiar with a lot of the commands yet. What's the command to make the game take away a quest item from a player's inventory? I know how to add them but not how to take whem away. I wanna write a thieves guild quest where you have to steal a painting by swapping it with a fake, so the first painting should be gone from my inventory when I pick up the second one.

Also, how do I modify the player's regional reputation? I also want to make a quest where the guild questgiver tells you some of your previous criminal activity has been reported to the authorities and you have to forge some fake evidence and bribe a witness to clear your name, and I want the player's regional reputation to drop massively at the start of the quest and get back to normal once you've cleared your name.

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

Re: Custom quest support

Post by Jay_H » Tue Jun 04, 2019 11:53 pm

imsobadatnicknames wrote:
Tue Jun 04, 2019 11:37 pm
Hey, it's me again. This might be a stupid question
I'm happy to see someone writing quests. Don't worry about bothering :)
What's the command to make the game take away a quest item from a player's inventory? I know how to add them but not how to take whem away. I wanna write a thieves guild quest where you have to steal a painting by swapping it with a fake, so the first painting should be gone from my inventory when I pick up the second one.
The command "take _item_ from pc" will eliminate the object from the inventory.

If you want to follow the lead of A0C00Y00, you can use this one instead:

Code: Select all

_dropitem_ task:
	dropped _item_ at _place_
This makes the quest item droppable while within the place you've indicated. The question is which of the two methods you want to use.
Also, how do I modify the player's regional reputation? I also want to make a quest where the guild questgiver tells you some of your previous criminal activity has been reported to the authorities and you have to forge some fake evidence and bribe a witness to clear your name, and I want the player's regional reputation to drop massively at the start of the quest and get back to normal once you've cleared your name.
That's "legal repute ##". It works both signed and unsigned.
Come join the Unofficial Daggerfall Unity Discord.
Try the first Daggerfall Unity Quest Pack with many all-new quests.
Progress on fixing classic quests here.

imsobadatnicknames
Posts: 9
Joined: Sun Jun 02, 2019 4:28 pm

Re: Custom quest support

Post by imsobadatnicknames » Wed Jun 05, 2019 12:06 am

Jay_H wrote:
Tue Jun 04, 2019 11:53 pm
If you want to follow the lead of A0C00Y00, you can use this one instead:

Code: Select all

_dropitem_ task:
	dropped _item_ at _place_
This method is actually really helpful for both of the quests I described, since the second one should probably involve planting some forged incriminating evidence at someone else's house. Thank you so much!

Post Reply