Its buged, when the chests peaces eliminate one of its opponents they just walk around them its bugged. would love a fix ;)
 
Its buged, when the chests peaces eliminate one of its opponents they just walk around them its bugged. would love a fix

Pretty sure your issue is due to having your chess board's z level set to low. Try adjusting the altitude of the board and see if that fixes your issue. I absolutely used to love this old game, Arya really released a pretty nice gem before leaving the community.
 
Whenever I do that and move a pawn he just keeps walking around the board and doesn't let the other player have a turn.
I have it placed in green acres. Does it have to be in Felucca or something?

Thanks
 
ahh ok I see I alwas trying the stairs thinking it would move the whole thing..power just went out so ill have to wait until tomorrow.
 
I'm surprised it was not all one piece, try [area increase 5 see if that works out with the board.
 
I did that and still the same thing. Also, am I supposed to move just the board pieces or the stairs also? I tried both already.
 
I just threw this on my tester, can't test chess pieces with just me but-
when you place the board the z level is at 5 when you increase the board the z level is then at 10- can't walk up the steps. Yes targe one far corner of the chess board with the stairs then go to the opposite corner at the (steps)
 
Oh yes the chessmen are all at the z level of 5 still by the looks of it, I'm not sure if there is an area in the chessboard.cs to change this- maybe some one else will be able to help with that.
 
to me i would think that if the board were not set they would not walk to the location. im thinking, that this has more to do with piece deletion. and the method it uses to capture the piece. even tho it loads without errors.
 
Increase the game stone, it should raise the chess board I believe. Don't start the game until the z level for the board is at the correct height.
 
@Insanity -I don't think that's the problem, the problem is that the NPCs can not move thru the other NPC to reach the waypoint and the game will not delete the captured NPC until the moving NPC has finished the move to the waypoint.

I've been working on solving this problem by allowing the chesspiece to move on top of the other one, but I haven't figured it out yet. I think they base on basecreature but I haven't been able to override the OnMoveOver method nor the CheckShove method so far.

Well crud, it looks like OnMoveOver is already overridden in the ChessMobile.cs - but I still think its something with the NPC not reaching his waypoint.
 
Last edited:
is it possible that this is a region problem? some home work shows that lokia made a update for it to work proper back in the day from 1.0 to rc2. that is the version we have today with that change. however. maybe there is more to the region changes now that the client has changed something that causes both on move and delete issues?? i am not sure im messing with this too and to no avail. before i was using orb 2.3 that i had fixed to run with fork ie servuo but i note that when i released it for publish 54 it was before the big changes to the client. and at that time worked great im guessing we should move this thread to support instead of release so that newer developers dont expect this to work as i have it working out of the gate. i digress sorry for this frustrating release i should have been paying better attention.:oops:
 
So, after 3-4 hours of tracking down the reason that one chess piece can not move over another (To include tracking my way thru related methods in Mobile.cs, BaseCreature, BaseAI, MeleeAI, Movement.cs and probably a few others) I'm convinced that something in the BaseAI is stopping one NPC from moving over another NPC regardless of overriding the OnMoveOver Method. However, I'm tired of tracking this and its probably beyond me. Therefore, I took the easy way out and changed the script to remove the captured chess piece BEFORE it moves the Capturing piece, thus allowing the piece to move to the waypoint and allow play to move on.

That fix took all of 2 seconds and really pissed away my 3-4 hours work, lol. Anyway, the fix works and it is now playable.

Just replace the attached file in your folder and your good to go. @jase giffin you might update the resource with this change after you test.

@Insanity @Voxpire @Tresdni - I would love for someone smarter than me to look at why one NPC can't move over another despite the OnMoveOver method. I think its something in BaseAI in this method:
Code:
public virtual MoveResult DoMoveImpl(Direction d)
        {
            if (m_Mobile.Deleted || m_Mobile.Frozen || m_Mobile.Paralyzed || (m_Mobile.Spell != null && m_Mobile.Spell.IsCasting) ||
                m_Mobile.DisallowAllMoves)
            {
                return MoveResult.BadState;
            }
            else if (!CheckMove())
            {
                return MoveResult.BadState;
            }

            // This makes them always move one step, never any direction changes
            m_Mobile.Direction = d;

            int delay = (int)(TransformMoveDelay(m_Mobile.CurrentSpeed) * 1000);

            m_NextMove += delay;

            if (Core.TickCount - m_NextMove > 0)
            {
                m_NextMove = Core.TickCount;
            }

            m_Mobile.Pushing = false;

            MoveImpl.IgnoreMovableImpassables = (m_Mobile.CanMoveOverObstacles && !m_Mobile.CanDestroyObstacles);

            if ((m_Mobile.Direction & Direction.Mask) != (d & Direction.Mask))
            {
                bool v = m_Mobile.Move(d);

                MoveImpl.IgnoreMovableImpassables = false;
                return (v ? MoveResult.Success : MoveResult.Blocked);
            }
            else if (!m_Mobile.Move(d))
            {
                bool wasPushing = m_Mobile.Pushing;

                bool blocked = true;

                bool canOpenDoors = m_Mobile.CanOpenDoors;
                bool canDestroyObstacles = m_Mobile.CanDestroyObstacles;

                if (canOpenDoors || canDestroyObstacles)
                {
                    m_Mobile.DebugSay("My movement was blocked, I will try to clear some obstacles.");

                    Map map = m_Mobile.Map;

                    if (map != null)
                    {
                        int x = m_Mobile.X, y = m_Mobile.Y;
                        Movement.Movement.Offset(d, ref x, ref y);

                        int destroyables = 0;

                        IPooledEnumerable eable = map.GetItemsInRange(new Point3D(x, y, m_Mobile.Location.Z), 1);

                        foreach (Item item in eable)
                        {
                            if (canOpenDoors && item is BaseDoor && (item.Z + item.ItemData.Height) > m_Mobile.Z &&
                                (m_Mobile.Z + 16) > item.Z)
                            {
                                if (item.X != x || item.Y != y)
                                {
                                    continue;
                                }

                                BaseDoor door = (BaseDoor)item;

                                if (!door.Locked || !door.UseLocks())
                                {
                                    m_Obstacles.Enqueue(door);
                                }

                                if (!canDestroyObstacles)
                                {
                                    break;
                                }
                            }
                            else if (canDestroyObstacles && item.Movable && item.ItemData.Impassable &&
                                    (item.Z + item.ItemData.Height) > m_Mobile.Z && (m_Mobile.Z + 16) > item.Z)
                            {
                                if (!m_Mobile.InRange(item.GetWorldLocation(), 1))
                                {
                                    continue;
                                }

                                m_Obstacles.Enqueue(item);
                                ++destroyables;
                            }
                        }

                        eable.Free();

                        if (destroyables > 0)
                        {
                            Effects.PlaySound(new Point3D(x, y, m_Mobile.Z), m_Mobile.Map, 0x3B3);
                        }

                        if (m_Obstacles.Count > 0)
                        {
                            blocked = false; // retry movement
                        }

                        while (m_Obstacles.Count > 0)
                        {
                            Item item = m_Obstacles.Dequeue();

                            if (item is BaseDoor)
                            {
                                m_Mobile.DebugSay("Little do they expect, I've learned how to open doors. Didn't they read the script??");
                                m_Mobile.DebugSay("*twist*");

                                ((BaseDoor)item).Use(m_Mobile);
                            }
                            else
                            {
                                m_Mobile.DebugSay("Ugabooga. I'm so big and tough I can destroy it: {0}", item.GetType().Name);

                                if (item is Container)
                                {
                                    Container cont = (Container)item;

                                    for (int i = 0; i < cont.Items.Count; ++i)
                                    {
                                        Item check = cont.Items[i];

                                        if (check.Movable && check.ItemData.Impassable && (item.Z + check.ItemData.Height) > m_Mobile.Z)
                                        {
                                            m_Obstacles.Enqueue(check);
                                        }
                                    }

                                    cont.Destroy();
                                }
                                else
                                {
                                    item.Delete();
                                }
                            }
                        }

                        if (!blocked)
                        {
                            blocked = !m_Mobile.Move(d);
                        }
                    }
                }

                if (blocked)
                {
                    int offset = (Utility.RandomDouble() >= 0.6 ? 1 : -1);

                    for (int i = 0; i < 2; ++i)
                    {
                        m_Mobile.TurnInternal(offset);

                        if (m_Mobile.Move(m_Mobile.Direction))
                        {
                            MoveImpl.IgnoreMovableImpassables = false;
                            return MoveResult.SuccessAutoTurn;
                        }
                    }

                    MoveImpl.IgnoreMovableImpassables = false;
                    return (wasPushing ? MoveResult.BadState : MoveResult.Blocked);
                }
                else
                {
                    MoveImpl.IgnoreMovableImpassables = false;
                    return MoveResult.Success;
                }
            }

            MoveImpl.IgnoreMovableImpassables = false;
            return MoveResult.Success;
        }
 

Attachments

  • BaseChessPiece.cs
    9.6 KB · Views: 20
That fix took all of 2 seconds and really pissed away my 3-4 hours work, lol. Anyway, the fix works and it is now playable.
Just replace the attached file in your folder and your good to go. @jase giffin you might update the resource with this change after you test.

Thank You for this!
I am unable to test it right now as I am changing over back to my desktop finally, When I get it all loaded with everything I will give it a try. Again, thank you for all of your time!
 
Awesome Ravenwolfe you did get it working but what a huge pain trying to figure out the problem! :)
 
Yeah, I don't mind the work, I LOVE trouble shooting, but I hate not getting the answer. I knew I could get around the problem, but I still want to know why.

I did test it several facets using waypoints to force them to walk over each other and none of them would, regardless of the map rules.
 
Yeah, I don't mind the work, I LOVE trouble shooting, but I hate not getting the answer. I knew I could get around the problem, but I still want to know why.
I did test it several facets using waypoints to force them to walk over each other and none of them would, regardless of the map rules.

Your edit worked perfectly!!

Thank You!!
 
@Insanity @Voxpire @Tresdni - I would love for someone smarter than me to look at why one NPC can't move over another despite the OnMoveOver method. I think its something in BaseAI in this method:

Well I'm probably not smarter than you but I might be a bit more determined.

I know you resolved the issue with this script already but I think I finally nailed down the issue with npc trying to walk over another npc. I only did minor test with this using a npc trying to walk to a waypoint that was blocked with another npc already standing on it.

In Scripts\Mobiles\BaseCreature.cs :
Original code:
Code:
public override bool OnMoveOver(Mobile m)
{
    if (m is BaseCreature && !((BaseCreature)m).Controlled)
    {
        return (!Alive || !m.Alive || IsDeadBondedPet || m.IsDeadBondedPet) || (Hidden && IsStaff());
    }

    return base.OnMoveOver(m);
}

Change to this:
Code:
public override bool OnMoveOver(Mobile m)
{
    if (m is BaseCreature && !((BaseCreature)m).Controlled)
    {
        if ((m.Map.Rules & MapRules.FreeMovement) != 0)
            return true;
        return (!Alive || !m.Alive || IsDeadBondedPet || m.IsDeadBondedPet) || (Hidden && IsStaff());
    }

    return base.OnMoveOver(m);
}

In Scripts\Services\Pathing\Movement.cs :
Original code:
Code:
private bool CanMoveOver(Mobile m, Mobile t)
{
    return (!t.Alive || !m.Alive || t.IsDeadBondedPet || m.IsDeadBondedPet) || (t.Hidden && t.IsStaff());
}

Change to this:
Code:
private bool CanMoveOver(Mobile m, Mobile t)
{
    if ((m.Map.Rules & MapRules.FreeMovement) != 0)
        return true;
    return (!t.Alive || !m.Alive || t.IsDeadBondedPet || m.IsDeadBondedPet) || (t.Hidden && t.IsStaff());
}

Haven't done any further test to see if this messes with anything else although it shouldn't. Just bugged me for awhile so I had to solve it :). Not sure if it's a bug in ServUO or OSI works this way and it was intentional.
 
Well the chess system is fixed and I wouldn't change either of those after thinking about why they were in place after posting. You would end up with a ton of mobs all on top of each other and all able to reach you to attack. Both are checked for a npc to move though. Like I said, only did minor test with it and those two calls are the reason why NPC's can't stack on each other no matter the map rules ;)
 
You can't override the CanMoveOver though. That's part of the Movement.cs in scripts which gets called through the Server\Movement.cs. Unless I'm missing something that call isn't part of a mobile.
 
You would do a movement eventhandler sync, and override it in that. But anyways, you are right about where it's coming from, I just advise anyone to always do overrides rather than edit core scripts - I also know you weren't saying to do this, just saying this to be informative is all.
 
I totally agree. I'm not trying to say you are wrong. I'm just trying learn. No clue how to do a movement eventhandler sync. That one goes over my head :).
 
Code:
public static void Initialize()
        {
            EventSink.Movement += new MovementEventHandler(EventSink_Movement);
        }

        private static void EventSink_Movement(MovementEventArgs args)
        {
            Mobile m = args.Mobile;
            //your code that will happen at movement
        }

There are many many eventsinks you can do, and get creative with. Voxpire and I used these methods for much of the achievements system we wrote, so there were no core edits at all :)
 
Ok I understand how to use events understand the example you have above. If I catch your drift you are telling me to ignore the CanMoveOver altogether and just use a custom event that fires that forces the npc to move where you want it (that is if all the built in move methods don't use the CanMoveOver call) but I see where you are going with the event route now. I'll have to put some thought into this late tonight when I get some time and see if I can come up with the proper solution now that you shifted my thoughts in the right direction.
 
Back