Register Now For Free!
Go Back   Age Of Darkstone : EXODUS

Stats
Members: 530
Threads: 797
Posts: 2,623
Top Poster: NewsBot (674)
Welcome to our newest member, RodyIdeorce
Online Users: 2
0 members and 2 guests
No Members online
Most users ever online was 23, May 10th, 2008 at 04:52 AM.
Recent Posts
Seriously, A New...
Last post by Onyx
1 Day Ago 07:58 AM
Hello everybody!
Last post by Rain
3 Weeks Ago 06:55 PM
January 2009
S M T W T F S
28293031 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Today's Birthdays
None
Newest News Posts
Obama: Waiting on the...
Last post by NewsBot
1 Day Ago 01:30 PM
Iran Threatens to Break...
Last post by NewsBot
2 Days Ago 12:39 AM
Idea To Donate Forum
Last post by noungantial
4 Days Ago 06:34 PM
Israeli, Palestinian...
Last post by MaciefisusCaf
5 Days Ago 02:35 AM
2008: The year Democracy...
Last post by NewsBot
6 Days Ago 11:29 AM
Donate
Want to help out AoD?

Click here to make a donation to help AoD continue to be the best!

Log in
User Name Not a member yet?
Register Now!
Password
XmlQuest 4 Dummies
"XmlQuest 4 Dummies"
How to build a simple quest (ver 0.1.1)

Author: Eymerich
Edited by: DrussRob


This tutorial requires that you have ArteGordon's XMLSpawner
Click here to go to the official website for XMLSpawner

Summary

In this guide I will explain how to make a quest using ArteGordon's XmlSpawner system. We will be creating a rather simple quest as it is important to understand the basics of the system before you attempt to create a more complex quest. The easiest way to create a quest is to create an npc and start a dialog.

Create A Quest NPC :

To create a quest NPC, type the following command in game:

 [add xmlquestnpc

Target where you want to create the character and left click. This will create the base quest npc for this system. You can name this character whatever you wish. In this case the name is Anita.

Build A Dialog :

Once your character is created, use the following command and target your NPC to begin building a dialog.

[xmledit

Click the“Add” button on the window that is created and you get this.

You have now successfully added a blank entry in the dialog for the NPC!

Now, let's examine the GUMP in the picture. In the topmost part of figure resides the global parameters of dialog.

Anita : NPC's name

Proximityrange : Number in tiles from player to begin dialog.

Resettime : Time that the dialog is reset.

Ghosttrig : When AllowGhostTrig is true, only dead players will trigger the spawner.  When it is false, only alive players will trigger it.

The TriggerOnCarried and NoTriggerOnCarried strings allow triggering on players with certain items equipped or in the backpack.

The other sections of window are to add entries to the dialog. Now we'll begin to create a dialog for interaction with players.

To make the NPC say “Good Morning” or “Hi”, type your text in the text entry box. For each additional text string, press the "Add" button again to add a new entry.

Speech entries when no "OnCarried" trigger restrictions are specified:
 
Currently, specifying a DependsOn of -1 (banter) allows that entry to be activated regardless of triggering restrictions (nearby movement is sufficient). 

By specifying a DependsON of -2, that entry will behave like banter that will also be suppressed just like speech activated entries if triggering restrictions are not met.

In this entry I have added “Good Morning” in text box and -1 in the DependsOn and click add then insert “Hi!” in Text box and -1 in to DependsOn.

Now we test the dialog and it doesn't work...

The reason for this is because all NPC dialogs react by default to characters with the access level of "Player". To remedy this problem we use the command [props on the NPC and then change the TriggerAccessLevel to "Administrator". This way we can test the dialog with an Admin character and the NPC will react as if you were a player character.

As an alternative you can also use tool's such as ArteGordon's "Staff Cloak", which allows admin's to temporarily change thier access level to player and then back again by double clicking it. This cloak script is included in your XMLSpawner2 package.


Now, on approach the NPC speaks!

Now, we want the NPC to say, “Have you got a little time for me?” after the “Hi” or “Good Morning” greeting.
I add, “Have you got a little time for me?”  in text box and 10,20 in the DependsOn field. We then hit the "add" button to add it to a new text entry.

picture

Now I add four entries of dialog in this way.

EntryNumber =40
Keywords = yes,ok
DependsOn =30
Gump = GUMP,Anita,4/Are you interested to earn some money for easy work?;Yes, off course;ok;How much?;money

EntryNumber = 50
Keywords = ok
DependsOn =40,60
Gump = GUMP,Anita,3/You must kill an orc named "BOBO" not so far from here.

EntryNumber = 60
Keywords = money
DependsOn = 40
Gump = GUMP,Anita,4/200 gold for you. Do you like them?;Ok;ok;No, thanks;no


(cont..)

EntryNumber = 70
Keywords = accept
Action = GIVE/<questholder/name/Kill Bobo/notestring/Bobo must go.  Find him and kill him/objective1/KILLNAMED,Bobo,1/autoreward/true/rewardstring/@bag/ADD/gold,200
DependsOn = 50

This is the result:

To not trigger the dialog whenever any item with the name of "Kill Bobo" is being carried. In this case, that would be the questholder by that name. I add the following code to NoTrigOnCarrier : Kill Bobo

Now we test the dialog. Follow the example of the gump in the dialog.



Ok it seems to work. In the last gump you can accept the quest and created in your bag is a book which explains the quest.

Example:

Save Dialog File

Now, when the dialog works, we want to save the dialog to a file.

Once again, use the command [xmledit, and click on your NPC again. At the bottom of gump, there is a section named "Save File To" in the middle of the screen. Here is where you create a name for the file you will create that will save your work. The files are saved in a folder named "XmlQuestNPC" in the RunUO top level directory.

The first step is done.

But where's the orc? where is he spawned? when? etc..

Spawn The Creature

Now we add an xmlspawner by using the command  [add xmlspawner and then targeting the ground where you want to place the spawner. Once placed, double click the spawner itself and you will see a gump like this appear.

This is the basic interface gump for all xmlspawners.

The text entry box at the top is the area specified for naming the specific spawner that you are working on at the time. Simply click in the box to place your cursor and type in the name you wish it to have and hit enter. The spawner will now show the name you specified when you mouse over the spawner itself or when you do a search for specific spawners.

This is especially useful for quickly identifying spawners at a later date, and being able to easily identify quest spawners. To learn more about the spawning system itself have a look at this link to find more tutorials on this system.

Now that we have created our .npc file we can spawn our quest NPC.

To spawn the quest NPC that we created, we would use this code in the first entry box:

xmlquestnpc,1/name/Anita/talktext/yes/configfile/Anita/loadconfig/true

Let's break this down and explain what this means.

xmlquestnpc,1 = create a female npc

/name/Anita = name is Anita

/talktext/yes/ = this setting, when you click on Anita, adds a "Talk" option to the NPC interaction menu.
However, setting the talktext does not actually make that the keyword to start the dialog. That has to be set in the xmldialog, or it can also be the speech trigger for a spawner. The talktext setting is simply the speech that will be generated as though the player had spoken it when they select the 'Talk' context menu option. By giving them the context menu option, it just means that they dont have to guess at the trigger phrase to get things started.
They just select 'Talk' and it says the right thing for them.

configfile/Anita/ = This specifies which config file we want to use. Here we use the one we just created.

loadconfig/true/ = Loads the config file.

Now, for the orc "Bobo".

Go not too far from the spawner we just placed and add another the same way as before. Also, do not forget to name your spawner for easy identification later.

Add to the first row this code:

orc/name/Bobo

Now we want to save the spawners (save all xmlspawner in play) with

[xmlsave anitaquest.xml

To load the spawner:

[xmlload anitaquest.xml

 


home

I will happily host any intelligible rewrite to this guide if anyone feels the urge.

All times are GMT -5. The time now is 04:03 PM.