![]() |
region NPC's - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: General Help (/Forum-General-Help) +--- Thread: region NPC's (/Thread-region-NPC-s) |
region NPC's - Rattlehead - 07-23-2013 05:45 PM what is the best/easiest way to remove all NPC's in a region? i have came up with a couple ways, but they are really complicated, hoping someone may have a better way. RE: region NPC's - Alaric - 07-23-2013 07:07 PM I would loop through every npc in the world and check whether its in region with uid XYZ. But if you are going to do it often, this may cause lag. RE: region NPC's - Mordaunt - 07-24-2013 01:00 AM This is one of the reasons I have suggested a FOR REGION type function before... c'mon jump on the bandwagon ![]() RE: region NPC's - Rattlehead - 07-24-2013 01:31 AM yeah, definitely dont wanna loop thru every NPC in the world lol, thats even crazier than what ive come up with ![]() a FORREGION?? OH BEN ![]() who do we have to pimp Mordaunt out to, to get a FORREGIONS function, i like that idea ALOT!! RE: region NPC's - Shaklaban - 07-24-2013 01:37 AM (07-23-2013 05:45 PM)Rattlehead Wrote: what is the best/easiest way to remove all NPC's in a region? http://wiki.sphere.torfo.org/index.php/Sectors PHP Code: region.allchars actest RE: region NPC's - Alaric - 07-24-2013 01:51 AM Well, I'm quite confused with the terms now.... region, area, room, sector. This loops through what? The sector or the region(=area or room)? Or couple of sectors... Because the function allchars is on the page - Sectors. Rattle: If you don't have too much complicated area, which I guess you have, then calculate the middle of the area, and the distance from the furthest corner. But if shaklabans code work then there is nothing left to solve or discuss. But I personaly don't understand the code... How can it work. ![]() RE: region NPC's - Ben - 07-24-2013 02:12 AM As far as I can tell, anything that can be done to Sectors, can be done to regions. When applied to regions, it sends the command to all sectors that is part of the region. Yay for one more thing that is not documented!!! RE: region NPC's - Rattlehead - 07-24-2013 02:37 AM its actually a multi region, im creating an instant dungeon type script, where i use a multi i created that gets put into the world to act as the dungeon, i have scripted components that act as one time spawners and everything works great, except if there are left over monster when they reach the end of the dungeon i need those removed with the multi, which is removed when they exit and yes i agree, i was not aware that allchar was a region type fucntion, not sure if sectors apply inside a multi region RE: region NPC's - amonvangrell - 07-24-2013 08:22 AM Rattlehead i would love to have this script of yours once its done... ;] you think u could share it? thx! RE: region NPC's - Rattlehead - 07-24-2013 03:21 PM i would share it, but its part of a huge complex system that pretty much ties into most of all the other things on the server so id have to post most of my server lol but once i have it all done and working right, i can make a tutorial on how i did it, what you need, and basic functions to make it work properly ![]() |