Register for your free account! | Forgot your password?

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

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

Advertisement



Getting stuck on npc's

Discussion on Getting stuck on npc's within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2006
Posts: 41
Received Thanks: 2
Getting stuck on npc's

Been messing with the impulse 5165 source and when mounted on a steed running around town you seem to get stuck when running near npc's causing screen to reload untill you try move somewhere else, occasionally happens when your close to a map boundary also. Anyone know what might be causing this issue?
hacksaw is offline  
Old 11/15/2013, 18:02   #2
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Check you screen system and how it updates.
Super Aids is offline  
Old 11/15/2013, 20:26   #3
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
For getting stuck on scenery, one of the problems might be that scene files are loaded in upside-down (they were when I reviewed his 5180 private source). With NPCs, it might be that the server is allocating more tiles around that NPC than it actually requires. Another problem with his source was that steeds were programmed incorrectly. They don't have just 8 directions in which they can move in.

Sorry about the quality, the picture is really old when I just started programming. It should be able to at least illustrate why it's 24 directions and how you can change your handler to work with this.
Spirited is offline  
Thanks
1 User
Old 11/16/2013, 00:46   #4
 
elite*gold: 0
Join Date: Feb 2006
Posts: 41
Received Thanks: 2
Thanks diddnt know about those 3 things, You were right scene and steed directions were incorrect, Have sorted the 2 out but it hasent made a difference, The space allocated round an npc seems to be just 1 space all round them which is correct i think? Uploaded a small video showing both town npc sticking and then map boundary sticking.

hacksaw is offline  
Old 11/16/2013, 02:26   #5
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
Seeing your video now, I see that you're using the horse to walk around the NPCs. Your horse walking calculations are still wrong. What exactly are these fixes you made?
Spirited is offline  
Thanks
1 User
Old 11/16/2013, 17:17   #6
 
elite*gold: 0
Join Date: Feb 2006
Posts: 41
Received Thanks: 2
Thanks Fang you were right, I re-looked over the fixes id made and noticed id missed something out, Works fine now.

For anyone else who needs help with it in future here is what i did:

In packethandler under ground movement i changed it to this:

Code:
if (groundMovement.GroundMovementType == GroundMovement.Steed)
    client.Entity.MoveSteed(groundMovement.Direction);
 else 
    client.Entity.Move(groundMovement.Direction);

And in Entity, Changed Move changed to this:

Code:
        public static sbyte[] XDir = new sbyte[] { 0, -1, -1, -1, 0, 1, 1, 1 };
        public static sbyte[] YDir = new sbyte[] { 1, 1, 0, -1, -1, -1, 0, 1 };
        public static sbyte[] XDirSteed = new sbyte[] { 0, -2, -2, -2, 0, 2, 2, 2, -1, -2, -2, -1, 1, 2, 2, 1, -1, -2, -2, -1, 1, 2, 2, 1 };
        public static sbyte[] YDirSteed = new sbyte[] { 2, 2, 0, -2, -2, -2, 0, 2, 2, 1, -1, -2, -2, -1, 1, 2, 2, 1, -1, -2, -2, -1, 1, 2 };


        public bool MoveSteed(Enums.ConquerAngle Direction)
        {
            ushort _X = X, _Y = Y;

            int dir = ((int)Direction) % XDirSteed.Length;
            Facing = Direction;
            sbyte xi = XDirSteed[dir], yi = YDirSteed[dir];
            _X = (ushort)(X + xi);
            _Y = (ushort)(Y + yi);

            Game.Map Map = null;

            if (ServerBase.Kernel.Maps.TryGetValue(MapID, out Map))
            {
                if (Map.Floor[_X, _Y, MapObjType])
                {
                    if (MapObjType == MapObjectType.Monster)
                    {
                        Map.Floor[_X, _Y, MapObjType] = false;
                        Map.Floor[X, Y, MapObjType] = true;
                    }
                    X = _X;
                    Y = _Y;
                    return true;
                }
                else
                {
                    if (Mode == Enums.Mode.None)
                    {
                        if (EntityFlag != EntityFlag.Monster)
                            Teleport(MapID, X, Y);
                        else
                            return false;
                    }
                }
            }
            else
            {
                if (EntityFlag != EntityFlag.Monster)
                    Teleport(MapID, X, Y);
                else
                    return false;
            }
            return true;
        }



        public bool Move(Enums.ConquerAngle Direction)
        {
            ushort _X = X, _Y = Y;
            Facing = Direction;
            int dir = ((int)Direction) % XDir.Length;
            sbyte xi = XDir[dir], yi = YDir[dir];
            _X = (ushort)(X + xi);
            _Y = (ushort)(Y + yi);
            Game.Map Map = null;
            if (ServerBase.Kernel.Maps.TryGetValue(MapID, out Map))
            {
                var objType = MapObjType;
                if (Map.Floor[_X, _Y, objType])
                {
                    if (objType == MapObjectType.Monster)
                    {
                        Map.Floor[_X, _Y, MapObjType] = false;
                        Map.Floor[X, Y, MapObjType] = true;
                    }
                    X = _X;
                    Y = _Y;
                    return true;
                }
                else
                {
                    if (Mode == Enums.Mode.None)
                        if (EntityFlag != EntityFlag.Monster)
                            Teleport(MapID, X, Y);
                        else
                            return false;
                    return false;
                }
            }
            else
            {
                if (EntityFlag != EntityFlag.Monster)
                    Teleport(MapID, X, Y);
                else
                    return false;
            }
            return true;
        }
And in GroundMovement under gamepackets change the directon packet to:

Code:
 public Game.Enums.ConquerAngle Direction
 {
     get { return (Game.Enums.ConquerAngle)(Buffer[4] % 24); }
     set { Buffer[4] = (byte)value; }
}
hacksaw is offline  
Old 11/16/2013, 19:53   #7
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
It's not perfect, but it should fix those errors to some extent. Good job.
Spirited is offline  
Reply


Similar Threads Similar Threads
lag und stuck
10/24/2013 - League of Legends - 5 Replies
hallo, hatte schonmal ein ähnliches problem fand aber dafür auch keine lösung. manchmal schoss mein ping einfach so in die höhe. momentan habe ich seit ca 3 tagen das problem das mein ping auf 200-500 schießt und ich mich dann nichtmal mehr bewegen kann wen ich wegklicke, laufe deshalb manchmal im early in den tower oder direkt in den gegner rein und kann nur zuschauen wie ich sterbe. sage meinem team dann zwar das ich nicht dafür kann das ich lags habe aber dann kommen nur kommentare wie...
stuck!
02/16/2010 - Dekaron Private Server - 4 Replies
iv relli looked everywhere for a solution but... its just not there. my launcher updates connects fine, but wen i hit start nothin happens if i launch my game from the dekaron.exe in my bin folder it launches just fine and i can login. help? iv tried everything i can with no solution anyone solved this before? :confused::confused::confused::confused::confused:
ehh im stuck
01/16/2010 - Cabal Private Server - 1 Replies
anyone know why i get error when i try to attach cheat engine?
Stuck bug
05/31/2009 - Dekaron - 0 Replies
Do you know any reason making your char stucked? or just what to do to make game crash?(tried delete some files while playing but wont work)
I Got stuck on this=/
05/01/2009 - CO2 Private Server - 3 Replies
Hello guys, well since i got back to lotf because there is nothing to do with binaries and they get boring with the time, well i thought i was gonna try lotf again. But everytime i open the console i get this: System.OverflowException: Valor demasiado grande o demasiado pequeño para un byt e sin firmar. en System.Convert.ToByte(UInt32 value) en COServer_Project.NPCs.SpawnAllNPCs() en C:\Documents and Settings\Administ rador\Escritorio\DropDead Source\DropDead Source...



All times are GMT +1. The time now is 16:09.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.