spawner/spawning problem

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: spawner/spawning problem

Post by Komag »

don't forget the () in the function name

Code: Select all

function specialPatrolRemove()
   special_skeleton_warrior_1:destroy()
   special_skeleton_warrior_2:destroy()
   special_skeleton_warrior_2:destroy()
   special_skeleton_warrior_4:destroy()
end
Finished Dungeons - complete mods to play
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: spawner/spawning problem

Post by Neikun »

Ahh typos, how many hairs I've lost to you~
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: spawner/spawning problem

Post by Komag »

if they are the only ones of that type on the entire level, you could do something like: (for level in example)

Code: Select all

function killThem()
  for i in allEntities(1) do
    if i.name == "special_skeleton_warrior" then
       i:destroy()
    end
  end
end
Finished Dungeons - complete mods to play
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: spawner/spawning problem

Post by SpiderFighter »

Komag wrote:don't forget the () in the function name

Code: Select all

function specialPatrolRemove()
   special_skeleton_warrior_1:destroy()
   special_skeleton_warrior_2:destroy()
   special_skeleton_warrior_2:destroy()
   special_skeleton_warrior_4:destroy()
end
Yes, I have that; sorry. Was typing in here too fast. :) It still won't work, because the game doesn't recognize a patrol as a single entity, so there's no way that I can tell to refer to it in a script. Had I known that prior to starting this map, I would have made the focus something else.

I still have to believe there's a way to do it though.
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: spawner/spawning problem

Post by SpiderFighter »

Komag wrote:if they are the only ones of that type on the entire level, you could do something like: (for level in example)

Code: Select all

function killThem()
  for i in allEntities(1) do
    if i.name == "special_skeleton_warrior" then
       i:destroy()
    end
  end
end
Hmm...lemme give that a try. If anything should work, that's it.

[EDIT:]Ok..that was unexpected. It didn't crash this time, but it didn't remove them, either.
[EDIT to my edit:] Hold the phone. The second time it worked. Very strange.
[EDIT ^3] Ok, it seems to be stable now, but it's now telling me that addIten is a nil value, on a line of script that worked before all this craziness started. Something is tweaking this map. I think the assets are all ok but, regardless, you've made me stop ripping my hair out, Komag. Thank you so much.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: spawner/spawning problem

Post by Komag »

hunting down and solving issues is always a big challenge, especially with programming stuff that is so non-physical
Finished Dungeons - complete mods to play
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: spawner/spawning problem

Post by SpiderFighter »

Komag wrote:hunting down and solving issues is always a big challenge, especially with programming stuff that is so non-physical
Yeah, especially when there is no reason for the error. It absolutely will not let me use addItem to any skelly patrol now. I've called it properly, I've spawned other things in the same room using it, I've copied and pasted it from another map I've did...nothing works. Weird, but I've accepted and moved on.

Thanks again for that code; the switch happens so beautifully now, they don't even miss a footstep. :)
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: spawner/spawning problem

Post by Komag »

you are trying to addItem to the patrol? I think you would have to do addItem to each skeleton separately, or is that what you are already trying to do and it's not working?
Finished Dungeons - complete mods to play
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: spawner/spawning problem

Post by SpiderFighter »

Komag wrote:you are trying to addItem to the patrol? I think you would have to do addItem to each skeleton separately, or is that what you are already trying to do and it's not working?
I was going to say it worked perfectly before the switch-off between patrols started to work, but now that I think about it, it may have been a warrior that was holding the key.
Post Reply