Full Version : Xml Dialog Memory?
xmlspawner >>Q&A >>Xml Dialog Memory?
<< Prev | Next >>
Xerocrates- 10-16-2007
Hi, Is me... ("never stop posting for ONE day? do you have a real life or you is here for give torment to me??")
Sorry, my knowlege on c# is limited....
There is one "temporaney memory" for register a num/string/value until the reset of the dialog?
Like:
Condiction:GETONPARENT,skill,fencing*4=temporaney memory
Action:Setonthis,name/A Guy Whit {temporaney memory} skill fencing
Is only an example, i know that don't need a memory, but is for better explaining (I don't know if I write understable}
I have thinked to create the temporaney memory like an object (model Old-Sphere like) but if is already an "temporaney memory" is better use this
Tnx for any help
ArteGordon- 10-16-2007
you can create temporary variables using the SETVAR and GETVAR keywords.
from xmlspawner2.txt

QUOTE
- added the new keywords "SETVAR,varname" and "GETVAR,varname" which can be used to create your own local variables on a spanwer. These are used in the same way as other SET and GET keywords. These can be useful when you want to use some value repeatedly as in the following example.
1 SETVAR,MyRand/{RND,1,100}
1 SENDMSG/making a hued set with value {GETVAR,MyRand}
1 platelegs/hue/GETVAR,MyRand
1 platehelm/hue/GETVAR,MyRand
1 platechest/hue/GETVAR,MyRand
This creates a local variable named MyRand, and sets the value of it to a random number between 1 and 100. Note that the local variables hold string values so by using the {} substitution delimiters you assign it the results of evaluating the RND,1,100 keyword instead of the string "RND,1,100"
The contents of the MyRand variable are then used to assign the hue property of the various spawned items using the GETVAR keyword.
Local variables are stored as XmlLocalVariable attachments on the spawner and can be viewed and modified using the [getatt command and targeting the spawner.

Xerocrates- 10-16-2007
ah.... so.... "Var" was.... VAR-iabilites
.....
Ehm.. ops... Sorry I've confused with another command...
tnx for the answer
Xerocrates- 10-16-2007
Uhm... another Question...
How to make it Count?
I need to make a Var like this:
SETVAR,AlchemyPlus10/{GETONTRIGMOB,SKILL,alchemy} + {10}
But it can give me one number not text (not 10 + 10 but 20)
tnx For any Help
ArteGordon- 10-17-2007
you should be able to use the INC keyword to do this.
from xmlspawner2.txt

QUOTE
- add the INC and MUL modifiers for values, allowing incremental modification of existing property values instead of just simple assignment. Syntax "propname/INC,value" or "propname/INC,min,max" and "propname/MUL,value" or "propname/MUL,min,max" where the use of the min,max form will use a random value between min and max for the modifiers. This could be used, for example, to take away hit points on a triggering player by using the spawn spec "SETONTRIGMOB/hits/INC,-10". A variant of this would be to set a short min/maxdelay (like 0), turn on proximity detection, and use the spec "SETONTRIGMOB/hits/MUL,0.95". This will work like an area life drain, gradually taking off hits while a player is in range of the spawner. Same could be done for stam or mana etc.
Another application would be to add Karma or Fame as part of a mini-quest, "SETONTRIGMOB/fame/INC,100/karma/INC,100", and perhaps subgroup with "SENDMSG/You have gained some fame and karma"
Note, any of the items included in the support files that can make item property assignments, such as the switches and levers, can also make use of this (and any of the other non-trigger dependent) keyword.

Xerocrates- 10-17-2007
Tnx
ArteGordon- 10-17-2007
Actually, the SETVAR creates a local string variable, so you wont be able to do things like increment the value. You will need to use the XmlValue attachment to create a temporary integer variable instead of a string variable. You would define an action like this
SETONTHIS/ATTACH/xmlvalue,tmpval,20 ; SETONTHIS/ATTACHMENT,xmlvalue,tmpval,value/INC,10
the first action
SETONTHIS/ATTACH/xmlvalue,tmpval,20
would add an xmlvalue attachment named tmpval to the npc and give it a value of 20 (or whatever you wanted).
The second action
SETONTHIS/ATTACHMENT,xmlvalue,tmpval,value/INC,10
would increment the Value property on the attachment by 10.
You are allowed to specify multiple actions to be performed in one Action string by separating them with semicolons.
Note that the SETVAR and GETVAR do not refer to the xmlvalue attachments. It is a completely different thing and a completely different set of attachments. Adding your own xmlvalue attachments basically does the same thing it just involves a little more complicated syntax to access it.
This syntax
ATTACHMENT,xmlvalue,tmpval,value
is how you access properties on attachments, so if you wanted to GET the value that you assigned to the xmlvalue attachment you could do things like
GETONPARENT,[ATTACHMENT,xmlvalue,tmpval,value]

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.