@Tresdni ok I had time to dig a bit deeper into the code. Granted I get what you are saying that it's always best to avoid core edits and I'm not trying to contradict you in any way. I looked into the movement event you posted above and it's not fired unless the movement check I posted above passes in the first place. You would have to override the whole Mobile.Move() in the core method and include all the core code that does all the normal movement check (items, regions, direction, spellcast, ect ect)as that's the only way I see to truly override the problem so an override possible :). That aside, Ravenwolfes fix still seems like the best solution for the problem this system was having but at least we've answered his question as to 'why'.
 
Yes, great stuff here!

I'm still learning ways to get around certain edits, in fact I'm about to post another question in relation to that very topic!
 
@Tresdni ok I had time to dig a bit deeper into the code. Granted I get what you are saying that it's always best to avoid core edits and I'm not trying to contradict you in any way. I looked into the movement event you posted above and it's not fired unless the movement check I posted above passes in the first place. You would have to override the whole Mobile.Move() in the core method and include all the core code that does all the normal movement check (items, regions, direction, spellcast, ect ect)as that's the only way I see to truly override the problem so an override possible . That aside, Ravenwolfes fix still seems like the best solution for the problem this system was having but at least we've answered his question as to 'why'.

You would make the movement after that doesn't pass, in which, the original checks wouldn't be in play anymore. Basically copy that method, let it run once, then run it again using the eventsink handler :)
 
After adding Ravenwolfes fix the pieces now kill each other. But, still one piece cannot walk over another. Case in point. If a knight kills opponents piece he cant walk over an existing living piece to get to the spot where he killed an opponents piece.
 
The problem now seems to lie in the first AI way point of knights movement being under the feet of another mobile. And 2nd aka last waypoint doesn't matter cause A. space is either empty, or B space is an enemy who is killed then empty.
 
Would it be possible to shift the Y axis of this 1st AI way point -1? I believe that would solve the problem.
 
Haven't had a chance to play with it yet, but its only going to work if the chess piece can reach the waypoint without going thru another chess piece.

If I can get some free time, I will try to fix this. My first thought is teleporting chess piece, maybe even a cool effect as part of it.
 
The squares the pieces stand on are 4 tiles. The mobiles only occupy 1 tile. Simply moving the 1st AI way point runes position should allow the knight ample room to move about to the final destination waypoint. If that makes any sense. Anyway just trying to help this is one of my favorite scripts of all time and its broken. I'm just a graphics kinda guy. =P
 
Ok, I think I got it, test this for me please.

In Movement.cs, in the directives, add using Arya.Chess;

Code:
using System;
using System.Collections.Generic;
using Server.Items;
using Server.Mobiles;
using Arya.Chess;

Now, in the CanMoveOver method, change it to this:

Code:
 private bool CanMoveOver(Mobile m, Mobile t)
        {
            return (!t.Alive || !m.Alive || t.IsDeadBondedPet || m.IsDeadBondedPet) || (t.Hidden && t.IsStaff()) || m is ChessMobile || t is ChessMobile;
        }

Credit to @Kalamus for finding the issue in Movement.cs - I just used a type check to work around it.

@Voxpire, @Insanity, @Tresdni - This seems to be why NPC's can not move over each other, even in Trammel. In Mobile.cs, the method CheckMovement calls to the Movement.cs which then determines if a move can be made (it fails when the CanMoveOver method returns false). I could not find a way to override that method since it is not related to Mobiles. Is there anyway to override this from a mobile or will this require a change to Mobile.cs? (the CheckMovement method is not static)

@RoninGT - I know you had noted this same issue before on RunUO forums.

To me this is a major issue since it negates the usefulness of the OnMoveOver Method in Mobile.cs. My code above gets around it, but it seems crazy that we would have to add a type check to CanMoveOver in Movement.cs for each time we need to override.

Or am I missing something?
 
That's the same conclusion I came up with @Ravenwolfe. I couldn't find a way to override it. Tresdni suggested using the Movement event handler but sadly that one is not fired unless the movement check has already passed.

I see why the NPC's are setup that way though no matter what the map rules are. If you have say 30+ monsters trying to attack you, instead of getting surrounded 8 of them you would end up with all 30+ stacked on the same tiles attacking you.

Now it's not gonna be often someone will need to change this behavior for scripts but this was one of them. Without the movement checking being put into the Mobile so you can override them or another event added for OnBeforeMove, I don't see a way around it without adding your checks to the Movement class.
 
That's the same conclusion I came up with @Ravenwolfe. I couldn't find a way to override it. Tresdni suggested using the Movement event handler but sadly that one is not fired unless the movement check has already passed.

I see why the NPC's are setup that way though no matter what the map rules are. If you have say 30+ monsters trying to attack you, instead of getting surrounded 8 of them you would end up with all 30+ stacked on the same tiles attacking you.

Now it's not gonna be often someone will need to change this behavior for scripts but this was one of them. Without the movement checking being put into the Mobile so you can override them or another event added for OnBeforeMove, I don't see a way around it without adding your checks to the Movement class.

Yeah, that's pretty much what I figured, I imagine that's why there were already checks in that method before I edited it, lol.

I'm sure there is some other way but would require a rewrite of the system, and I got other things to do first. I don't like editing distro scripts but at least this will get it working for now.

@jase giffin - might want to update the resource and mention the edit to movement.cs or provide a distro replacement for movement.cs (I doubt many people have an edited Movement.cs). I tested this and the Knight will now walk right thru the other pieces.
 
jase giffin updated -Arya Battle Chess- with a new update entry:

-Arya Battle Chess- Publish 54 Complete

-Battle Chess-Drag and Drop / Movement cs Replacer.

(Install Option 1.)
First go to scripts/services/pathing.
a. Replace movement.cs with the edited.

b. Ravenwolfe Edit-
In Movement.cs, in the directives, add using Arya.Chess;

Code (csharp):



    • using System;
    • using System.Collections.Generic;
    • using Server.Items;
    • using Server.Mobiles;
    ...

Read the rest of this update entry...
 
Tested the new movement.cs changes & Updates. Played a full 2 games with no problems YAY glad this got fixed its one of my top ten favorite scripts of all time TY TY all..
 
*peeks out from under the pages* so it's safe to come out now? I love this script and I'll surely be using it.
Thank you jase giffin, Ravenwolfe, otimpyre, Kalamus and Tresdni
 
If you place this wrong is there anyway to remove the whole board at one time it seems to be dozens of seperate pieces
 
personally I do area remove where <classtype> it's a touch safer and only what you want is removed.
 
using last download and newest SVN,

Certain moves will still bug out. So far the knight will bug out on certain L moves
[doublepost=1462673281][/doublepost]They will not "kill" the old piece like before. If a red needs to move to a white spot it will not stick.
[doublepost=1462685004][/doublepost]Also playing on a flat board. z = 0
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back