Full Version : Question about setting up quests
xmlspawner >>Q&A >>Question about setting up quests
<< Prev | Next >>
Galfaroth- 02-01-2006
Okay so simple condition: Rasa == 1 && Oboz == 0
Depends on -1 Text: Witaj Why does it not work?
ArteGordon- 02-01-2006
the conditional operators are
!=<>&|
that is, they are single chars rather than
so the equality test is just = instead of ==, and the inequality test is ! instead of != and the logical AND is & rather than &&
So your Condition test should look like
Rasa = 1 & Oboz = 0
But another question is what are Rasa and Oboz? Are they properties on the triggering player, or on some object or carried item?
Galfaroth- 02-02-2006
They're player properties. (Added by me). So this condition should check if player Rasa = 1 & Oboz = 1 - will it work?
ArteGordon- 02-02-2006
no, you will want to test for them like
GETONTRIGMOB,Rasa=1 & GETONTRIGMOB,Oboz=1
Galfaroth- 02-02-2006
Can I somehow make shortcut for GETONTRIGMOB?
To add timespan attach to player and set it to this time in Action should I: ATTACH/timespawn,Czas SET/ATTACH,Czas/TimeSpan.FromNow or do it somehow different?
ArteGordon- 02-02-2006

QUOTE
Can I somehow make shortcut for GETONTRIGMOB?

no, there are no keyword shortcuts.

QUOTE
To add timespan attach to player

I'm not sure what you want to do here. All attachments can be made time-limited. If you set the Expiration property on them, they will automatically delete themselves after that amount of time.
Many of the attachments allow you to specify that expiration time as an argument when constructing them.
for example. to attach an XmlData attachment to the triggering player that will expire after 30 minutes, use
SETONTRIGMOB/ATTACH/xmldata,MyCustomData,somevalue,30
where MyCustomData is just some arbitrary name that you assign to it, and somevalue is just the string value that will be kept on the attachment.
If you are talking about using the XmlDate attachment to simply add a timestamp with the current date-time to the player, then it would be something like
SETONTRIGMOB/ATTACH/xmldate,MyTimestamp
where MyTimestamp is just some arbitrary name that you assign to the attachment
Galfaroth- 02-02-2006
Is there somewhere list of attach types? (if i want to make attach for 15 days i should change somevalue to days yes? - SETONTRIGMOB/ATTACH/xmldata,MyCustomData,days,15)
ArteGordon- 02-02-2006
you can get a list using the
[availatt
command.
to have it expire in 15 days, you would need to calculate the number of minutes in 15 days
15*60*24=21600
and use that
SETONTRIGMOB/ATTACH/xmldata,MyCustomData,21600
Galfaroth- 02-02-2006
Okay I'm near finish of my quest. Now action: SETONTRIGMOB/ATTACH/<xmlvalue,Ma list,1>/GIVE/<brownbook/name/List z kopalni/itemloot/blessed>
It should add attach (works) and add brownbook to player. I think there is mistake in syntax.
ArteGordon- 02-02-2006
the GIVE keyword is a type keyword which means it has to be at the beginning of an entry just like the SETONTRIGMOB keyword. If these were added to a spawner, they would be in two separate entries like
SETONTRIGMOB/ATTACH/<xmlvalue,Ma list,1>
GIVE/<brownbook/name/List z kopalni/itemloot/blessed>
So you actually have two actions that you want to put into one string, so separate them with a semicolon
SETONTRIGMOB/ATTACH/<xmlvalue,Ma list,1> ; GIVE/<brownbook/name/List z kopalni/itemloot/blessed>
note that you dont actually need to put this in the brackets
<xmlvalue,Ma list,1>
since you arent setting any properties on it like you are on the brownbook. So this would work as well
SETONTRIGMOB/ATTACH/xmlvalue,Ma list,1
But the way you have it will work also work just fine.
Galfaroth- 02-02-2006
And Finally two questions:
1. How to remove attachements in action:SETONTRIGMOB/REMOVE/ATTACHEMENT,xmlvalue, Ma list?
2. How to make condition that if attachement doesn't exist or hasn't value 1 works: GETONTRIGMOB/ATTACHEMENT/xmlvalue,Ma list,! 1 or
! GETONTRIGMOB/ATTACHEMENT/xmlvalue,Ma list,1?
ArteGordon- 02-02-2006
to refer to properties on an attachment that is on some object, use a syntax like this

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 this would be a test for the value property on the xmlvalue attachment named "Ma list" that was attached to the triggering mob having a value of 1
GETONTRIGMOB,[ATTACHMENT,xmlvalue,Ma list,value]=1
This will be false if either the value is not 1, or the attachment is not found, so if you use the NOT operator ~ like this
~GETONTRIGMOB,[ATTACHMENT,xmlvalue,Ma list,value]=1
then this will be true if either the value is not 1, or the attachment is not found
If you use a test for a value that you know will always be true, like
~GETONTRIGMOB,[ATTACHMENT,xmlvalue,Ma list,name="Ma list"
then it will only be true if the attachment is not found. That is probably what you want to use.
To delete attachments, you can set the DoDelete property on them to true.
this is how you generally set properties on existing attachments
from xmlspawner2.txt

QUOTE
- the SET series of keywords (this includes SET, SETONMOB, SETONTRIGMOB, SETONCARRIED, SETONSPAWN) now supports assigning properties on attachments. Whereever a property would normally be specified for those keywords, the new property keyword ATTACHMENT,type,name,property can be used. For example, to set the value property to 34 on an xmlvalue attachment with the name XS on a triggering mob you would specify "SETONTRIGMOB/ATTACHMENT,xmlvalue,XS,value/34" (See attachtest3.xml for examples).
The attachment properties can basically be treated as extensions of the target object's properties.

so in your case
SETONTRIGMOB/ATTACHMENT,xmlvalue,Ma list,dodelete/true
Galfaroth- 02-02-2006
I was going to tell you to make new thread from those questions . Okay backing to 2nd point... It should check if player hasn't attachement Ma list and with value 1. If he hasn't this attachement with value 1 it should trigger the action. It doesn't work as I say. (action is making this attachement (and give sth)) [ It is very good to trigger some things happen only one time (not start quests, but when building bigger quests)].
ArteGordon- 02-02-2006
you used this string as a test?
~GETONTRIGMOB,[ATTACHMENT,xmlvalue,Ma list,value]=1
Galfaroth- 02-03-2006
Here is how my code seems like:

CODE
<NPC> <Name>Sierra</Name> <Running>True</Running> <ProximityRange>3</ProximityRange> <TriggerOnCarried>Proba Cienia</TriggerOnCarried>
<NoTriggerOnCarried>List z Kopalni</NoTriggerOnCarried>
<AllowGhost>False</AllowGhost>
<SpeechPace>10</SpeechPace>
<ResetTime>1</ResetTime>
<SpeechEntries>2</SpeechEntries>
</NPC>
<SpeechEntry>
<EntryNumber>10</EntryNumber>
<ID>10</ID>
<Text>Witaj</Text>
<Action>SETONTRIGMOB/ATTACH/xmlvalue,Ma List,1;GIVE/&lt;brownbook/itemloot/blessed/name/List z kopalni&gt;</Action>
<Condition>~GETONTRIGMOB,[ATTACHMENT,xmlvalue,Ma list,value]=1</Condition>
<DependsOn>-1</DependsOn>
<Pause>1</Pause>
<PrePause>-1</PrePause>
<LockConversation>True</LockConversation>
<AllowNPCTrigger>False</AllowNPCTrigger>
<SpeechStyle>Regular</SpeechStyle>
<SpeechHue>-1</SpeechHue>
<Gump>GUMP,Straznik,4/Bla bla bla.</Gump>
</SpeechEntry>

What I want: If player has no Ma list attachement - add to his pack letter and attach this attachement... (So if he go again nearby, he will not get another letter). I do it by this way, because player can drop his letter or sell to someone and he will not can take it again.