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:
    21
    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,255
    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:
    21
    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:
    21
    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
Archived Bug Reports Despise artifacts and Siege Ruleset Jul 15, 2018
Archived Bug Reports Virtue Quest and Siege Mode bug May 31, 2018
Archived Bug Reports Felucca luck bonus and Siege Ruleset Feb 7, 2018
Archived Bug Reports Trammel treasure maps as Siege Shard rewards Jan 13, 2018
Archived Bug Reports Scissors and Siege Ruleset Dec 13, 2017
Archived Bug Reports Couple of Siege Ruleset bugs Dec 10, 2017
Archived Bug Reports Siege Bless Bug Nov 21, 2017