I've set up a simple dialog on an NPC with a yes / no question. Using XmlEdit:


Gump: GUMP, Compassion, 1/The creature is wounded, Spare it?


In XmlSpawner GUMP style 1 gives you a yes or no option. My question is how do I reference the choice?

If the player says yes, I'd like the creature to despawn.

If the player says no, I'd like it to attack the player.

I've been digging through the ultimate xmlspawner documentation, but I can't find and example.
 

Attachments

  • DialogExample.png
    DialogExample.png
    481.1 KB · Views: 47
I tend to stay away from GUMP,1 as I've found it to be too limited and I wind up using GUMP, 4. However, to answer your question, if I recall it's just a Yes or No value you're checking for.
 
Right, I know that there is a yes or no value, but I have not idea how to address it. Could you give me an example?
If not with GUMP #1 then with GUMP #4? I can't seem to find one.
 
This is from an NPC quest I created a few years ago. We're just going to look at the GUMP creation and use of the Keywords though. The gump opens with this code:
Code:
GUMP,Yoda,4/A decision the council has reached. Find a new source of lightsaber crystals you must. Of the Force you must be mindful, lead the way it can. The town of Luna is where you must start at. Continue South along the road you shall. More I cannot say.;Yes master, I understand.;Okay;I'm not ready for this yet.;No

You know what the GUMP,Yoda,4 does already, so I'll skip that, down to where you see the first ;. This is the first response option in the dialog
Code:
;Yes master, I understand.;Okay

The second response option is
Code:
;I'm not ready for this yet.;No

The keywords are Okay and No. So your next entries in the dialog will handle those two response options. When building a dialog using the Gump,4 option, it is always done with this structure: NPC's description or whatever you want the player to know about the situation.;Visible Response 1 visible in the dialog window to the player.;Keyword 1 what the player doesn't see, but is actually the Keyword.;Visible Response 2.;Keyword 2 (see the first image attachment). So like this:
Code:
 NPC.;Visible Response 1.;Keyword 1.;Visible Response 2.;Keyword 2
NOTE: Use punctuation where you need to, just remember that ; are separators between dialog, responses and keywords.

Now the Okay response is being handled, with the proper Action entry. Once the entire Action line has been executed, the dialog is done. So you can set up the No response in a similar fashion, just in most cases there would be no action.

To apply this to your particular case, if the player chose Yes, in the Yes entry, under the Action line, you could simply reset the spawner and keep it turned off. If the player chose No, you could do a couple of different things, but I would change the [props of the creature so that it would attack the player. If you [props the creature and go through everything, you should see what you can change. Alternatively, the original creature could be frozen and immortal. Then upon saying No, despawn that creature by advancing the spawner to the next entry which would be the regular creature with whatever stat reductions (since you mentioned its injured).

If I just confused the Hell out of you, I'll post my walkthrough for Xmlquest creation on here again (seems every time I've posted it, a database conversion happens and the link gets broken).
 

Attachments

  • Yoda1.jpg
    Yoda1.jpg
    232.1 KB · Views: 36
I'll add a screenshot of what I've changed. It's still not working, am I still missing something?

I seem to remember the playermobile saying the words when you select an option, but that's not happening.
 

Attachments

  • Gump2.png
    Gump2.png
    384.1 KB · Views: 18
Remove the spaces in the entry lines. That's the first problem. You have:
Code:
 Gump, Compassion, 4/
That's never going to work with Xml. You should have:
Code:
Gump,Compassion,4/

You have the DependsOn set to -1, that's not going to work. If you enter a -2 both the TrigOnCarried and NoTrigOnCarried fields will be checked prior to the QuestNPC actually triggering. If left blank, or with a value of 0 or 1, the TrigOnCarried and NoTrigOnCarried fields will be IGNORED.

NOTE: This is for the FIRST line entry ONLY. Every other DependsOn field should match with the line where the Keyword comes from. For example: Lets say your first two keyword options are Yes and No and they originate in the dialog from line entry 0 (which you really shouldn't do, skip to Line Entry 10). When you're entering the information for the Line Entry dealing with the Yes response, the DependOns would be 10, since the Yes response originated from Line Entry 10. Also, the No response DependsOn would also be 10, because it originated from Line Entry 10. Does that make sense?

What I usually do when I build a dialog is Line Entry 0 is what happens when a player triggers the mob (or item). I attached the dialog for a quest that is pretty simple and straightforward.

Line 0, Image 1: DependsOn is set to -2 because this particular dialog should ONLY trigger when the TrigOnCarried/NoTrigOnCarried conditions are met. You will also notice that not much is happening, other than a text entry. The text is what the mob says when the player triggers the dialog.

Line 10, Image 2: Notice the DependsOn has changed to 0 because Line 0 MUST happen in order to advance the dialog. The keyword entry is what the player says, out loud in this case, to the mob.

Line 20, Image 3: Once again the DependsOn has changed, but now it says 10, because we want the dialog to flow in a particular order, so Line 10 MUST happen before the dialog will advance to Line 20. This line also contains the actual Gump creation, in this case, Gump,Yoda,4/
NOTE: You would also see that the keywords are created in the Gump line if you opened the line entry book.

Line 30, Image 4: DependsOn has changed to 20 because this is our first Keyword (Okay) usage after the Gump creation. In this case, the Action line is giving a QuestHolder to the player. This is optional really. You don't HAVE to give out a questholder. It could be an item or nothing at all. It IS helpful to give out a questholder, because you can build chain quests much more easily.

Line 40, Image 5: DependsOn is STILL 20 because this is the second Keyword (No) option. You don't have to do anything here, but I usually put something to taunt players with and also to make sure the dialog is actually completing and not getting hung up anywhere.
 

Attachments

  • 1.jpg
    1.jpg
    228.1 KB · Views: 31
  • 2.jpg
    2.jpg
    228.2 KB · Views: 26
  • 3.jpg
    3.jpg
    234.9 KB · Views: 23
  • 4.jpg
    4.jpg
    233.7 KB · Views: 21
  • 5.jpg
    5.jpg
    228.1 KB · Views: 19
Wow! Very in depth! Thanks! As soon as I removed the spaces it started working!

I've got it setup to attack the player by saying No, and even damaging the Lizardman too!

Now the only issue I have is trying to award Compassion for letting it live.

Any Ideas?
 
Yes, Xml has attachments for giving the various Virtue points. In the Rewardstring you have to do this:
Code:
autoreward/true/CanSeeReward/false/attachmentstring/XmlAddKarma,200/rewardstring/@bag/ADD/StabilizingRing/ADD/PowerCell/ADD/LightsaberHilt
Now this is WAY more than you need, but let me break this down for you too, because you can use the structure in the future.
The following means that once said quest is marked as completed, the player is automatically given the reward(s). If set to False, the player must "turn in" the questholder to whatever mob you set up.
Code:
/AutoReward/True

Code:
/CanSeeReward/False
There is a flaw in the Reward viewing. When you try to double-click the bag in the questbook gump, it will freeze your client. So This should ALWAYS be set to False.

Code:
AttachmentString/XmlAddVirtueName,PointValue/
This is where you would add one of the XmlAttachments to give out Virtue Points. Look in the Attachments folder and you'll see all the Virtue attachment scripts. In the above case, we're giving out +200 Karma once the quest is completed. You can have negative values as well, just change it to -200 for example.

Code:
RewardString/@bag/ADD/
This is where you add any items or gold, etc that you want to give the player once the quest has been completed. Each item you want to hand out should be preceded by ADD/
Also note that @bag comes after RewardString/ this gives the rewards in a regular bag (I don't think you can change the container to anything but a regular base container, i.e. bag, backpack, metalchest, etc. So if you have a special container, I don't think you'd be able to use that as the container to hold the rest of the rewards, but give it a try and see.

One more quick piece of info, you can also have Journal Entries added to the Questbook. The journal entries can be hints or specific directions. You would set up the line entry like this:
Code:
/AddJournalEntry/Name of whatever you want (i.e. Tip/Hint, etc):This is a hint that will help you complete the quest./autoreward/true/CanSeeReward/false/attachmentstring/XmlAddKarma,200/rewardstring/@bag/ADD/StabilizingRing/ADD/PowerCell/ADD/LightsaberHilt
 
Last edited:
Thanks, just trying to help :)
A lot of people jumped in the Xmlspawner bandwagon when Arte released it, but very few have been able to find out what the entire system itself can really do (including all the addons and such). Even with what I know and have learned, I'm barely brushing the surface because it's such a robust system. Unfortunately, most of the tutorials are considerably dated (some have steps that don't even work anymore), so I'm glad to help when/where I can. :)
 
Your help is very appreciated!

Looking at your reply, you've got the Virtue Reward setup as a quest reward. Is it possible to just have the XmlDialog add the Virtue
with the action line? I've tried:

ACTION: SETONTRIGMOB/XmlAddCompassion, 10/

but that doesn't seem to work. Do I have to make a quest for autoreward?
 
You would think because that would make sense (I thought the same thing at firs too), but, it's different. In this case you would be setting the Virtue points directly on the player.
Code:
SetOnTrigMob/Virtues.VirtueName,200
I think is the correct path. Check it by using [props on a player and you'll see Virtues, click on it, then you'll see the virtue list. SetOnTrigMob should cover it instead of doing it like you would in a script with PlayerMobile.Virtues.VirtueName/200
 
Just tried:

SETONTRIGMOB/Virtues.Compassion,200/

Matches what I've seen on the playermobile [props. Sadly, still a no go.

I'm wondering if I should just make an Item that grants the Virtue increase, and have it added to the player upon the choice.
Is there a basic Item with OnDoubleClick() that I could script to add the Virtue points?
 
Okay, I dunno what I was thinking lol Sorry, I told you the wrong way. Xmlspawner has an attachment for XmlAddVirtue. Copy that file and rename it to whatever Virtue you want to add (XmlAddCompassion, XmlAddJustice, etc). Then edit the script so everything that says XmlAddVirtue is the name of the Virtue you wish to add. Then you can just do:
Code:
 SETONTRIGMOB/XmlAddCompassion,200
 
Ok, so I was looking at doing all of that and decided to make a deed instead. I found this:

VirtueHelper.Award(mobile, VirtueName.(put Virtue here), amount, ref bool)

With that I made a deed that gives the Compassion Virtue! It's very basic, and I want to make some edits so that I can specify an amout of virtue to give, but this works great for now!

Here is the Deed for anyone who might be interested.

Now, to get the XmlDialog to add it to the player, can I go:

ADD/CompassionDeed/

Will that put it in the players backpack?
 

Attachments

  • CompassionDeed.cs
    1.8 KB · Views: 2
Actually, I just did this and it worked!

Looks like you can put in the action line:

SETONTRIGMOB/ADD/CompassionDeed/

Thank you tass!
 

Attachments

  • Success!.png
    Success!.png
    344.7 KB · Views: 5
Yes, the Actions are executed once that keyword entry line is activated. You can also use the GIVE/ (just like you would for a questholder), which also allows you to GIVE an item to players within a radius.
You'll also notice that you can use Conditions to further GIVE things to specific people (provided they meet the Condition you set up). For example, lets say you wanted to give players with 25,000 Karma a specific weapon. In the the Action would be:
Code:
GIVE/<ThinLongSword/name/Sword of Smiting/hue/1007>,1

And the Condition could be like this:
Code:
 GETONTRIGMOB/Karma > 24999

Of course you'd also have to set up the rest of the dialog for what happens when the Condition is not met, but that's a good start. :)
 
Back