Page 1 of 1
Question about "spawner"
Posted: Sun Sep 21, 2014 10:55 pm
by trancelistic
Hey, If I spawn something via a connecter, like a monster. How to know its ID?. Because I need to destroy it later.
if there is no way, then I must spawn the monster with a script to give it a IDname so then I do can :destroy it later?.
But bah, I hope there is a way via the spawner too? ( Like the spawner would check for current ID's and would add nameID_x +1 value.?)
Maybe something for AH to update it later? Sure helps alot of scripting time.
Greetz me
Edit: Meaning: If i place a spawner, and i got 2 snails already in game. So, I got a snail_1 and a snail_2 , so I got 2 snail ID's in game. The dropdown menu of the spawner should then show "snail_3" not just "snail" It would really speed things up<3
Does that make sense? Ofcourse same goes for all the other things that can be spawned.
If the dungeon editor doesn't support this could A.H please update the editor<33333
Re: Question about "spawner"
Posted: Mon Sep 22, 2014 12:00 am
by Isaac
trancelistic wrote:Hey, If I spawn something via a connecter, like a monster. How to know its ID?. Because I need to destroy it later.
if there is no way, then I must spawn the monster with a script to give it a IDname so then I do can :destroy it later?.
One way to do this is to not use a spawner, and to give it a custom ID.
Code: Select all
spawn("snail", 1,1,1,1,"my-custom-snail")
This lets you access the snail later... my-custom-snail:destroy()
Or... if spawning a bunch:
Code: Select all
for x = 1,10 do
spawn("snail", 1,1,1,1,"my-custom-snail_"..x)
end
I don't think that there is a way to use the spawner to set or detect an ID; but... One could contrive a situation to check the cell just after the spawner spawns the monster, and use entitiesAt() to check for a monster in the cell (usually just one), and that would give access to the name. For example, you could place a hidden plate under the spawner (activated only by monsters), that calls a script to check the id of the monster that stepped on the plate, but this method would not work for monsters that fly.
Re: Question about "spawner"
Posted: Sat Oct 04, 2014 12:14 pm
by trancelistic
Thanks for the reply.
Re: Question about "spawner"
Posted: Fri Dec 05, 2014 10:55 pm
by trancelistic
Isaac wrote:trancelistic wrote:Hey, If I spawn something via a connecter, like a monster. How to know its ID?. Because I need to destroy it later.
if there is no way, then I must spawn the monster with a script to give it a IDname so then I do can :destroy it later?.
One way to do this is to not use a spawner, and to give it a custom ID.
Code: Select all
spawn("snail", 1,1,1,1,"my-custom-snail")
This lets you access the snail later... my-custom-snail:destroy()
Or... if spawning a bunch:
Code: Select all
for x = 1,10 do
spawn("snail", 1,1,1,1,"my-custom-snail_"..x)
end
I don't think that there is a way to use the spawner to set or detect an ID; but... One could contrive a situation to check the cell just after the spawner spawns the monster, and use entitiesAt() to check for a monster in the cell (usually just one), and that would give access to the name. For example, you could place a hidden plate under the spawner (activated only by monsters), that calls a script to check the id of the monster that stepped on the plate, but this method would not work for monsters that fly.
You're great with the replies But even with your help I didn't fixed my problem.
Its ok however. I plan to make a normal dungeon anyhows. Nothing to kinky. <3 I've seens post of players who where even stuck in LoG1 not to mentium LoG 2 with its riddels.
thats whY i plan to make a more simple dungeon like in the old days. I hope people will try it 1 day.