Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 19:20

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Question]NPC Spawning

Discussion on [Question]NPC Spawning within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
stealarcher's Avatar
 
elite*gold: 0
Join Date: Apr 2006
Posts: 231
Received Thanks: 94
[Question]NPC Spawning

Alright, Im completely out of ideas on what to check on this one, just need a few pointers on what to check for. Version im on is 5369. My NPCs are spawning perfectly until i change maps (whether NPC or teleport). As soon as I teleport i see the NPCs in the viewdistance of my teleport location, but if i leave that area, no other NPC appears, but the NPCs within that circle still disappear/appear fine. The packets are being sent at the correct times when they are suppose to be, but when the client receives the packet, nothing appears. The MapID that the server is checking, packets being sent, so im kind of out of ideas. Any tips on what to look for?
stealarcher is offline  
Old 06/14/2011, 13:47   #2
 
{ Angelius }'s Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 991
Received Thanks: 1,107
if you are storing the local npcs in some kind of a dictionary . is it being cleared once you teleport?

the X/Y/Map is it really being changed to the new x/y/map after the teleport ?

is there any try{}catch() around any of the send/spawn void if not are you sure there is no silent Exceptions that is being throwing some how ?

did you split the maps and each map has its own npcs/Clients like(whatever[Client.map].npcs/whatever[Client.map].Clients) if so are you really removing the player from the old map /adding him to the new map ?

idk a lot of things that can be a reason for such thing it might be the spawn packet it self but i cant really tell as long as i dont know the way you coded your spawn system :P
i hope that helps some how
Good luck .
{ Angelius } is offline  
Old 06/14/2011, 16:37   #3
 
stealarcher's Avatar
 
elite*gold: 0
Join Date: Apr 2006
Posts: 231
Received Thanks: 94
Yeah, im sure its hard to give ideas hah, i just dont see exactly what code to paste if any. NPCs are correctly being cleared, X/Y/Map are being changed correctly, and just checked for the silent exception, nothing was displayed :\.
stealarcher is offline  
Old 06/14/2011, 18:27   #4
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
Not actually read the post above, so yah.

...

Breakpoint where it spawns the object, should be something like
[code]
if (!screen.Objects.Contains(NPCid))
{
Spawn
}
else
return;
}
breakpoint "if (!screen.Objects.Contains(NPCid))", Check what Objects contains and see if its not removing the npc correctly, I had that too,
_DreadNought_ is offline  
Old 06/14/2011, 18:37   #5
 
stealarcher's Avatar
 
elite*gold: 0
Join Date: Apr 2006
Posts: 231
Received Thanks: 94
I have this:

Code:
           lock (screenObjects){
               IScreenObject[] objects = new IScreenObject[screenObjects.Values.Count];
               screenObjects.Values.CopyTo(objects, 0);

               foreach (IScreenObject screenObj in objects){
                   if (SimplicityCore.Calculations.Distance(screenObj.currentPosition, currentPosition) >= LinearMap.ViewDistance)
                       screenObjects.Remove(screenObj.Entity_ID);
                   }
               }
The screen objects contains the values thats on the screen, I have even tried removing them after every jump, the NPCs that spawn spam constantly, (re-appear very fast), but no new NPCs appear. And if im right, the server wouldnt send the packets if they werent removed correctly :s.
stealarcher is offline  
Reply


Similar Threads Similar Threads
[Question] Spawning Problems
08/03/2010 - CO2 Private Server - 10 Replies
Hey everyone! My source is looking great thanks to you all! So far, these are the errors: General Packet Problem Character Spawning Problem Status Packet Fixed (with help from you all!) Unknown Problem with Walking, Jumping, and Spawning
[Question] Spawning Special Monsters (5165)
03/01/2010 - CO2 Private Server - 3 Replies
Hey everyone! I'm developing a certain quest and I need to know: What is the code that would allow me to say "spawn a monster" in a certain location using commands? OOps, wrong section.
[Question] Spawning Special Monsters (5165)
03/01/2010 - CO2 Private Server - 5 Replies
How would I make a monster spawn on GM command? I tried the command that is in the source but either I don't know how to use it or it's broken. My goal is to get it so that a monster spawns at a certain time (every 45 minutes - but I know the time codes) in Twin City Gardens. I'm looking for codes in the source on how to do it but if anyone's faster than I am then please leave a comment =P Thanks.
My first Question about spawning Pets.
12/27/2009 - SRO Private Server - 1 Replies
Hello all, I wanted to ask how i can spawn 3 grab pets? I showed some videos in Youtube,but I only success at spawning 2 pets and not 3! Could someone explain how i do spawn 3 Pets? THX



All times are GMT +2. The time now is 19:20.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.