Full Version : Setting Parameters on XML Attachmets...
xmlspawner >>Q&A >>Setting Parameters on XML Attachmets...
<< Prev | Next >>
morganm- 01-07-2007
I've created a simple quest that functions properly. When it's completed it automaticly adds an XML Attachment for 'quest points' to the player mobile. Now when I use my Admin to [getatt and show all of this player mobiles XML attachments I see a lot of properties that are blank or unspecified.
How are these properties specified through a quest? For example I would like to specify the Name, Expires In, and Attached By properties of the XML attachment when the player completes the quest. I really don't want tons of these points attachments staying on player mobiles forever because they Expiration isnt specified. Also would like the Name and Attached By set so when a staff member uses [getatt they can actually understand what those are and where they came from.
Thanks!
ArteGordon- 01-07-2007
how are you adding the attachments? If you are doing it manually using the ATTACH keyword, you would do something like
ATTACH/<xmldata/name/blah/expiresin/60>
which is the general way in which you would set properties on something before adding or attaching it by using the <> grouping brackets.
Also, many attachments accept name and expiration times as arguments to their constructors so like
ATTACH/xmldata,blah,,60
Note that completed quests (with questbooks), are automatically given such an attachment (the xmlquestattachment) when flagged as either non-repeatable, or repeatable with a minimum waiting period (NextRepeatable property).
morganm- 01-07-2007
They are added automaticly when the quest is completed. So when the player completes the final objective, and automaticly gets their reward, a msg displays saying they gained 1 quest point and that's when the XML attachment is added. Then I can [getatt on the player and see the attachment. Just wondering how I can pass it a Name, Expiration, and Attached By via the quest.
ArteGordon- 01-07-2007
the expiration time will be set based on the value of the NextRepeatable property on the questholder.
The Name should be the name of the quest (questholder name) that was completed.
morganm- 01-10-2007
I played with this some more; using the NextRepeatable in the QuestHolder. Basicly I have a <QuestHolder/Name/Extermination/TitleString/Extermination/NoteString/Description of what the quest is/Objective1/KILL,rat,10/Objective2/KILL,giantrat,1/Repeatable/True/NextRepeatable/24:00/Expiration/2/AutoReward/True/RewardString/@Gold,200>
Now when the player completes the quest the server automaticly asigns an XML attachment. However when I /getatt on the player I see the Name is blank and Experiation displays 00:00:00
ArteGordon- 01-10-2007
I think the problem is here
NextRepeatable/24:00
24:00 is not a valid timespan value. You can specify up to 23:59, and then it becomes 1 day, so you would need to specify it as
NextRepeatable/1.00:00
morganm- 01-11-2007
When I fixed that Expiration like you said it works great now! Adds the attachment with proper name and expiration time! Thank you
Now in an XML Dialog I made I have an Action specified: GIVE/PracticeSword;ATTACH/XMLData/Name/Practice Sword Timer/ExpiresIn/6:00
It gives the practice sword to the trigger MOB but does not attach the XMLData. Do I need to specify that it needs to ATTACH on the trigger MOB? I didn't think I did since with GIVE I didn't need to specify the trigger MOB.
What I wanted to do was have the first dialog entry Condition set to : ~GETONTRIGMOB/ATTACHMENT,Practice Sword Timer
So it won't trigger unless the trigger MOB does not have the specified XML attachment.
I tried something else first but it didn't seem to work either. Condition: GETONTRIGMOB/Skills.swords.value<25
So it won't trigger unless trigger MOBs swordsmanship is less than 25. It works fine when I justh ave a single one but I tried to daisy chain 4 together like this the NPC stpos responding to anyone... regardless of skill values on trigger MOB:
GETONTRIGMOB,Skills.swords.value<25;GETONTRIGMOB,Skills.macing.value<25;GETONTRIGMOB,Skills.archery.value<25;GETONTRIGMOB,Skills.fencing.value<25
Basicly what I'm trying to ddo is limit the first dialog entry from triggering if the player either A) has a weapon skill > 25 or has a specified XMLData attachment. So they can't just sit there and get infinate practice weapons.
Thx =^.^=
ArteGordon- 01-11-2007
You need to change this
ATTACH/XMLData/Name/Practice Sword Timer/ExpiresIn/6:00
to this
SETONTRIGMOB/ATTACH/<XMLData/Name/Practice Sword Timer/ExpiresIn/6:00>
The difference between GIVE and ATTACH is that GIVE is a standalone keyword that is designed to work only with the triggering mob, while ATTACH can be used with any object and so requires an object specification to operate on.
The grouping brackets <> are needed to make clear that when you do "/Name/Practice Sword Timer" you want it to apply to the xmldata attachment and not the trigger mod.
The correct syntax for the GETONTRIGMOB keyword is
GETONTRIGMOB,property
so change this
GETONTRIGMOB/Skills.swords.value<25
to
GETONTRIGMOB,Skills.swords.value<25
When referring to attachment properties, use this syntax
from xmlspawner2.txt

QUOTE
- modified the syntax for referencing attachments using the GET series of keywords. Whereever a property would normally be specified for those keywords, the new property keyword [ATTACHMENT,type,name,property] can be used. For example, to read the value property on an xmlvalue attachment with the name XS on a triggering mob you would specify "GETONTRIGMOB,[ATTACHMENT,xmlvalue,XS,value]". The change involved using [] instead of <> for the ATTACHMENT delimiters. This was to resolve a conflict with the use of the old syntax in conditional tests. The example attachtest1.xml has been modified to reflect the change.

so change this
~GETONTRIGMOB/ATTACHMENT,Practice Sword Timer
to something like
~GETONTRIGMOB,[ATTACHMENT,xmldata,Practice Sword Timer,deleted]=false
which will just test for the 'deleted' property on the xmldata attachment which will always be false if the attachment exists. You can test for any known property value on the attachment, like the name, if you like.
You can combine those those tests into one compound conditional test using the & or | operators.
GETONTRIGMOB,Skills.swords.value<25 | ~GETONTRIGMOB,[ATTACHMENT,xmldata,Practice Sword Timer,deleted]=false
would be true if either swords was less than 25 OR they didnt have the xmldata attachment.
morganm- 01-11-2007
Once again you have shown me the light. Thanks again Arte! I'll work on implementing these changes this SAT
I'll try not to bother you again untill atleast SUN! =^.^=