1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

siege cannons

Discussion in 'Script Support' started by billy, Jun 14, 2014.

  1. billy
    Offline

    billy New Member

    Joined:
    May 22, 2014
    Messages:
    20
    Likes Received:
    2
    i want to make it were when u connect yourself to the cannons there is a range were u have to be short distance from the cannon. the bug im finding it is were my players are connecting them threw walls and such. anybody got any ideas
     

    Attached Files:

  2. m309
    Offline

    Admin Moderator ServUO Developer

    Joined:
    Mar 3, 2013
    Messages:
    1,243
    Likes Received:
    130
    A simple

    Code (C#):
    1. if (from.InRange(GetWorldLocation(), 1))
    2.             {
    3.                     Do OnDblClick stuff in here.
    4.             }
    Within the OnDoubleClick should work. The "1" means they have to be within 1 tile to click it, you can adjust that to how close you want them to be.
     
  3. billy
    Offline

    billy New Member

    Joined:
    May 22, 2014
    Messages:
    20
    Likes Received:
    2
    its already on click theres no double clicking i tried it but not working

    Code (C#):
    1. public override void OnClick()
    2.   {
    3.   if (from.InRange(GetWorldLocation(), 1))
    4.   {
    5.   this.m_weapon.PlaceWeapon(this.m_from, this.m_from.Location, this.m_from.Map);
    6.   }
    TO

    Code (C#):
    1. public override void OnClick()
    2.             {
    3.               if (this.m_from.InRange(GetWorldLocation(), 1))
    4.                 {
    5.                     this.m_weapon.PlaceWeapon(this.m_from, this.m_from.Location, this.m_from.Map);
    6.                 }
    and i get this
    Code (C#):
    1. Errors:
    2. + Services/XmlSpawner 2/XmlEngines/XmlSiege/SiegeComponent.cs:
    3.     CS0038: Line 316: Cannot access a non-static member of outer type 'Server.It
    4. em' via nested type 'Server.Items.SiegeComponent.SetupEntry'
    5. Scripts: One or more scripts failed to compile or no script files were found.
    6. - Press return to exit, or R to try again.
    7.  
     
    #3 billy, Jun 15, 2014
    Last edited: Jun 15, 2014
  4. billy
    Offline

    billy New Member

    Joined:
    May 22, 2014
    Messages:
    20
    Likes Received:
    2
    thanks to hank this is solved :) thank you hank your the best here is the fix

    Code (C#):
    1. if (weapon.IsDraggable)
    2.                 {
    3.                     // does it support dragging?
    4.                     XmlDrag a = (XmlDrag)XmlAttach.FindAttachment(weapon, typeof(XmlDrag));
    5.                     if (a != null)
    6.                     {
    7.                         // is it currently being dragged?
    8.                         if (a.DraggedBy != null && !a.DraggedBy.Deleted)
    9.                         {
    10.                             list.Add(new ReleaseEntry(from, a));
    11.                         }
    12.                         if (!from.InRange(GetWorldLocation(), 1))
    13.                         {
    14.                             from.SendMessage( "That is too far away to connect to." );
    15.                         }
    16.                         else
    17.                         {
    18.                             list.Add(new ConnectEntry(from, a));
    19.                         }
    20.                     }
    21.                 }
     
Similar Threads: siege cannons
Forum Title Date
Support Spawner that decrease Xmlsiege Hits? Oct 13, 2017
Archived Bug Reports Siege Shame Resurrection problem Oct 2, 2017
Archived Bug Reports Siege Mode houses price Aug 16, 2017
Archived Bug Reports Siege Mode: patched playermobile.cs bugged Aug 6, 2017
Archived Bug Reports Siege Mode - NPC gold in backpack bug Aug 3, 2017
Archived Bug Reports Siege Mode - Fisherman SOS/Treasure map chance (probably bug) Aug 1, 2017
ServUO Discussion Siege Mode: Weakened Blade Spirit and Vortex Jul 30, 2017