Full Version : TrigOnCarried
xmlspawner >>Q&A >>TrigOnCarried


<< Prev | Next >>

Haazen- 05-25-2006
I am new at XMLSpawner so my question may be very uninteligent. Please bare with me.

I [add xmlquestnpc. I have set it to talk and take items from player backpack and give a reward. This all works fine.

What I can't get right is so the npc only talks to players that have a certain item in their backpack. I don't want the NPC talking to everybody that comes close.

The item I am looking for in the backpack is a scripted item Name = "Ugly Stick" class is UglyStick : WildStaff.

I have tried all of the following in TrigOnCarried:
"Ugly Stick, WildStaff"
Ugly Stick, WildStaff
UglyStick
UglyStick, WildStaff
"UglyStick"
and so on

I line 10 Depends -2


Or am I trying to get a GuestNPC to do something it is not intended to do. Does this option, TrigOnCarried only work on spawners?

Thanks for any help.

ArteGordon- 05-26-2006
That is definitely something that the npcs can do. It works the same as it does for spawners.

the syntax for the Trigger/NoTriggerOnCarried string is

name[,type][,EQUIPPED][,objective,objective,...]

so in your case

Ugly Stick,WildStaff

or

Ugly Stick,UglyStick

or just

Ugly Stick

You need to make sure that you spell the name exactly, with the same capitalization. The best way to confirm the name is to do a "[get name" on your item and see what it returns.
Don't add double quotes to the strings since those are not actually part of the string and are just used to indicate the type.
Don't rely on what you see on mouseover since that will capitalize automatically.

from xmlspawner2.txt

QUOTE

- added an option to the TriggerOnCarried and NoTriggerOnCarried strings to allow checking for equipped items only.  The new syntax is

name[,type][,EQUIPPED][,objective,objective,...]

So to test for the longsword named "Balron's Bane" that is not only carried, but also equipped you would use a string like

"Balron's Bane,longsword,EQUIPPED"

When used in the NoTriggerOnCarried, triggering would be prevented if the item was equipped.

Note, if the EQUIPPED option is not specified, then the item will be detected whether it is equipped or carried.


QUOTE

- added support for compound TriggerOnCarried/NoTriggerOnCarried tests using the & and | operators.  This allows testing for multiple carried items.  For example to trigger the spawner when a player is carrying both the platehelm named 'Helm of Light' and the longsword named 'Sword of Light' you could use the following string in the TriggerOnCarried property, "Helm of Light,platehelm & Sword of Light,longsword"


QUOTE

- spawner triggering can be made dependent upon attachments on the triggering mob by using the "ATTACHMENT,name,type" string in the TriggerOnCarried or NoTriggerOnCarried properties.  This will make triggering dependent on attachments on the mob, or an attachment on an item equipped by the mob, or an attachment on an item in the top level of the mobs backpack (see attachtest1.xml for an example).

Haazen- 05-26-2006
Thank you so much for you patience. I had read the items you quoted. And I had done the entries correct except 1 little thing.

I also had a line with Depends -1. Apparently a -1 supercedes a -2. My bad.

I will try to keep stupid questions to a minimum.

Thanks again.

ArteGordon- 05-26-2006
QUOTE (Haazen @ May 26, 2006 05:09 am)
Thank you so much for you patience. I had read the items you quoted. And I had done the entries correct except 1 little thing.

I also had a line with Depends -1. Apparently a -1 supercedes a -2. My bad.

I will try to keep stupid questions to a minimum.

Thanks again.

ah right. It doesnt actually supercede it, but if you have multiple entries that could be activated at a given time, then one will be randomly selected from the list.
Since anything with a DependsOn of -1 will be activated by simple movement and will not be affected by the Trigger/NoTriggerOnCarried settings, it will always be competing with other -1 and -2 entries.