Full Version : hidden creature
xmlspawner >>Q&A >>hidden creature
<< Prev | Next >>
Old Dog- 04-18-2007
I am trying to spawn a creature that is hidden and will stay hidden until someone comes in range and the creature targets them and attacks at which time I want the creature to be able to move once again.
This is what I have so far
subgroup 1: orc/CantWalk/true/Hidden/true
subgroup 1: IF/GETONSPAWN,1,Combatant=-null-/10
subgroup 2: SETONSPAWN,1/CantWalk/False
subgroup10: GOTO1
Tried many variations of the IF statement and GOTO combinations but just can't get the orc to move when it targets anyone or it will move shortly after spawning before it goes into conmbat.
Also If you could show how to make it stop walking and hide if its combatant value goes back to null that would be great
Vladimir- 04-19-2007
I don't have access to a server at the moment so I cant test this for myself. Your logic looks good but I would put the IF statement on a completely separate spawner. so then you would have an IF/GETONSPAWN,firstspawnername,1,combatant=(-null-)/10
Just check the property for combatant, I think null has those brackets as well...
Set it up so min and max delay is 0, with a fairly large prox range (30 should be kewl)
Subgroup 2 looks fine, but if CantWalk is giving you hassles use Frozen.
Another way to do this is to use a CONDITION statement which makes it a lot shorter:
#CONDITION,GETONSPAWN,firstspawner,1,combatant!(-null-) ; SETONSPAWN,firstspawner,1/frozen(CantWalk)/false
Combatant!(-null-) meaning he does have a target.
and then you could set up another spawner to hide him again if he is not in combat using the same line just Combatant=(-null-), Frozen/true/hidden/true
Old Dog- 04-19-2007
Thanks for the help Vladimir.
The CONDITION statements on a seperate spawner work great. I was able to put both #CONDITION statements on the same spawner.
Why Is it you cannot put the Condition statements (one for unfreazing and a second to refreaze and hide) on the same spawner as the spawn you want to control?
Vladimir- 04-19-2007
Well because when you do the GOTO/1 you have your mobile in subgroup 1 as well, which means he is then going to respawn everytime, so the process starts again and it doesn't allow him a chance to be unhidden etc.
Old Dog- 04-20-2007
Ahhh
that makes sence. thanks for clearing that up for me.
ArteGordon- 04-20-2007
another thing to consider is that if you did it using the #CONDITION approach and didnt use sequential spawning and just put everything into a single subgroup like
subgroup 1: orc/hidden/true/frozen/true
subgroup 1: #CONDITION,GETONSPAWN,1,combatant!(-null-) ; SETONSPAWN,1/frozen/false/hidden/false
subgroup 1: #CONDITION,GETONSPAWN,1,combatant=(-null-) ; SETONSPAWN,1/frozen/true/hidden/true
the spawner wont spawn a subgroup unless all of the subgroup entries are available to be spawned. So once the orc spawned, then it just wont select that subgroup for spawning (since it can no longer spawn the orc) and so the conditions will not be checked.
You could do it like this
subgroup 1: orc/hidden/true/frozen/true
subgroup 2: #CONDITION,GETONSPAWN,1,combatant!(-null-) ; SETONSPAWN,1/frozen/false/hidden/false
subgroup 2: #CONDITION,GETONSPAWN,1,combatant=(-null-) ; SETONSPAWN,1/frozen/true/hidden/true
which would generally work. The only minor hitch would be when no orc was spawned, the spawner would randomly select between the two available subgroups on each spawner tick and so it is possible that a couple of ticks would go by before it ended up randomly selecting subgroup 1.
After that, only subgroup 2 would be available and so it would work as expected since subgroup 2 would be the only one available and so would be spawned on all subsequent ticks.
Overall, Vlad's suggestions are the way to go.
Old Dog- 04-22-2007
Thanks for the added info ArteGordon, that explains some problems with other spawners I could never get to work right.