spawner/spawning problem
Re: spawner/spawning problem
I think, but I'm not sure, that LoG handles warriors and patrols as different monsters altogether. As LoG's skeletons don't merge into patrols as for example in Dungeon Master, warriors never come into same square with each other (except if you spawn them into one apparently
). Same goes for other type of "swarm" creatures. At least what I've experienced in the game.
Re: spawner/spawning problem
Ok, now that the spawner bug was corrected I could continue modding the place I wanted to be under constant patrol. But lo, the script keeps spawning patrol_1, whenever I step on the pressure plate, even when it finds the monster on the area. And now I'm lost again, what is wrong in my logic? I tested the scrip also in a new dungeon as I doubted that would the script need to include which level it needs to test, but no, it just keeps spawning them even if there's just one level on the dungeon.
Re: spawner/spawning problem
I tested it and I was on level three and it kept spawning no matter what, so I changed a certain "1" to "party.level" and now it works perfectly. Here is my example:
I have the pressure plate connected to a timer with a 5 second delay which is then connected to the script. So every 5 seconds the timer triggers the script to run and do the check. I added the "monster found" console message just for testing
Code: Select all
function checkPatrol1()
if checkForThings("snail",26,29,8,11) then
spawn("snail", party.level, 27, 9, 1)
end
end
function checkForThings(thing,xMin,xMax,yMin,yMax)
for x = xMin,xMax do
for y = yMin,yMax do
for object in entitiesAt(party.level,x,y) do
if object.name == thing then
print("monster found")
return false
end
end
end
end
return true
endFinished Dungeons - complete mods to play
Re: spawner/spawning problem
Ok, the swarms/patrols are still bugged somehow. I tried the script and was dumbfounded when it acted the same way again, it just kept spawning patrol after patrol. I double checked the script. I changed my custom patrol to vanilla patrol with same results. I changed the patrol to skeleton warrior. NOW IT WORKED! O.O I tried again with patrols and again with swarms, and they just kept coming.. So the game handles those patrols/swarms somehow differently, so that the script doesn't recognise them I presume.
Re: spawner/spawning problem
hmm, yeah, it must be that. They are unique things, and you kill them one at a time, so when the script does the search it must be coming back with something else.
Have you tried making the script search for the individuals even as you make it spawn the groups?
Have you tried making the script search for the individuals even as you make it spawn the groups?
Finished Dungeons - complete mods to play
Re: spawner/spawning problem
Yes, that's it! I made my patrols consist of special skeletons and searched for them. Now everything works as they should. Thanks for an advice.
Patrol/Swarm ID problem
..but now I've encountered a different problem concerning patrols. I try to change the AI state of one of the skeleton patrols, but it apparently changes the ID of those things O.o
I've used this script succesfully with other non-patrol/swarm creatures, but with these swarm creatures it gives me an error.
if gives me the message: "attempt to index global 'patrol1' (a nil value) X
so if I understand correctly it sais that there's no creature with that ID, even if those ID:s are correct. Any suggestions?
I've used this script succesfully with other non-patrol/swarm creatures, but with these swarm creatures it gives me an error.
Code: Select all
function relPatrols()
if skelsReleased ~= "true" then
patrols()
end
end
function patrols()
patrol1:setAIState("default")
patrol2:setAIState("default")
patrol3:setAIState("default")
skelsReleased = "true"
end
so if I understand correctly it sais that there's no creature with that ID, even if those ID:s are correct. Any suggestions?
Re: spawner/spawning problem
When the game starts monster groups are processed and converted to individual monsters. So the monster group only exists in the editor. If you know the location of the group you can use entitiesAt and find the members of the group that you are looking for.
Re: spawner/spawning problem
Thank you for the answer. Now that I paid attention, it even shows that on the map when you test the level (4 creatures merging into one). As I'm not yet familiar enough with entitesAt function, I spawn the creatures instead as that works as well in my case.
- SpiderFighter
- Posts: 789
- Joined: Thu Apr 12, 2012 4:15 pm
Re: spawner/spawning problem
Is there a way to call them in a script? I created a special skeletal warrior and then the patrol from those warriors. I then tried to refer to them individiually (as there are no other examples of them in the map, I assumed they were numerical):petri wrote:When the game starts monster groups are processed and converted to individual monsters. So the monster group only exists in the editor. If you know the location of the group you can use entitiesAt and find the members of the group that you are looking for.
SpoilerShow
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
