Part Five: Placing and Delivering Items
Now it's time to learn about putting items on monsters and making items into quest requirements.
Code: Select all
Quest: TESTING4
DisplayName: Treasure Time
-- Message panels
QRC:
QuestorOffer: [1000]
<ce> Bring me one _clothes_.
RefuseQuest: [1001]
<ce> Then go away.
AcceptQuest: [1002]
<ce> But bring me the right one.
QuestFail: [1003]
<ce> ???
QuestComplete: [1004]
<ce> Good, but I'm gonna want more soon.
All standard fare.
Code: Select all
Item _reward_ gold
Item _clothes_ mens_clothing
Person _questgiver_ group Questor male
Clock _timer_ 00:20
Foe _enemy_ is Giant_bat
Place _guild_ local magery
We have defined an ordinary reward of leveled gold.
We have defined another item called _clothes_, which will draw from the game's table of men's clothing. You can find other item tables in the quest element topic.
We have set our questgiver as the person to click on to end the quest.
We have set a timer of 20 minutes. As I said before, it's always a good idea to have a timer of some kind on your quest, just in case something goes wrong and it can't finish properly.
We have created, but not placed, a Giant Bat to fight.
We have told Daggerfall to choose some guild in the current town. In Aldingdale, that can only be the Fighters Guild.
Code: Select all
-- Quest start-up:
start timer _timer_
place foe _enemy_ at _guild_
give item _clothes_ to _enemy_
We have told Daggerfall to begin the 20-minute timer we previously created.
We have told Daggerfall to place our enemy, the Giant Bat, at the guild.
We have also told Daggerfall to give the item _clothes_ to the Giant Bat. The game will decide what kind of men's clothing it'll give. There's a way to specifically determine which item it'll choose from the table, which is a more advanced step.
Code: Select all
_victory_ task:
toting _clothes_ and _questgiver_ clicked
give pc _reward_
end quest
Now we have a new condition: toting ITEM and NPC clicked. This is a verbatim statement, except for the variables, and cannot be altered, with one minor exception which we won't go into in this tutorial.
This is a conditional statement which means, "If the player character is carrying the ITEM and clicks on the NPC," which then follows through to say, "I'll give the PC the REWARD and end the quest."
This is our usual time-out trigger.
Back in Aldingdale, Illesan Hills:
We see the game has chosen the item for us: a Formal tunic.
Just a reminder that in Daggerfall, only the specific quest object suffices. That's the one with the green background that this specific quest generated. Even if two identical objects are generated in two different instances of the quest, it'll require the item it generated this time.
We have killed our bat, and must now get its treasure.
Ordinarily, natural beasts don't hold treasure in Daggerfall, but we've put a sweater on this one. We take it out of its inventory and put it into ours.
Then we click on tunic guy, who accepts the item.
And there's our reward. If anything in your game does not work the same way as what's shown here, something's wrong with the quest file.
A few notes about how this works:
1. Always, always put the "give item ITEM to ENEMY" in the quest start-up section. It cannot accept quest conditions, so don't try a "pick one" scenario where you let the game choose between three different enemies and you give the item to one of them. It will not work.
2. "toting" is only compatible with clicking on an NPC. We may find more sophisticated ways of mixing item possession with other quest conditions, but for now, "toting" only matters in conjunction with clicking on a quest NPC.
And that's tutorial five on making quests in the Vengeance build.
If you want, you can try to experiment with trying to place an item on the ground somewhere. This inherently has quest actions built in, such that if you click on the object, it'll be put into your inventory. It's equally compatible with the "toting" condition. As an example, take a look at a section of a sample quest:
Code: Select all
Person _questgiver_ group Questor male
Item _clothes_ mens_clothing
Place _res_ local house2
Clock _timer_ 00:20
-- Quest start-up:
start timer _timer_
place item _clothes_ at _res_
If the quest functions properly, you'll be able to find some quest-related piece of clothing in some residence in the current city. Clicking on it should take it from the ground and into your inventory.
Not all quest objects work well being placed on the ground. Some weapons are simply invisible, so if you know where they are and click on them they'll enter your inventory, but that's asking too much of an ordinary player. The mens_clothing variable will always be visible, so start with that if you want to test it.