Not to revive old topic but, did you ever get it working? like you mentioned, i rather merge and move on but if not i will attempt it
 
If you are playing on a shard with a small player base there is an easier way to implement a line of sight system that functions exactly like the courageous true line of sight. Simply edit three bools in PlayerMobile.cs. This may create lag on larger shards which is probably why it isn't widely used. Look for the three bools that override the Mobile CanSee bools starting somewhere around line 4000 and add a conditional statement that checks if the item is in sight and to return false if not. For example for the first bool override "public override bool CanSee(object o)" add the following:

if (!InLOS(o)) //LOS
{
return false;
}

Repeat for the next two bools replacing the "o" above with the correct corresponding object references that deal with Mobiles and Items. You may have to add additional conditions that don't block items that are meant to be seen such as doors (if you block all items doors wont be visible until coming into LOS and it looks really weird when you can see the building but not the doors). I am at work and don't have time to look at the complete code I implemented but I hope this helps.
 
Wow that does point me the right direction, I will test this method out to see if it will be acceptable. Thank you :)
 
I think there was one other place I had to add methods called "UpdateScreen" "CleerScreen" as well somewhere in PlayerMobile. I think I did this in the OnMove method somewhere. I can't say, but I will look when I get home.
 
Any further info on these edits, Id love to try this out rather than do the merge with the older LOS system (used it under runuo and had crashing problems)
 
Hi, im testing the ''simple'' LOS that Samuel told us, this is what i added;


Code:
    public override bool CanSee( Mobile m )
        {
            if (m is CharacterStatue)
                ((CharacterStatue)m).OnRequestedAnimation(this);
         

    if ( m is PlayerMobile) //LOS
        {         
    if (!InLOS(m))
{
    ClearScreen();
    InvalidateProperties();
SendEverything();
 
return false;
}   //LOS


        }
     
            return base.CanSee( m );
        }

When a player hides behind a wall the console spam this;


eeee.png

And server freeze.

What eable is it talking about? im lost :D

This is what i found on Map.cs


Code:
        private class PooledEnumerable : IPooledEnumerable, IDisposable
        {
            private IPooledEnumerator m_Enumerator;

            private static Queue<PooledEnumerable> m_InstancePool = new Queue<PooledEnumerable>();
            private static int m_Depth = 0;

            public static PooledEnumerable Instantiate( IPooledEnumerator etor )
            {
                ++m_Depth;

                if ( m_Depth >= 5 )
                    Console.WriteLine( "Warning: Make sure to call .Free() on pooled enumerables." );

                PooledEnumerable e;

                if ( m_InstancePool.Count > 0 )
                {
                    e = m_InstancePool.Dequeue();
                    e.m_Enumerator = etor;
                }
                else
                {
                    e = new PooledEnumerable( etor );
                }

                etor.Enumerable = e;

                return e;
            }
 
Last edited:
Back