Full Version : Intermedium Quest tutorial?
xmlspawner >>XMLSpawner - Tutorials >>Intermedium Quest tutorial?
<< Prev | Next >>
Matteo- 06-16-2006
Can Any XML staff or people make A intermedim Quest tutorial??? Many thanks!!!
Galfaroth- 06-24-2006
What would you like to see in this intermedium tutorial?
HellRazor- 11-03-2006
Well, I know this is an old thread, but since it was never answered...
Some good topics for an intermediate quest tutorial would be:
1. Quests with multiple steps.
2. Quests with branching objectives (meaning there is more than 1 path that can be followed to complete the quest).
3. Quests involving puzzles, switches, levers, teleports. Examples.
4. "Kill x number of (creature)" type quests.
5. "Instanced" quests. i.e., nothing is spawned until the quest begins, and then only the questor can interact with the spawns.
Just some ideas!
Guardian- 11-08-2006
I agree with this. I'm gm at a shard and most of the times it's difficult to create quests because of a simple step that you don't know.
Thanks.
blaatz- 11-08-2006
I am also a staffer on a shard and think that this type of tutorial would be a really good idea to implement so as to teach others how to get greater and greater personal knowledge on this wonderous system.
Vladimir- 11-08-2006
Howdy folks, here's my attempt at an intermediate tutorial. I've used HellRazors suggestions as a template for my quest design.
The Quest
The player walks past a beggar named Salim, who asks him for some gold for food. Upon giving the beggar some gold, he tells you that he knows of a treasure chest at the end of the tunnel up ahead, and offers you two paths. The fighter’s path, and the Thinker’s path. The fighter’s path requires you to kill 10 Brigands to get to the chest, and the thinker’s path gives you a code to break, which will allow you to navigate a teleporter maze. Once the player has completed one of these 2 tasks he/she then has access to the treasure chest and the quest is complete.
Writing up the Beggar NPC
The first thing I do is add a frozen xmlquestnpc, so that he doesn't wander around Green Acres while I'm trying to work on him.
[add xmlquestnpc set frozen true
And I bring up his blank dialog box with [xmledit
Now I add in the name of the questholder that I am handing out, and the attachment, as I don't want the NPC to respond to a player that already has the book, or has already completed the quest (As this example is a non-repeatable quest).
The "dependson" field for the first line has a -2 in it, because I want that line to take into account the TriggerOnCarried and NoTriggerOnCarried conditions. (a -1 will ignore those conditions.) I have added an additional condition in the "Condition" field, this checks to see that the player has at least 10 gold in his pack, as the quest requires you to give 10 gold to the Beggar. The "Text" field is what the NPC will say when a player (who is within the proximityrange) is found to have at least 10 gold on him/her.
Now I add a new line by clicking the "Add" button at the bottom. This line handles what happens when the player responds to the beggars pleed, by saying "What seems to be the matter?" That is specified in the keywords field. You can also add multiple answers to the keywords field such as quest,yes,sure,hello,hail all seperated by commas. This allows the player to say any of those words or sentences to trigger this line. Another handy feature is the "talktext" property of the NPC itself, which allows you to type a word or sentence that the player will say, when he clicks the "Talk" button under the NPC's menu.
Once the player has said "What seems to be the matter?" This line triggers a GUMP that is brought up, and offers the player the choice of whether to give the Beggar some gold or not. The book allows you to add longer strings of text in the entry fields, and can be brought up by clicking the scroll-type button to the right of the entry line. This GUMP type (4) allows you to specify responses at the end of the text. The format is ;name of the button or response;response;name of next response;response2 etc… the second part of declaring the button (after the name of the button; ) is used as the keyword in the next line. As can be seen here…
Nogold is the response if the player chooses not to give the Beggar some gold, in which case the Beggar replies: “Alright ya slob! Have it your way!” and the dialog is ended. Alternatively, the player could have chosen to be kind and give the Beggar 10 gold, which leads to the next line…
In this line, the NPC actively takes the gold, as can be seen in the action field: TAKEBYTYPE,1,10/gold (with format TAKEBYTYPE,probability,count/itemtype). This takes 10 gold from the players backpack in this case. Note that the dependson field (in this case it has the number 20) refers to the line number from which the response is coming. Apart from taking the gold, this line also displays a GUMP of type 4 to the player, with this text:
GUMP,Salim,4/Why thank ye kind {GETONTRIGMOB,name}! I owe you my life. In fact, I may be of some help to you. There lies a treasure chest most valuable in the cave up ahead, two paths lead to it, one fit for a fighter, the other for a witty mind. Which path do you wish to take?; I am a fighter at heart!;fighter;I seek a path of intellectual challenge!;maze;I am not ready for this challenge yet;no
The function of {GETONTRIGMOB,name} is to display the name of the player in the GUMP, to make it more personalised. So if the players name is Vladimir. He would then see his own name in place of the {GETONTRIGMOB,name} as seen here..
Why thank ye kind Vladimir!
This particular GUMP offers 3 choices. To take the path of a fighter, a thinker or to decline the task completely
If the player chooses the path of the fighter, the line looks like this…
Note that I saved my work at this stage (Should probably have been done earlier ). This line displays the GUMP describing what the player has to do, note that it is a type 0 GUMP, which means it only have 1 button at the end “Okay”, and the keyword is set to “done” when the player clicks this button.
This is also the line where the player is given the questholder (in the action field) and that line looks like this:
GIVE/<questholder/name/A Beggars Treasure/notestring/Kill the 10 Brigands in the tunnel up ahead to get to the treasure!/objective1/KILL,Brigand,10/objective2/Find the treasure/autoreward/true/repeatable/false
This gives a questholder with 2 objectives, Kill 10 Brigands and Find the treasure. If the player chooses to take the path of the thinker, the Line looks identical to that of the fighter, except that the player is given a different quest book:
GIVE/<questholder/name/A Beggars Treasure/notestring/Use the code book found inside the tunnel to navigate the maze and find the treasure/objective1/Complete the maze/objective2/Find the treasure/autoreward/true/repeatable/false
Once the player clicks the “Okay” button I added one more line…
This line dependson 60,70 as it could come as a response to either the fighter or thinker line, depending on which the player chooses. The keyword is “done” because I used the GUMP type 0 in the previous 2 lines.
SETONTHIS/MSG/Good luck {GETONTRIGMOB,name}!/doreset/true
This line in the action field tells the NPC to wish the player good luck, and it also resets the timer on the NPC (Resets the ResetTime at the top of the dialog gump). This is just so that the next player that comes along doesn’t have to wait 2 minutes before the NPC will respond to him. Also note that I saved my NPC again, and it is important that you overwrite the file when this GUMP comes up.
That’s the NPC done, now to do the spawners and the puzzles.
The Random Book Spawner
This is a spawner if that spawns a random book for the player doing the thinkers part of the quest. The book is a code that the player needs to break, and in my case the book was written and then added to the server as an item on its own. This is because I couldn’t find a way to spawn a book with writing in it. But the point of showing you this is to give you some insight into using the RND or random feature. To add a spawner, type [add xmlspawner and target the tile where you want to place the spawner. You can name the spawner by editing the field right at the top of the spawner gump on the left, or by adding it to the add string like this... [add xmlspawner set name "A Random Book Spawner" (the "" are important if the name of the spawner contains spaces).
This is how I set up the properties of the random book spawner gump. MinDelay and MaxDelay are set to 0, so that the book spawns instantly. To trigger the spawner, you need to set a proximityrange (in this case it was 1, which means it will trigger as soon as a player comes within 1 tile away from the spawner). The “TriggerOnCarried” property should have the name of the questholder in it (ie it should have “A Beggars Treasure” in it for this quest, it is different in my example because the spawner I used this quest for had a different name…). Also, I put the names of the books it spawns (a possibility of 6) in the “NoTriggerOnCarried” property so that it doesn’t spawn another book, if the player already has on. The format is name of book 1,name of book 2,name of book 3 etc…
As you can see, the entries on the spawner gump are quite full, and carry on to the "second page". to view the second page of the spawner, click the "2" button or the number corresponding to the page number you want to view, as highlighted in the image above.
This is the part of the spawner that generates a random book and spawns it. The first 6 lines generate a random number between 1 and 6.
IF/RND,1,6=1/8/2
This means that: If a random number, between 1 and 6 is equal to 1, then go to subgroup 8 else go to subgroup 2
In other words, if the random number is 1, then go to group 8 and spawn that book (subgroups are the coloured numbers on the right in the “Sub” column).
If the random number is NOT 1, then it will go to subgroup 2, which will do the same test, but for number 2.
If the number IS 1, then it will skip the following lines until it gets to subgroup 8. At this stage, it will GIVE/epic2teleporterbook1, which is the name of the book I have saved. Also in group 8, it will show a message above the players head, telling him he has received a book. And lastly, the GOTO/1 tells the spawner to go back to subgroup 1, where it will stay until it is triggered by another player.
The Maze
This is what the maze looks like to the player…
It consists of a grid of black and white tiles, that are numbered A1, A2, B1, B2 etc, much like a chess board.
In GM mode, you can see that on each tile, is a teleporter. The coordinates are set to somewhere outside the maze (preferably back to the beginning). The player must pass through the caged area to enter the maze, at that point I have placed 6 spawners on top of each other. There is 1 spawner for each of the books and what it does is turn off the teleporters along the path that that particular book has the answer to (All the teleporters are ON before the player walks past the initiating spawner). Here is what one of those spawners looks like…
The properties of the spawner are set to detect player in a proximityrange of 0 (or the same tile as the spawner). The spawner is also set to TriggerOnCarried “the name of that particular book” so that it only triggers the spawner, for the route that is described in the book. The spawnrange is irrelevant in this case… I only noticed I had changed it after I saved the image.
This shows how I turned off the teleporters along the path that the player must take (if he/she takes a wrong step he/she is teleported back to the beginning). If the lines are hard to read… here’s an example:
SET,TeleA1,teleporter/active/false
TeleA1 is the name of the teleporter on block A1 (the start of the route). All of these lines are under the same subgroup (this ensures that all of the lines are performed with 1 trigger, or at the same time). Once the player reaches the end of the maze there is a similar spawner that resets the maze. This is done using this line:
SETONNEARBY,20,teleporter/active/true (this sets all teleporters, in a range of 20 tiles to active)
This spawner also deletes the code book:
SETONCARRIED,The Teleporter Walkway/DELETE (DELETE must all be in caps)
Also having completed the maze, this should be reflected in the book, to do this you can add another line to the end spawner:
SETONCARRIED,A Beggars Treasure,questholder/completed1/true
The Brigands
Having chosen the fighters path, the player must defeat 10 brigands in order to find the treasure chests. Here is the props gump for the spawner.
I set the proximityrange to 30, so that the brigands spawn before the player gets there. The key property here is the TriggerOnCarried property, it must be set to the name of the questholder “A Beggars Treasure” so that the brigands only spawn for a player doing the quest. RefractMax and RefractMin are set to 10 minutes; this means that the spawner will wait 10 minutes before respawning the brigands, because you don’t want them to keep respawning instantly.
The actual entry that spawns the brigands looks like this:
#CONDITION,GETONCARRIED,A Beggars Treasure,questholder,completed1=false ; Brigand
This spawns a brigand on the condition that the player hasn’t yet completed objective 1 on that quest, to spawn 10 brigands set the Max to 10 and the Per to 10 on the right hand side of the gump.
The Treasure Chest!
This is the props gump for the treasure chest spawner at the end of the quest, It has the same TriggerOnCarried as the previous spawner, but I have set the spawnrange to 0, so that the chest spawns on the same tile as the spawner. I have set a Duration of 20 minutes, this means that the chest will despawn after 20 mins so that (hopefully) other players won’t be able to loot from it. The entry for spawning the chest would look like this:
#CONDITION,GETONCARRIED,A Beggars Treasure,questholder,completed2=false ; TreasureChestLevel5
This would spawn a level 5 treasure chest, as long as the player hasn’t completed the second objective (Find the treasure). This stops the player spawning the chest repeatedly and getting infinite rewards, because in the next step we set that objective to complete:
On the next line in the spawner we have this:
SETONCARRIED,A Beggars Treasure,questholder/completed/2true
This completes the second objective, and the questholder should now dissapear (at it was set to autoreward/true and the player should get 1 quest point for completing the quest)
Both the of these lines should be placed under the SAME subgroup, so that they are both activated by the first trigger
And with that, your done!
Thanks to Justae for idea and implementation of the teleporter maze puzzle (which we actively use as a quest on our shard). I hope this post comes in handy, any corrections/suggestions/additions are MORE than welcome!
Regards, Vlad
ArteGordon- 11-08-2006
wow, nice job.
Guardian- 11-14-2006
Nice ideas. Thanks for all. Only one more thing. How can we add/subtract fame and karma to a player after accomplishing a quest?
ArteGordon- 11-14-2006

QUOTE (Guardian @ November 14, 2006 06:00 pm)
Nice ideas. Thanks for all. Only one more thing. How can we add/subtract fame and karma to a player after accomplishing a quest?

when you create the questholder, you can assign the attachmentstring property to add karma or fame using the XmlAddKarma or XmlAddFame attachments. The attachment will be attached to the player when they complete the quest.

QUOTE
- added a new AttachmentString property that works in the same way as the RewardString only for attachments. This allows both reward items and reward attachments to be specified by string in a single quest.

QUOTE
- added several new attachments (XmlAddVirtue, XmlAddFame, XmlAddKarma). To use these in a spawner you could attach them to a player with SETONTRIGMOB/ATTACH/xmladdvirtue,Justice,3 which would give 3 justice points to the triggering player, or
orc/name/Schmeil the good/ATTACH/xmladdkarma,-500

So you could do something like
GIVE/<questholder/name/A Beggars Treasure/notestring/Kill the 10 Brigands in the tunnel up ahead to get to the treasure!/objective1/KILL,Brigand,10/objective2/Find the treasure/autoreward/true/repeatable/false/attachmentstring/XmlAddFame,100
HellRazor- 11-15-2006
Great stuff!
XMLSpawner is so powerful it can be a little overwhelming. The tutorials are a huge help. THANK YOU!
HellRazor- 11-15-2006
I just read through the entire document. Great tutorial!
Recommendations:
1. You should attach all of the XMLSpawner files for this quest so people can download and refer to the completed quest.
2. In the book spawner part of the tutorial, for those who are less familiar with XMLSpawner, it would be good to specify the commands you use to create and name the spawner, and also how you get from the first page to the second page shown. Just to avoid any confusion.
Some questions (sorry if some of these seem newbie-ish or are addressed elsewhere here on the forums):
1. How would we make this into a repeatable quest?
2. How can we set a minimum delay time to repeat the quest (make the quest repeatable once every x minutes)?
3. If I have a custom playermobile property such as ExperiencePoints, how can I have the quest add or subtract from that value? If the custom field is an enum, how can I set the value of the custom field?
4. Is there a way to have the questnpc respond to ANY words spoken by the player? (i.e., instead of checking for "What seems to be the matter" it would respond to ANY words the player said).
5. It would be interesting to go into more variations on the CONDITIONS field. The example checking for gold is good, but maybe also provide some examples on other conditions that can be set.
6. For that matter, is there a master list somewhere of all of the keywords that can be used in the CONDITIONS and ACTIONS field?
7. In the example, if the player doesn't give the NPC any gold, is he still able to do the quest at a later date? What is it that identifies whether or not the player has done this quest, and where is it set and where is it checked?
8. When taking the gold (or whatever is specified in TAKEBYTYPE) will XMLSpawner always default to searching both the pack and the bank? What if you want it to check for one or the other?
9. How can we make the treasure chest only accessable by the player who has completed the quest?
Thanks!!
Vladimir- 11-15-2006
Thanks for your comments HellRazor, I’ve updated my post about adding, naming and changing pages in spawners.
Because of locally competing shards, and the complexity of saving things such as teleporters and the books as items, I’d rather not make the quest available for download here. All the info you need is here though and if you are willing to put in the effort your more than welcome to use it.
Let me try answer some of your questions…
1) Simple, just set the repeatable property when you hand out the questholder to true
GIVE/<questholder/name/A Beggars Treasure/notestring/Use the code book found inside the tunnel to navigate the maze and find the treasure/objective1/Complete the maze/objective2/Find the treasure/autoreward/true/repeatable/true
2) By default, quests are repeatable, so if you were to leave out the repeatable/true at the beginning, it would be repeatable anyway. All of the properties that are used in the line above, such as name, repeatable, autoreward, notestring objective1 are all properties that you can view in the [props gump of the questholder. To make the quest repeatable after a period of time, you would do this…
GIVE/<questholder/name/A Beggars Treasure/notestring/Use the code book found inside the tunnel to navigate the maze and find the treasure/objective1/Complete the maze/objective2/Find the treasure/autoreward/true/nextrepeatable/06:00
The time at the end is specified in hours and minutes, so in this case the player would have to wait 6 hours before he can do the quest again. Alternatively, if you wanted the player to only wait a few minutes, you would enter the time as 00:12 (for 12 minutes). The player can then view when the quest is next available by opening his Quests gump, by clicking the Quests button on his/her paperdoll.
3) Custom properties work just the same as default ones, (If its in the [props gump, you can use it!) On my shard we have a custom prop on playermobiles called “LeaveHaven.” It can be either true or false, if I wanted to change it via an xmlquestnpc, I would put this line in the Action field of the line you want it to be triggered on…
SETONTRIGMOB/LeaveHaven/True
SETONTRIGMOB is a command used to set properties on the “TRIGMOB” or the player that is currently using the Quest NPC. LeaveHaven is the property I want changed, and I want it changed to “True”
For enums, as far as I know the only difference with them is when you are LOOKING for the value if contains (Using one of the GET commands). Setting these properties is the same, eg, I have Custom races on my shard…
SETONTRIGMOB/Race/Orc
The difference comes in when you are looking for a value, for instance if I wanted to make the line only trigger if the player was an Orc. In the Condition field it would look like this…
GETONTRIGMOB,Race=#Orc
Race is the enum property I am using, and when I want to retrieve info from an enum I add in a # before the property I am using. Note this is only done when using one of the GET series of keywords (Arte may correct me on this ).
4) To have an NPC respond to anything you say, you would use a wildcard such as * in the keywords section. So just having * in the keywords section means that the NPC will respond to anything you say (as long as the conditions in triggeroncarried and the CONDITION fields are met).
5) Anything that you find in the triggering player/npc’s property gump, you can check for, as well as any items the player is carrying
GETONTRIGMOB,hits>100 (hits greater than)
GETONTRIGMOB,Classe=#Mage
GETONTRIGMOB,str!99 (strength not equal to)
GETONCARRIED,,katana,hue=123 (Does he have a katana in his pack with that hue?)
GETONCARRIED,Vladimir’s Katana,katana,visible=true (Does he have a katana in his pack called “Vladimir’s Katana” and is it visible?)
You can also have multiple conditions
GETONTRIGMOB,classe=#Hunter & GETONCARRIED,,katana,hue=123 (Is player a hunter AND does he have a katana with a hue of 123)
GETONTRIGMOB,Classe=#Hunter | GETONTRIGMOB,Classe=#Mage (Is the player a Hunter OR a Mage)
The best way to learn about this kinda stuff is to search through the xmlspawner2.txt file you should have received when you downloaded xmlspawner.
6) As above… xmlspawner2.txt is your friend
For the action field you can use things like…
SETONTRIGMOB/name/Vladimir
SETONTRIGMOB/str/INC,4 (Increase players str by 4)
Best thing to do is have a look through that file and find out what all the keywords do, SETONTHIS SETONNEARBY (we still want a GETONNEARBY) SETONPARENT etc.
7) Yes the player can, the thing that stops a player repeating a quest, is the XmlQuestAttachment that the player receives when the quest book is deleted (For non-repeatable quests). You can view a players attachments with the command [getatt and targeting the player. In the NoTriggerOnCarried field, I did a check to see if the player had this attachment (ie had already done the quest). Arte may have to go into more detail if this is still unclear to you, as I’m still not 100% comfortable with attachments yet
8) Small mistake on my part here, by default TAKEBYTYPE will NOT search a players bank, only his backpack. If you wanted to include the bank in this search you would do this…
TAKEBYTYPE,1,10,true/gold (The true is the key thing there)
I’m not sure how to do this the other way around (checking players bank and not his pack, but that might not really serve any purpose?)
9) TreasureMapChests (Different from TreasureChestLevels) have an owner property, whereby if a player other than the owner takes an item out of the chest, he/she becomes criminal. Other than that I don’t know of any ways to restrict access to chests :/ Maybe Arte can shed some light on this.
Thanks again for the comments
Vlad
HellRazor- 11-16-2006
Thanks for investing the time to put this together Vlad, and for answering the questions! I am just now figuring out how to take advantage of XMLSpawner and it's hugely helpful to have examples and tutorials to learn from.
The examples with the maze, etc. are wonderful since they illustrate some of what it is possible to do beyond the simple "Kill x number of monster y" or "get this and return it to x" type quests.
The files would mostly be useful in clarifying some of the points of the tutorial, but if there is anything unclear I am sure I'll run into it when trying to put it together manually.
I'll sit down this weekend and try to actually put this quest together in-game (for learning purposes, not for public consumption). I might have some more questions/suggestions then.
HUGE kudos to you sir!
ArteGordon- 11-16-2006
everything Vlad said is right on the money.
Restricting access to things like treasure chests is an interesting issue.
The XmlSpawner attachments do have the ability to control the use of objects, but that ability is not enabled by default (largely because I hadnt added any attachments that took advantage of it).
I have updated the beta 3.17 release package to enable use-control by default along with some additional features. I also added a new XmlUse attachment that allows you to do things like restrict access to a chest (or any other object) in the way that you were describing.
HellRazor- 11-17-2006
Arte, I was wondering if the keyword list at the beginning of the XmlSpawner2.txt file was complete and up to date?

QUOTE
- special keywords can be used in spawning for control or effects: - value keywords: RND, RNDBOOL, RNDLIST, RNDSTRLIST, RANDNAME, INC, MUL, MOB, SERIAL, SKILL - control keywords: WAITUNTIL, IF, WHILE, and GOTO - action keywords: ADD, EQUIP, GIVE, TAKE, TAKEBYTYPE, CAST, SAY, MSG, SENDMSG, BCAST, RESURRECT, POISON, DAMAGE, MUSIC, EFFECT, SOUND, GUMP, DESPAWN, DELETE, KILL, ANIMATE, OFFSET
- loot keywords: ARMOR, WEAPON, JEWELRY, JARMOR, JWEAPON, SARMOR, SHIELD, LOOT, LOOTPACK, POTION, SCROLL, NECROSCROLL
- access keywords: GET, GETONTHIS, GETONPARENT, GETFROMFILE, GETONSPAWN, GETONCARRIED, GETONMOB, GETONTRIGMOB, SET, SETONTHIS, SETONPARENT, SETONSPAWN, SETONSPAWNENTRY, SETONCARRIED, SETONMOB, SETONTRIGMOB, PLAYERSINRANGE, TRIGSKILL