Full Version : DeathAction and getting prop off of parent
xmlspawner >>Q&A >>DeathAction and getting prop off of parent
<< Prev | Next >>
Dusk- 10-12-2007
Been trying to get snakes to drop a "skin" in the color of the actual snake but can't figure out the syntax for doing so.
The way I've tried it and which seems right to me is:
/ATTACH/<XMLDeathAction/action/@SETONTHIS/ADD/<static,8444/movable/true/hue/{GETONPARENT,hue}>
This spawns the item, but sets it to hue 0 every time.
I'd appreciate any help.
ArteGordon- 10-13-2007
the problem is that this
{GETONPARENT,hue}
will be substituted immediately when the attachment is added. You need to pass that on as a part of the actual deathaction string. You need to put substitution brackets around each of brackets like this
{{}GETONPARENT,hue{}}
Dusk- 10-13-2007
Thank you, I didn't know about the extra brackets to pass it through.
However, the line
/ATTACH/<XMLDeathAction/action/@SETONTHIS/ADD/<static,8444/movable/true/hue/{{}GETONPARENT,hue{}}>
Still drops the item as hue 0, while the mob itself is in the 2000- range.
ArteGordon- 10-13-2007

QUOTE (Dusk @ October 13, 2007 09:13 am)
Thank you, I didn't know about the extra brackets to pass it through. However, the line /ATTACH/<XMLDeathAction/action/@SETONTHIS/ADD/<static,8444/movable/true/hue/{{}GETONPARENT,hue{}}> Still drops the item as hue 0, while the mob itself is in the 2000- range.

hmm, I think that may be because the parent refers to the corpse and not the mob itself. I'm not sure if the corpse retains the hue of the mob.
(edit)
no, corpse does retain hue of the mob so it should work. I'll check it out.
(edit)
oh, and another little tip, you can change this
static,8444/movable/true/
to this
item,8444
It is the same thing. 'static' is just 'item' with movable set to false.
Dusk- 10-13-2007
That makes that a lot easier, hehe.
But yes, the corpse retains the color. I just spawned a snake with that attachment, and the corpse is hue 2006 and the item itself 0.
Might just have to do a rndlist of the colors instead of matching them.
ArteGordon- 10-13-2007
ah, ok, I figured it out. It has to do with the way that the xmldeathaction attachment handles the reference to the corpse.
THIS is what actually refers to the corpse instead of PARENT. Just as SETONTHIS refers the corpse for setting, adding etc., you would use GETONTHIS to get properties off of it.
So this will work
/ATTACH/<XMLDeathAction/action/@SETONTHIS/ADD/<static,8444/movable/true/hue/{{}GETONTHIS,hue{}}>
Xerocrates- 10-13-2007
Hello, i have a similar problem...
how i can take a propriety by the controlmaster of the Parent?
i must make a condiction then the npc play the action when the command is from his contromaster..
i have made this condiction:
{GETONTRIGMOB,serial}={GETONPARENT,controlmaster/serial}
but it doesn't work... is a syntax problem (i hope) or something other?
(of course, I'm Always sorry for my english... hope your understand)
Bye, tnx for the help
Dusk- 10-13-2007
Wonderful, that worked perfectly.
Thank you for your time.
ArteGordon- 10-13-2007

QUOTE (Xerocrates @ October 13, 2007 12:37 pm)
Hello, i have a similar problem... how i can take a propriety by the controlmaster of the Parent? i must make a condiction then the npc play the action when the command is from his contromaster.. i have made this condiction: {GETONTRIGMOB,serial}={GETONPARENT,controlmaster/serial}
but it doesn't work... is a syntax problem (i hope) or something other?
(of course, I'm Always sorry for my english... hope your understand)
Bye, tnx for the help

try
GETONPARENT,controlmaster.serial
Xerocrates- 10-13-2007
It work *_*
tnx...
ah... sorry another question, where i can find the complete syntax aviable? Maybe whit that i finally stop to post every 3 days for a syntax problem
Tnx tnx tnx
ArteGordon- 10-13-2007

QUOTE (Xerocrates @ October 13, 2007 05:13 pm)
It work *_* tnx... ah... sorry another question, where i can find the complete syntax aviable? Maybe whit that i finally stop to post every 3 days for a syntax problem Tnx tnx tnx

all keyword syntax for things like GETONPARENT can be found in xmlspawner2.txt
Syntax like controlmaster.serial is just standard c# syntax for accessing class properties. Controlmaster is a Mobile and Serial is a property in the Mobile class.
Xerocrates- 10-13-2007
All Right.... i'm a little bit before the madness...
Now, i have made the condiction
{GETONTHIS,controlmaster.serial}={GETONTRIGMOB,serial}
For sure i have make a test to text
TEXT: {GETONTHIS,controlmaster.serial} {GETONTRIGMOB,serial}
The npc Says two numbers (the same sariel of the master/speaker)
But in that damned condiction it doesn't work....
I have try:
{GETONTHIS,controlmaster.serial}={GETONTRIGMOB,serial}
and also
{GETONPARENT,controlmaster.serial}={GETONTRIGMOB,serial}
And another time
{GETONTHIS,controlmaster.name}={GETONTRIGMOB,name}
{GETONPARENT,controlmaster.name}={GETONTRIGMOB,name}
Nothing It doesn't work...
the Xml Grab the Correct props from the controlmaster but for his 0x0001A58B isin't the same of 0x0001A58B
I want to break something *grrr*
Arte? Do you see the error? plz...
Tnx for help and for the patience
ArteGordon- 10-13-2007
those condition tests dont perform a substitition pass by default so you cant use {}
You can do it like this
GETONPARENT,controlmaster.serial=GETONTRIGMOB,serial
I should add substitution support. Maybe in the next release.
Xerocrates- 10-13-2007
Ok.. Now it work....
Tnx Arte
this problem maked me crazy... 2 hours for 2 damned {} *grrr*
Tnx
ArteGordon- 10-13-2007
yeah, there are some inconsistencies in the application of substitution and they can be annoying. I just havent gotten around to fixing them up.