Question about "spawner"

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Question about "spawner"

Post 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
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Question about "spawner"

Post 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.
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Question about "spawner"

Post by trancelistic »

Thanks for the reply.
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Question about "spawner"

Post 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.
Post Reply