tass23

Member
tass23 created a new tutorial:

XmlDialog/XmlEdit, XmlQuestNPC, KILLNAMED Objective, XmlMobFactions
Feature Usage: XmlDialog/XmlEdit, XmlQuestNPC, KILLNAMED Objective, XmlMobFactions

Estimated Completion Time: ~60:00 minutes (give or take copy/paste speed)

Introduction: Create and use: an XmlQuestNPC, Specific Quest Mob(s), XmlMobFaction features, and more.

There are a lot of different ways to spawn mobs using Xmlspawner. You can change a lot "on the fly" that you can't change easily using a script (unless restarting the server a lot is fun for you). A script must be compiled and ready to be generated in the world, but something created from an Xmlspawner happens as soon as you click Respawn in the Spawner gump. While everything starts off as a script at some point, Xmlspawner can expand on it. We are going to build our Grey Wolf for the quest we created in the previous tutorial (XmlDialog/XmlEdit, XmlQuestNPC, KILL Objective Part 1). Here is the GIVE action as a quick reminder: (see image 1-0)

Code:
GIVE/<questholder/Name/A Simple Quest/titlestring/A Simple Quest/Notestring/Kill the wolf that has been eating my sheep./Objective1/KILL,greywolf,1/Description1/Kill a wolf prowling the fields./Addjournalentry/You should look in the following places:Brit Farms/PartyEnabled/True/Autoreward/True/CanSeeReward/False/Difficulty/2/Rewardstring/@bag/ADD/Gold,500/ADD/Lantern>

Spawner0.jpg

Image 1-0

Take special note of: Objective1 (KILL,greywolf,1) and Description1(Kill a wolf prowling the fields.). They go hand in hand.

Now there isn't a whole lot that is special about a wolf, we're going to fix that. Let's start with a basic spawn entry.

[Add Xmlspawner and target the ground near you, then double-click the Xmlspawner to open the window. There's a lot to look at here. I'll cover the important things we'll be using just for this tutorial. More advanced tutorials will cover more settings. Taking a closer look at the Xmlspawner window, here is a breakdown of what the numbers are highlighting (see image 1-1).

Spawner1.jpg

Image 1-1

1. Spawner Name - Xmlspawners can have unique names or you can just leave them their default (Spawner). I try to name mine whatever I'm using it for, in this case spawning a grey wolf for our Simple Quest. NOTE: DO NOT USE SPACES IN SPAWNER NAMES, USE "_" INSTEAD. Xmlspawner doesn't like spaces in spawner names, so use the underscore "_". This will be crucial later when we reference a spawner from a line entry on another spawner. You can use the Serial as well (which is great until you have to move the spawners to another shard, then everything breaks).

2. Line entry for the object to spawn - This can also be used to various Xmlspawner commands. For example, we could skip the XmlQuestNPC altogether, and have the quest gump appear when a player gets close enough to this spawner, but we'll talk more about that at a later date.

3. Book Entry - This opens a long book for you to enter commands or objects to be spawned. Each book is 26 pages long.

4. Lock/Unlock button - While hard to see in the picture, the small button to the very left of a line entry is for locking/unlocking that entry. This is helpful if you don't want that line messed. While anyone that can access a spawner can simply open the spawner and unlock the line to make changes, it is a good practice to get in to.

5. Up/Down arrows - These buttons control how many Max Spawns you have for that line entry. In this case, we're only going to spawn one grey wolf, so we will leave those arrows alone for now.

6a. Max Spawn - The red "1" indicates this line entry will spawn only "1" Max before it resets and the Min/Max timers for respawn take over. The green "0" indicates that 0 out of 1 max "whatever" have been spawned.

6b. Max Spawns - This red "1" tells you the total (Max Spawns) spawns that will be executed. This number will increase/decrease if you use the Up/Down arrows to the left of each line entry. There are instances where you would manually change this number instead of using the Up/Down arrows. Since we're only dealing with one spawn, there is no need to manually change the number. If we added another line entry for say a darkwolf, the Max Spawns would automatically increase/decrease as the Up/Down arrows were used.

7. Page Number - Yes, Page Number. If you don't think 15 line entries will be enough, simply click the page number to move to the next blank page of line entries. This means you can have 4 pages of individual line entries, each with 15 lines, that's a total of 60 individual line entries, per spawner.

You're probably wondering why I didn't explain the rest of the boxes in the far right of the spawner gump. With various entries, you can dramatically change the way spawns happen and what happens after the Max Spawn are reached for that line entry or even how many of "each mob you have to kill to advance to the next line entry" for example. For the purposes of this tutorial, the explanations for these will be saved for a future tutorial. The buttons along the bottom of the spawner gump are fairly straightforward.

On/Off Indicator - Left top. If the spawner is Active, this will be green, otherwise it's red.

Help - Left Middle. This opens another gump with syntax for using KEYWORDS and various other Xmlspawner settings.

GoTo - Left bottom. This will pull your character to the location of the Xmlspawner itself. This can be helpful, most times. However, there is very little reason to ever GoTo a spawner, because with the spawner gump open, you can make changes no matter where you are on the shard. Combined with [XmlFind, you can edit the [props of any spawner as well as open the spawner gumps, all without ever using GoTo.

Reset - Middle top. This will reset the spawner back to line entry 1 and turn the spawner Off.

Bring Home - Middle middle. This button will bring ALL the spawn back to the spawner itself. Helpful if you had once turned Home Range off and your mob wandered all across the land and got lost.

Respawn - Middle bottom. This button will Activate the spawner. In most cases the spawner will just do a soft reset, a reset without turning off, and spawn the first line entry. Sometimes the spawner doesn't fully re-cycle, so the Respawn just Activates the spawner wherever it "left off".

Refresh - Right top. If you've made changes to the [props or spawner settings, you can click Refresh to update the gump. In most cases, if you click out of one box and into another, the gump updates.

Props - Right middle. This opens the gump for the spawner's properties. There are even more settings that can be changed in the [props to alter the way spawning behaves.

Sort - Right bottom. This button can be very handy when you're using Sub-groups. Sub-groups allow you to Group line entries, so multiple line entries will spawn together. More on Sub-groups in a later tutorial.

So far, our spawner entry looks pretty plain:
Code:
greywolf

But, if we click on the Book Entry icon (that is #3 in the list above), we can add even more to our greywolf. Any additional information you include about this particular spawn will override whatever the scripted value is. Otherwise, all default scripted values are inherited. So, for example, we will say that a regular greywolf is too weak and this one should be a lot tougher. First thing to change would be the Strength. So we change the line entry to read: (see image 1-2)

Code:
greywolf/Str/400/

Spawner2.jpg

Image 1-2

Now just for the sake of argument, we'll assume you want to change the Hue to make our wolf stand out in the crowd. In this case, we'll use Hue 34, which is a reddish hue. (see image 1-3)

Code:
greywolf/Str/400/Hue/34/

Spawner3.jpg

Image 1-3

Now let us also assume you want this mob to spawn as a "Red"/Murderer. On my shard, 5 Kills make you a "Red"/Murderer, so we simply add: (see image 1-4)

Code:
greywolf/Str/400/Hue/34/Kills/5/

Spawner4.jpg

Image 1-4

Even with a Strength of 400, this greywolf needs more Hit Points. We can change the HitsMaxSeed which will increase the Max Hit Points the mob can have, but they will spawn with whatever the default health is in the script and "heal" up to their new Max: (see image 1-5)

Code:
greywolf/Str/400/Hue/34/Kills/5/HitsMaxSeed/1000

Spawner5.jpg

Image 1-5

Since that only increased the Max Hit Points, but spawned the greywolf with only the default health, we will make another change so that it spawns with the Max Hit Points, by increasing the Hits: (see image 1-6)

Code:
greywolf/Str/400/Hue/34/Kills/5/HitsMaxSeed/1000/Hits/1000/

Spawner6.jpg

Image 1-6

Finally, we want to make our greywolf feel even more special. So we're going to give him a Name and a Title: (see image 1-7)

Code:
greywolf/Name/Ralph/Title/the Grey Wolf/Str/400/Hue/34/Kills/5/HitsMaxSeed/1000/Hits/1000/

Spawner7.jpg

Image 1-7

Note: You may have noticed I didn't put the Name and Title at the end of the code like I did with the rest. When it comes to creating mobs on the fly using Xmlspawner, it helps to maintain a structure. I always start with the BaseClass, then Name, then Title, etc. Names and Titles are usually common changes, especially when working with KILL and KILLNAMED keywords in quests.
 
Last edited:
SO, now that my XMLSpawner is working now (thanks to however fixed it in the SVN!) i'm rolling through the tutorial here. This system is really cool, but it is taking me a while to wrap my head around it. :) I've done pretty good up until this part:

https://www.servuo.com/tutorials/xm...-killnamed-objective-xmlmobfactions.9/?page=4

I'm having a hard time getting the 'scout this area' objective to work properly. My guess is because I have something named wrong in the TriggerOnCarried and NoTriggeronCarried methods. It shows them green (as they have been edited), but they are not discussed in the tutorial (probably assuming that we already know what needs to go in there.)

I currently have:

TriggerOnCarried = A Simple Quest,2
NoTiggerOnCarried = A Simple Quest | ATTACHMENT, A Simple Quest,XmlQuestAttachment

Is this correct? I would think that scouting the area is objective two (and I have succesfully completed objective one) that this is what would trigger it, but I can't seem to get it to go.

Thanks a million Tass23 for this document. Have helped me out a lot learning how to set this stuff up. I think I'm able to setup some basic kill quests now, but would like to see if I can get this second part down as well.
 
SO, now that my XMLSpawner is working now (thanks to however fixed it in the SVN!) i'm rolling through the tutorial here. This system is really cool, but it is taking me a while to wrap my head around it. :) I've done pretty good up until this part:

https://www.servuo.com/tutorials/xm...-killnamed-objective-xmlmobfactions.9/?page=4

I'm having a hard time getting the 'scout this area' objective to work properly. My guess is because I have something named wrong in the TriggerOnCarried and NoTriggeronCarried methods. It shows them green (as they have been edited), but they are not discussed in the tutorial (probably assuming that we already know what needs to go in there.)

I currently have:

TriggerOnCarried = A Simple Quest,2
NoTiggerOnCarried = A Simple Quest | ATTACHMENT, A Simple Quest,XmlQuestAttachment

Is this correct? I would think that scouting the area is objective two (and I have succesfully completed objective one) that this is what would trigger it, but I can't seem to get it to go.

Thanks a million Tass23 for this document. Have helped me out a lot learning how to set this stuff up. I think I'm able to setup some basic kill quests now, but would like to see if I can get this second part down as well.

You're very welcome, I'm glad the tutorials are helping! It is a great system (although it needs some TLC), and once you start getting even more complex, tons of doors will open! Lol
I went back to look at that tutorial and the reason those screenshots for Trig/NoTrig aren't there is because I reached my limit for uploading images to one post! LOL
These entries go in TriggerOnCarried/NoTriggerOnCarried properties for the Xmlspawner itself (these are not for an NPC, but they could be used on an NPC), and you are really close! If you have a multi-objective quest, each objective is given a numeric value when you are creating dialog with XmlEdit (No Objectives complete = 0, Objective 1 complete = 1, Objective 2 complete = 2, etc). With the code you have above, the Xmlspawner would trigger IF you had already completed Objective 2, but the other snag is that your NoTriggerOnCarried is preventing the Xmlspawner from triggering. You are telling the Xmlspawner NOT to trigger if a player is carrying the questbook A Simple Quest, or if a player has the quest Attachment at all. So in this case what you want to do is:

TriggerOnCarried =
Code:
A Simple Quest,1
(Note: In the tutorial, we want players to kill the wolf first, and then go find the wolf den, so the player MUST have completed Objective 1.)

NoTriggerOnCarried =
Code:
A Simple Quest,2
(Note: Once players complete the 2nd Objective, we don't want the Xmlspawner to keep triggering, so we stop that by saying "Don't trigger if Objective 2 is complete.")
 
Thanks so much! That was exactly it. Once I got that part right, I was able to complete the rest of the tutorial. I think I can see not only where, but WHY, I messed up once you explained it. So, that does lead to another question here:

If I wanted to do a one off quest (player could only complete it once), I would add an attachment to the player's character during the GIVE (reward) phase, right? So, in the tutorial quest, once completed, if I added an attachment that was called 'A Simple Quest' to the character, and then had the NoTrigOnCarried set as: Attachment,A Simple Quest,XmlAttachment that would prevent that character from doing it a second time, right?
 
Thanks so much! That was exactly it. Once I got that part right, I was able to complete the rest of the tutorial. I think I can see not only where, but WHY, I messed up once you explained it. So, that does lead to another question here:

If I wanted to do a one off quest (player could only complete it once), I would add an attachment to the player's character during the GIVE (reward) phase, right? So, in the tutorial quest, once completed, if I added an attachment that was called 'A Simple Quest' to the character, and then had the NoTrigOnCarried set as: Attachment,A Simple Quest,XmlAttachment that would prevent that character from doing it a second time, right?
Yes and no. Most of the time you can just set the Quest property Repeatable/False in your Action/Give entry. Checking for the attachment first can prevent players from repeating a quest, once they have completed it, and also prevent them from getting more than one questbook at a time. NPCs seem to react properly to attachments on players, but Xmlspawners can be finicky, the syntax changes a bit.
 
Great stuff here. Thanks so much.

Is there anywhere that gives a list of options / command / parameters for the QuestNPC? Id love to see what all commands are out there that I can use to configure it. Just like you stated above that I can set a 'Repeatable/False', but I had no idea that was a command I could issue. So, a list of those would be cool to look at.

Also, if you tag a quest repeatable/false, how does the NPC know not to issue the quest again? I just I'm just curious more than anything.
 
Great stuff here. Thanks so much.

Is there anywhere that gives a list of options / command / parameters for the QuestNPC? Id love to see what all commands are out there that I can use to configure it. Just like you stated above that I can set a 'Repeatable/False', but I had no idea that was a command I could issue. So, a list of those would be cool to look at.

Also, if you tag a quest repeatable/false, how does the NPC know not to issue the quest again? I just I'm just curious more than anything.
The commands are just properties built into the XmlQuestPoints system. When you create a quest and get the questbook, do Props on it and you'll see all the properties you can have.
As for quests marked Repeatable/False, an attachment is added when the quest is complete. It does mean that you have to have the NPC's dialog configured correctly for that to work though (including TriggerOnCarried/NoTriggerOnCarried entries).
 
So, I've managed to put together my own first quest for just testing sake. Basically, you go and mine 10k iron ingots and you are rewarded with a Random 105 Power Scroll (was a tweak of a script someone wrote.) So, I got it work from start to finish, but I do have a few oddities that I'm trying to resolve:

1. I wanted to make it to where you had to have a Pickaxe for the quest to trigger. In the 'TrigOnCarried' method, I'm using 'Pickaxe'. However, I notice that I can get NPC to initially trigger if I'm not even carrying it. What is even more strange is that when I respond with my talktext option, the GUMP will NOT show, if there is any entry in the TrigOnCarried method. The only way I can get the GUMP to show for the quester is to have the TrigOnCarried field blank. Is that right? I would figure if you want the NPC to only intially trigger, having Pickaxe in the TrigOnCarried field would be the only way to get it to work, but that doesn't seem to be working for me. Again, if I leave it blank, the quest works just fine.

2. On Rewardstrings: Is there a way to get it to NOT be in a bag? I thought removing the /@bag option before /ADD would do it, but when I completed the quest, I got nothing. I know about the bug that causes crashes if you use the 'CanSeeReward' option, but if it was just a single item (in this case a deed), isn't there a way that it will show at the bottom for a single item? I must be doing something wrong, cause it is not showing down there even when I set the option to true.

I cannot thank you enough for helping me out on this. This is going to be very useful for our small player shard. Gives me a way for players to have fun and get things that they normally couldn't due to small player base. I really appreciate all your time you've taken to answer (and continue to answer) my questions. Don't think I would have gotten this far without it. :)
 
Please PM me your NPC config file(s), and if you are using custom Xmlspawners for quest objectives, I would need to see those xml files as well
Unfortunately, @bag is part of the RewardString, so removing it will cause the rewardstring to not work at all, even for just one item. It is sort of helpful if you set up random rewards, players can't open the bag to see which reward they are going to get before they do the quest lol
 
Gotcha on the bag. It's a shame that the 'can see reward' option doesn't work. Has anyone ever attempted to try to fix that, or is it just one of those things that you just have to accept it and move on? LOL

I'll shoot you the NPC file when I get a chance. I'll do one that shows it working and one that shows it not working so you'll have something to compare between the two.
 
That's just so strange to me. I remember a vendor script that did the same thing once and someone was able to fix it. I keep believing that there has to be a way to fix that... just I don't have the knowledge to do it. LOL
 
It's a client version issue, as I understand it. Similar issue with the Completely Customizable Vendor script that is out there; trying to use the Classic Gump would result in a client crash, so you had to use the Jewel Gump. I have not taken a look at the issue personally, but I imagine in the situation of one single reward item, including gold, a simple IF/ELSE might work (you would have to use the same parsing that is used to split the rewards 'ADD', If ADD => 2, then use the bag itemID, else if ADD = 1, use that itemID, else use bag itemID, or some such code)
 
if that means anything, it means you tried and so are greater than 100% of the people that didn't try. it also tells you what you didn't do right ;) CS error codes are easy to google, and the MSDN and examples they give, and the many many other help sites. trying is a long way from I wish I knew how to code, it's more like I wish I knew how to not error code now ;)
 
1. I wanted to make it to where you had to have a Pickaxe for the quest to trigger. In the 'TrigOnCarried' method, I'm using 'Pickaxe'. However, I notice that I can get NPC to initially trigger if I'm not even carrying it. What is even more strange is that when I respond with my talktext option, the GUMP will NOT show, if there is any entry in the TrigOnCarried method. The only way I can get the GUMP to show for the quester is to have the TrigOnCarried field blank. Is that right? I would figure if you want the NPC to only intially trigger, having Pickaxe in the TrigOnCarried field would be the only way to get it to work, but that doesn't seem to be working for me. Again, if I leave it blank, the quest works just fine.

Just wondering if you or anyone found the solution to this. This is what i'm working on right now.

thank you :)
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back