Full Version : Tutorial Links
xmlspawner >>XMLSpawner - Tutorials >>Tutorial Links


<< Prev | Next >>

ArteGordon- 04-23-2006
you need to follow installation step 2 in order to use the KILL and KILLNAMED quest objectives.

from installation 1.0.txt

QUOTE

STEP 2: (recommended but not required)
To take advantage of the XmlQuestToken killtask keywords KILL and KILLNAMED, one line must be added to the OnDeath method in BaseCreature.cs as described below (note, you dont have to make this mod if you dont want to, the spawner and other items will work just fine without it, the KILL and KILLNAMED features simply wont do anything)

around line 3883 of basecreature.cs change

Titles.AwardKarma( ds.m_Mobile, totalKarma, true );

to

Titles.AwardKarma( ds.m_Mobile, totalKarma, true );
// modification to support XmlQuest Killtasks
XmlQuest.RegisterKill( this, ds.m_Mobile);


Vladimir- 04-23-2006
Thank you very much. I'll have to speak to the head admin of the shard to add this in.

Much appreciated smile.gif

Vladimir- 05-04-2006
From the xmlquestnpc tutorial pages I picked up how to use the gumps... so i've been using GUMP,name,4/... for describing the quest etc and GUMP,name,3/ for the last gump where u accept/decline the quest. Where can i find out how to use other gumps and what they look like/offer?

ArteGordon- 05-04-2006
there are examples of all of the gump types in the xmlextras.zip file.

killtask.xml uses a type 0, type 1, and type 3 gump
htmldemo.xml uses a type 4 gump
pickem.xml uses a type 2 gump
gumpdemo.xml uses a type5 gump

harmon.npc uses a type 3, and type 4 gump
simple.npc uses a type 1 gump
keypad.npc uses a type 5 gump

from xmlspawner2.txt

QUOTE

- added the GUMP keyword that will send a gump containing the designated text to the triggering player. Syntax is "GUMP,title,number/text".
A default set of gumps has been added, but these can be extended by the user. A sample script XmlQuestGumps.cs has been included showing the form of the default quest gumps.  It is required to use the default GUMP features.

GUMP number 0 is a simple text display gump. GumpState is set to "done" after viewing.

GUMP number 1  displays a gump with yes/no selections. GumpState is set to either "yes" or "no" depending on the user selection.

GUMP number 2  displays a gump with a text entry area. GumpState is set to the text entered.

GUMP number 3  will send a quest gump with accept or decline options. GumpState is set to either "accept" or "decline" depending on the user input.

The GUMP keyword can also be used to display user gumps with the syntax "GUMP,title,number,gumpconstructor/text".  Gumps must be constructed with argument lists of the form public XmlNewGump( XmlSpawner spawner, string gumptext, string gumptitle, int gumpnumber, BaseXmlSpawner.KeywordTag tag )
From within the usergump methods the spawner GumpState is can be assigned a string value using the GumpState property (e.g. spawner.GumpState = "accept"; )


QUOTE

- added a new multiple-selection gump type (gump type 4) that is accessible via the GUMP keyword. To use this new gump use a GUMP string like this:
GUMP,gumpname,4/maintext ; selection; response ; selection ; response etc.
so a specification like

GUMP,MyGump,4/This is the main text of the gump where you would put your main dialog ; End the dialog ; end ; Continue the dialog ; continue; Go eat some cheese; cheese

would pop up a gump with the main text at the top followed by the three selections
End the dialog
Continue the dialog
Go eat some cheese

Selecting the first would produce the response string "end", the second would give "continue", the third "cheese".
If used in a spawner, the GumpState property would be set to those strings.  If used with an XmlDialog npc, the strings would be processed as speech triggering text that could drive other keyword driven entries.


QUOTE

- added a new GUMP type 5, that allows dynamic ingame configuation of gumps with specifiable buttons, art, labels, and button responses.  The syntax is

GUMP,name,5/width,height ; gumpitem ; response ; gumpitem ; response ...

The width and height will determine the size of the gump.  The name is optional and will not appear anywhere in the gump.
The following gumpitems and their specification syntax are available

"BUTTON,gumpid,x,y"  - will create a button with the specified gumpid art at the x,y location.  Pressing the button will generate the response string that can be used to drive speech entries if used in an xmldialog attachment, or to drive a spawner by setting the GumpState to the response.

"LABEL,x,y,labelstring[,labelcolor]" - will place a label with the specified string and the optional color at the x,y location.

"HTML,x,y,width,height,text" - will place a scrollable html text box with the specified text string and width and height at the x,y location.

"IMAGE,gumpid,x,y[,hue]" - will place the specified gump art at the x,y location with the optional hue

"IMAGETILED,gumpid,x,y,width,height" - will place the specified tiled gump art at the x,y location spanning the width,height area.

"ITEM,itemid,x,y[,hue]" - will place the specified item art at the x,y location with the optional hue

"RADIO,gumpid1,gumpid2,x,y[,initialstate]" - will place a radio button at the x,y location. gumpid1 is the gump art used when selected. gumpid2 is the art used when not selected. The initial state (true/false) of the button can optionally be specified.
The response string associated with a selected radio button will be appended to the response string generated by any button press.

"TEXTENTRY,x,y,width,height[,text][,textcolor]" - will place a text entry gumpitem at the specified x,y location and with the specified width and height with optional textcolor and starting text. Any text entered will be appended to the response string generated by any button press and radio button that might be selected.

For gumpitems that dont generate a response, just specify an empty response, e.g.

LABEL, 100, 50, Hello there ;;
IMAGE, 0x2060, 100, 50 ;;
IMAGETILED, 10460,50,50,100,23 ;;

For the button gumpitem, just specify a response string, e.g.

BUTTON, 2130,50,200 ; okay ;



QUOTE

- added a simple XmlDialog example to test the new [xmledit command.  Just load the example "simple.npc" file to an object using the "[loadnpc simple" command and target a mob or object. Then use the [xmledit command on that object to edit the XmlDialog attachment.


QUOTE

- added an example of the use of the new GUMP type in an xmldialog specification in keypad.npc. Place this file in your default XmlQuestNPC folder. To load up a demonstration, put the keypad.xml file in your default Spawns folder and do an "[xmlloadhere keypad.xml" which will create a sample door and chest with the keypad.npc attachment (hint - the code is 132).
You can also just do "[loadnpc keypad" and target a lockable item, then approach the object as a player.  This will add an xmldialog attachment configured with the keypad.npc file.  To delete the attachment when you are finished, do "[getatt" and target the object again, and select the attachment and then hit the delete button.  To view the attachment you can use "[xmledit" and target the object.

- an example of the use of the new GUMP type in a spawner specification is given in gumpdemo.xml.  Just load it up with "[xmlloadhere gumpdemo.xml".  You need to be a player to trigger it.  It just pops up a dynamically configured gump with the various available elements displayed. 

- added a new quest that uses the new gump type, spawnontrigger feature, and the map item.  It is called draugquest.xml.  You can do an "[xmlloadhere draugquest.xml" to try it out.  Note, you need to have enabled support for skill triggering to run the quest.


QUOTE

- added the htmldemo.xml example that was directly inspired by one of Alari's scripts to display html from a file into a gump.  It makes a type 4 GUMP and displays the contents of a file into it using the GETFROMFILE keyword (you need to have extracted the welcome.txt into your Spawns directory).  The gump pops up when  a player says 'help'.

Slighter- 05-24-2006
I need some help on doing a collect quest. I managed to actually make it work up till the end. Then I get an xmlquestnpc error, gold, 100 property not found.

GIVE/<questholder/name/Collect wool/Find sheep wherever you can and collect their wool./objective1/COLLECT,Wool,10/autoreward/true/rewardstring/@bag/ADD/gold,100

this is the line I use and I don't think its too far off the tutorial. I Can't seem to see what I am doing wrong. Any help would be great.

ArteGordon- 05-24-2006
double check to make sure that the end of the entry looks exactly like this

@bag/ADD/gold,100

in particular, make sure that you have the @ character in there. Also, make sure that the ADD keyword is all capitalized.

If you are still having trouble, you can post the .npc file and I can take a look at it.

Slighter- 05-25-2006
Made sure it was that exactly and still get the error. It's probably something further up but again I am no programmer.

CODE
<?xml version="1.0" standalone="yes"?>
<XmlQuestNPC>
 <NPC>
   <Name>Aretina</Name>
   <Running>True</Running>
   <ProximityRange>3</ProximityRange>
   <NoTriggerOnCarried>Collect Wool</NoTriggerOnCarried>
   <AllowGhost>False</AllowGhost>
   <SpeechPace>10</SpeechPace>
   <ResetTime>0.5</ResetTime>
   <ConfigFile>Aretina</ConfigFile>
   <SpeechEntries>6</SpeechEntries>
 </NPC>
 <SpeechEntry>
   <EntryNumber>0</EntryNumber>
   <ID>0</ID>
   <Pause>1</Pause>
   <PrePause>-1</PrePause>
   <LockConversation>True</LockConversation>
   <AllowNPCTrigger>False</AllowNPCTrigger>
   <SpeechStyle>Regular</SpeechStyle>
   <SpeechHue>-1</SpeechHue>
 </SpeechEntry>
 <SpeechEntry>
   <EntryNumber>10</EntryNumber>
   <ID>10</ID>
   <DependsOn />
   <Pause>1</Pause>
   <PrePause>-1</PrePause>
   <LockConversation>True</LockConversation>
   <AllowNPCTrigger>False</AllowNPCTrigger>
   <SpeechStyle>Regular</SpeechStyle>
   <SpeechHue>-1</SpeechHue>
 </SpeechEntry>
 <SpeechEntry>
   <EntryNumber>20</EntryNumber>
   <ID>20</ID>
   <Text>Have some time to do some work for me?</Text>
   <DependsOn>-1</DependsOn>
   <Pause>1</Pause>
   <PrePause>-1</PrePause>
   <LockConversation>True</LockConversation>
   <AllowNPCTrigger>False</AllowNPCTrigger>
   <SpeechStyle>Regular</SpeechStyle>
   <SpeechHue>-1</SpeechHue>
 </SpeechEntry>
 <SpeechEntry>
   <EntryNumber>30</EntryNumber>
   <ID>30</ID>
   <Keywords>yes</Keywords>
   <DependsOn>10,20</DependsOn>
   <Pause>1</Pause>
   <PrePause>-1</PrePause>
   <LockConversation>True</LockConversation>
   <AllowNPCTrigger>False</AllowNPCTrigger>
   <SpeechStyle>Regular</SpeechStyle>
   <SpeechHue>-1</SpeechHue>
   <Gump>GUMP,Aretina,3/Collect wool from sheep where ever you may find them.</Gump>
 </SpeechEntry>
 <SpeechEntry>
   <EntryNumber>40</EntryNumber>
   <ID>40</ID>
   <Keywords>Accept</Keywords>
   <Action>GIVE/&lt;questholder/name/Collect wool/Find sheep wherever you can and collect their wool./objective1/COLLECT,Wool,10/autoreward/true/rewardstring/@bag/ADD/gold,100</Action>
   <DependsOn>30</DependsOn>
   <Pause>1</Pause>
   <PrePause>-1</PrePause>
   <LockConversation>False</LockConversation>
   <AllowNPCTrigger>False</AllowNPCTrigger>
   <SpeechStyle>Regular</SpeechStyle>
   <SpeechHue>-1</SpeechHue>
 </SpeechEntry>
 <SpeechEntry>
   <EntryNumber>50</EntryNumber>
   <ID>50</ID>
   <DependsOn />
   <Pause>1</Pause>
   <PrePause>-1</PrePause>
   <LockConversation>True</LockConversation>
   <AllowNPCTrigger>False</AllowNPCTrigger>
   <SpeechStyle>Regular</SpeechStyle>
   <SpeechHue>-1</SpeechHue>
 </SpeechEntry>
</XmlQuestNPC>


Thanks in advance.

ArteGordon- 05-25-2006
I'll take a look at it.

(edit)

yep, further up. You left out the 'notestring' property specification when assigning all of your quest text.

QUOTE

GIVE/&lt;questholder/name/Collect wool/notestring/Find sheep wherever you can and collect their

wool./objective1/COLLECT,Wool,10/autoreward/true/rewardstring/@bag/ADD/gold,100


the clue was when you opened up the questholder, there was no quest description as well as no objectives.