Full Version : TRIGSKILL command
xmlspawner >>Q&A >>TRIGSKILL command


<< Prev | Next >>

Oberon- 06-01-2006
Hello Arte,
i have a small problem with command TRIGSKILL.
I want detect if a players uses a mining skill and on this base spawn some items.

Players want to dig out a water stream.
I want to detect whether they use mining skill and then spawn items according to the skill.
I tryed to make a spawn, but i dont know a right syntaxe of command TRIGSKILL.

This is my idea:
Subgroup 1: STATIC,8354/NAME/Wait for players/Z/8/VISIBLE/FALSE
Subgroup 2: WAITUNTIL/PLAYERSINRANGE,1>0
Subgroup 3: SETONSPAWN/1/DELETE/MSG/*it seems to be water here!*
Subgroup 3: WHILE/TRIGGSKILL,Mining|120|65|120/4
Subgroup 4: STATIC,6920/Location/(x,z,z)/MSG/*the rock is cracking*
Subgroup 5: WHILE/TRIGGSKILL,Mining|120|65|120/6
..... etc

So i have a problem with invalid property string error in TRIGGSKILL order but I don't know how to set up spawn probability of an item after successful triggering of the skill. I want to setup about 5% probability of spawn static, if a static will not spawn from probability reason i want make step back to TRIGGSKILL command.

Do you have any idea for solution this?

ArteGordon- 06-01-2006
TRIGSKILL allows you to access properties such as base and value, from the triggering skill, like

TRIGSKILL,name to get the name
TRIGSKILL,value to get the current skill value
TRIGSKILL,base to get the base skill value

so you could test for a skill value and spawn something using a test like

IF/TRIGSKILL,value < 120/4

To set up the spawner to trigger on a specific skill , you need to assign the SkillTrigger property on the spawner to that skill

QUOTE

- added spawner triggering on skill use.  By setting the SkillTrigger property to a string of the form "skillname[+/-][,minval,maxval]" the spawner can trigger when the named skill is used and optionally when the skill value falls within the specified range and is either successful (+) or unsuccessful (-).  If +/- is omitted then it will trigger on either success or failure - simply using the skill is enough.  For example, specifying a SkillTrigger string of "Hiding" would trigger the spawner whenever the hiding skill was used within the specified ProximityRange of the spawner, regardless of skill level or whether or not it was successful.  Using "Hiding,+" would trigger whenever the skill was successfully used. "Hiding,50,100" whenever the skill was used and the user had a skill level between 50 and 100 (inclusive).  "Hiding,-,50,100" whenever the skill failed and the user had a skill level between 50 and 100. Note, the skill names are case sensitive.  Several examples of skill triggering are given in xmlextras (skilltrigger1-4.xml).  Skilltrigger3.xml gives an example of how to spawn mobs or give special drops on mining based on skill level.  Skilltrigger4.xml demonstrates triggering on failed hiding. Skilltrigger1 and 2 trigger on musicianship. (Thanks to MarkC777 and Nix4 for the suggestion).

- added the property keyword "TRIGSKILL,name|value|base|cap" that returns information on the triggered skill for use in property testing and property value assignment.  See examples of this in the skilltrigger xml files.



Oberon- 06-01-2006
OK Thank you.
I have another one question.
Is possible use commands AND and OR?

For example:

SET,spawnername1 OR spawnername2 OR spawnername2/Running/True
- Activate one from these three spawners (randomly).

SET,spawnername1 AND spawnername2 AND spawnername2/Running/False
- Deactivate all of these three spawners.

Do you give me some advice?
Thank You.

ArteGordon- 06-01-2006
you can use the RNDSTRLIST function like this

SET,{RNDSTRLIST,spawnername1,spawnername2,spawnername2}/Running/True

and it will substitute one of the strings in the list into the entry at that point.

from xmlspawner2.txt

QUOTE

- added the RNDLIST,int1[,int2,....] and RNDSTRLIST,val1[,val2,....] keywords that can be used to assign values or test properties against randomly selected elements of a list.  The only difference between RNDLIST and RNDSTRLIST, is that RNDLIST can be used in integer value tests and the list elements must be integers while the elements of RNDSTRLIST can by any string.
For example, to spawn a mob and set its hue to one of 4 random values, and name to one of 3 different strings you could use something like

orc/hue/RNDLIST,100,120,300,500/name/RNDSTRLIST,Gomer,Gubgub,Glorm