Custom quest support

For all talk about quest development - creation, testing, and quest system.
Post Reply
User avatar
Jay_H
Posts: 4062
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Custom quest support

Post by Jay_H »

Perfectly fine, this is sailing along right as I want it to :) This is exactly what I'd hope for to write quests. Thank you.

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

Re: Custom quest support

Post by Jay_H »

I'm writing a quest that asks the player to cast an Identify spell. It exists in Spells.std but for some reason the quest command isn't triggering:

Code: Select all

_conv_ task:
    clicked npc _client_
    say 1010
    cast Identify spell do _ident_

variable _ident_
_conv_ lights up but the spell doesn't light up _ident_. Is there some reason this spell effect wouldn't trigger it?

Full quest:
Spoiler!
Quest: JHMG017
DisplayName: The Novice Odylic
-- Message panels
QRC:

QuestorOffer: [1000]
<ce> %pct, have you any ability to
<ce> identify objects? Your spellcasting
<ce> ability would really help us out here.
<--->
<ce> We have someone in another city possessing
<ce> an object that needs identification.
<ce> Are you able and willing to cast the spell?

RefuseQuest: [1001]
<ce> Well, it's certainly not urgent.

AcceptQuest: [1002]
<ce> Delightful, %pcf. Poor _client_ has
<ce> been patient with us but business must be transacted
<ce> sooner or later. Find %g2 in ___res_.
<ce> The object to be identified is said to be of minimal
<ce> difficulty, which is why we have not asked it to
<ce> be taken to a guild hall. Apparently our client
<ce> is so busy that merely stepping outside %g3 residence
<ce> supposes a ponderous burden. The agreed sum is
<ce> =reward_ gold, which you are free to pocket as compensation.
<ce> I do merely ask that you arrive within =2res_ days.
<ce> That is what we promised, you see, and the guild's reputation
<ce> must not be tarnished. Safe travels, my good %pct.

QuestFail: [1003]
<ce> _questgiver_ needed you to identify
<ce> _client_'s document by now.

QuestComplete: [1004]
<ce> Once you have cast the spell, the surface of the page
<ce> begins to blur. Previously undecipherable letters
<ce> take their proper place, and the meaning soon
<ce> becomes apparent.
<ce>
<ce> "%oth, must this be so? It is my mother's recipe for
<ce> gorgon snake soup. What a shame. Nevertheless, lest
<ce> I be treated as a pariah by you and yours, I will grant
<ce> you your money. Take it. Thank you in any case."
<--->
<ce> Once you have cast the spell, the surface of the page
<ce> begins to blur. Previously undecipherable letters
<ce> take their proper place, and the meaning soon
<ce> becomes apparent. _client_'s eyes quickly scan the page.
<ce> Suddenly %g1 turns pale and races to pull it from your sight.
<ce>
<ce> "That's quite enough! Not all things are meant for all
<ce> eyes, you see. That is private property. Take your money
<ce> and go. Leave me to my musings."
<--->
<ce> Once you have cast the spell, the surface of the page
<ce> begins to blur. Previously undecipherable letters
<ce> take their proper place, and the meaning soon
<ce> becomes apparent.
<ce>
<ce> "My word, this is the first love letter my parents ever
<ce> shared. Can you see this? They wrote one paragraph at a time,
<ce> sending it back and forth by a courier. What a treasure!
<ce> This is well worth the payment. Thank you, good mage."
<--->
<ce> Once you have cast the spell, the surface of the page
<ce> begins to blur. Previously undecipherable letters
<ce> take their proper place, and the meaning soon
<ce> becomes apparent.
<ce>
<ce> "A recipe for a potion of Free Action. Well, this is a disappointment.
<ce> I bet you have one of these waiting in your wagon, now don't you?
<ce> But we agreed on a payment, and that you shall have. Take it."
<--->
<ce> Once you have cast the spell, the surface of the page
<ce> begins to blur. Previously undecipherable letters
<ce> take their proper place, and the meaning soon
<ce> becomes apparent. _client_'s brow furrows.
<ce>
<ce> "A very primitive incantation to dispel a daedra. Some of these words
<ce> are actually made up. This looks entirely useless, I believe.
<ce> Nevertheless, I will pay you as we agreed. Fare thee well."
<--->
<ce> Once you have cast the spell, the surface of the page
<ce> begins to blur. Previously undecipherable letters
<ce> take their proper place, and the meaning soon
<ce> becomes apparent. _client_ begins to read aloud.
<ce>
<ce> "'The Dark Brotherhood has been watching you. You have slain
<ce> without sanction several times. You must now join us, or be
<ce> counted as our foe.' Well, this answers some of my long-standing
<ce> questions about my father. What a sorry state of things.
<ce> But I do thank you for coming out here. Take your payment."

Message: 1010
<ce> _client_ ignores you for several moments, clearly
<ce> caught up in other work. You wait until %g3 attention shifts.
<ce>
<ce> "Yes? Oh, from the Mages Guild, I see. Well, here it is.
<ce> This is a document I've held in storage for quite some time.
<ce> It carries an enchantment that mixes its letters, rendering it
<ce> unreadable. I need to have it legible and at my disposition.
<ce> When you are ready, cast the spell and I will read it."

Message: 1030
%qdt:
_questgiver_ of the
Mages Guild has sent me to ___res_
to find _client_, who possesses
an object that needs to be identified
via magical means. I am granted
=2res_ days to get there and cast the spell.

QBN:
Item _reward_ gold

Person _questgiver_ group Questor male
Person _client_ faction The_Mages_Guild

Place _res_ remote house1

Clock _2res_ 00:00 0 flag 1 range 0 2

-- Quest start-up:
start timer _2res_
place npc _client_ at _res_
log 1030 step 0
pc at _res_ do _inside_

variable _inside_
_conv_ task:
clicked npc _client_
say 1010
cast Identify spell do _ident_

variable _ident_

_pcgetsgold_ task:
when _inside_ and _ident_
give pc _reward_
end quest

_failsafe_ task:
end quest

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

Re: Custom quest support

Post by Interkarma »

Looking at this again, issue is the "cast spell do" action is limited to matching effects from spells found in the classic Quests-Spells table. Unfortunately, Identify is not represented by this list. Here's the full table of supported spells.

https://github.com/Interkarma/daggerfal ... Spells.txt

I'll see what I can do to support any effect, even custom effects people might mod into game in future.

Edit: Adding new quest action "cast effectKey effect do aTask". This will support any single effect provided you know the effect key. Should also support modded effects down the road for big spell/quest supermods.

Update

I have implemented "cast effect do" quest action now and successfully played through your quest. This quest action is going to be much more flexible in any case and will support any effect added to the game.

The only change I had to make to your quest was updating line 135 to:

Code: Select all

cast Identify effect do _ident_
The "cast effect do" action will be in next round of builds. Jay, have a look through the effects code to find their key in the properties setup.

For example, in Destruction/ContinuousDamageHealth.cs the key is "ContinuousDamage-Health". You could use this in a quest like so:

Code: Select all

cast ContinuousDamage-Health effect do _kaboom_

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Custom quest support

Post by TheLacus »

Interkarma wrote: Wed Nov 21, 2018 6:39 am For example, in Destruction/ContinuousDamageHealth.cs the key is "ContinuousDamage-Health". You could use this in a quest like so:

Code: Select all

cast ContinuousDamage-Health effect do _kaboom_
I think my extension can help here, reusing the support for actions suggestions/diagnostics. The boring part is to make a list of all effect keys... may take some time

EDIT
PacifyEffect and ElementalResistance use the name from ClassicEffects database, so this action breaks with localizations.

Code: Select all

string name = TextManager.Instance.GetText("ClassicEffects", subGroupTextKeys[variantIndex]);
vp.effectProperties.Key = string.Format("Pacify-{0}", name);
Other effects use the enum name. I would harcode capital case names of PacifyEffect and ElementalResistance for consistency.
Last edited by TheLacus on Thu Nov 22, 2018 11:10 am, edited 3 times in total.

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

Re: Custom quest support

Post by Jay_H »

Cool! Great, thank you for looking into this! :)

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

Re: Custom quest support

Post by Jay_H »

I'm having some trouble with a quest that previously worked well. I think it has to do with mixing with Brisienna's quest.

I'm using a newly created character who went straight to the Mages Guild and is trying to do a quest. Any time I try this quest, it aborts quickly. I've attached a save file. Here's the gist:

1. I get the quest, which is to deliver a document to a remote city (saved).

2. I travel to the city. The quest has already aborted.

3. Player log says:
Assigned Person Mordane Buckinging to Building The Gaercroft Residence

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

[JHMG009] Error in quest follows. Terminating quest runtime.

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

Object reference not set to an instance of an object
This abort happens only after fast traveling to the quest location. I can visit other towns without aborting it.

It's happened 3 times now, and I've used a different instance of the quest each time, albeit the same quest.
Attachments
Aborting Quest.zip
(115.61 KiB) Downloaded 99 times

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

Re: Custom quest support

Post by Interkarma »

I'll have a look over the weekend, thanks for letting me know. :)

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

Re: Custom quest support

Post by Jay_H »

I think some wires are crossed with regards to "city" and "village." I have a quest that runs when the PC enters a village:
Spoiler!
_enter_ task:
when pc enters village
clear _exit_

_exit_ task:
when pc exits village
clear _enter_

_meet_ task:
when _time_ and _enter_ and _level_
say 1010
create foe _enemy_ every 0 minutes 1 times with 100% success
give item _reward_ to _enemy_
make _reward_ permanent
start timer _timer_
This was originally for "city," but I tried going to a couple of large cities and _enter_ wouldn't light up. Then I changed it to "village," and Daggerfall City lit it up, as well as Penbrugh in the same region :D

I then copied the same quest material over for another, and then Daggerfall City was then a city and not a village. I forgot to save the mismatch and haven't been able to reproduce it.

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

Re: Custom quest support

Post by Jay_H »

I now have a save to illustrate. The quest below is wired to trigger with a dungeon location, but it uses cities just as easily.
Spoiler!
Quest: WADUNG1
DisplayName: Lost and Found II
-- Message panels
QRC:

QuestorOffer: [1000]
<ce> ERROR 1000 WADUNG1

RefuseQuest: [1001]
<ce> ERROR 1001 WADUNG1

AcceptQuest: [1002]
<ce> ERROR 1002 WADUNG1

QuestFail: [1003]
<ce> ERROR 1003 WADUNG1

QuestComplete: [1004]
<ce> You pocket the money, content with a job well done.

Message: 1010
<ce> You nearly bump your foot on the hilt of a weapon
<ce> in the ground. You can make out a faint
<ce> inscription on the side, resembling a name.
<ce> If this belongs to someone, perhaps you could
<ce> earn a reward by delivering it to them.
<ce> Do you wish to take the weapon?

Message: 1011
<ce> You take out the _wea_ and look
<ce> at the engraved name more closely.
<ce>
<ce> "_name_, of ___res_"

Message: 1013
<ce> You take out the _wea_ and look
<ce> at the engraved name more closely.
<ce>
<ce> "_name_, of ___res_"

Message: 1012
<ce> It looks like ordinary iron and to be of little value.
<ce> Surely someone else can waste their time ferrying it around.

Message: 1025
<ce> Yes? Yes, I am _name_. What is it?
<ce> %oth, my _wea_! Indeed, I had lost it
<ce> several days ago. Remind me, where did you find it?
<ce> Well, this is a pleasant surprise, and I thank
<ce> you for making the effort to return it to me.
<ce> Take this reward, please. I cannot let a good
<ce> deed go without its due compensation. Thank you, %ra.

Message: 1026
<ce> Hello? What is it? Oh, this _wea_!
<ce> My poor, dear _name_. You see, %g1
<ce> has gone missing and I cannot possibly
<ce> find %g2. This memento can at least remind
<ce> me of %g2 until our search is concluded.
<ce> Thank you, good %ra. Take this money.
<ce> Your good deed should not go without reward.
<--->
<ce> Hello? What is it? Oh, this _wea_!
<ce> My poor, dear _name_. You see, %g1
<ce> recently passed away. This memento can at least
<ce> remind me of %g2. Thank you, good %ra. Take this money.
<ce> Your good deed should not go without reward.

Message: 1030
%qdt
I unearthed a _wea_ in the wilderness
inscribed with "_fam_"
and "___res_." Perhaps I may
earn a reward for delivering it there.

QBN:
Clock _failsafe_ 30.00:00

Person _fam_ group Local_3.0
Person _name_ group Local_4.0

Item _wea_ weapon
Item _gold_ gold

Place _res_ remote house2

-- Quest start-up:
start timer _failsafe_
- pick one of _g1_ _dud_ _dud_
start task _g1_

_enter_ task:
when pc enters dungeon

variable _g1_
variable _dud_

_s1_ task:
when _g1_ and _enter_
prompt 1010 yes _begin_ no _quit_

_begin_ task:
get item _wea_
pick one of _f1_ _f2_
_wea_ used do _read_
log 1030 step 0
say 1011

_read_ task:
say 1013

_f1_ task:
place npc _fam_ at _res_
hide npc _name_
place npc _name_ at _res_

_f2_ task:
place npc _name_ at _res_
hide npc _fam_

_rew1_ task:
toting _wea_ and _name_ clicked
say 1025
give pc _gold_
end quest

_rew2_ task:
toting _wea_ and _name_ clicked
say 1026
give pc _gold_
end quest

_quit_ task:
say 1012
end quest

_failsafe_ task:
end quest
Attachments
Location Mismatch.zip
(85.52 KiB) Downloaded 98 times

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

Re: Custom quest support

Post by Jay_H »

I'm trying the "restore" action for the first time and running into some difficulty. This is the code:

Code: Select all

--	Quest start-up:
    place npc _nec_ at _nhome_

_day_ task:
    daily from 5:30 to 20:00
    hide npc _nec_

_night_ task:
    when not _day_
    restore npc _nec_
During the _night_ task the NPC doesn't appear. Is there something else I should do to trigger it?

Post Reply