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,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:
    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 Scissors and Siege Ruleset Wednesday at 2:41 PM
Archived Bug Reports Couple of Siege Ruleset bugs Sunday at 12:02 PM
Archived Bug Reports Siege Bless Bug Nov 21, 2017
Archived Bug Reports SiegeShard and Trammel treasure maps Nov 16, 2017
Script Support Public Moongate with destination for a new player only on siege ruleset server Nov 13, 2017
Archived Bug Reports Public moongate with siege ruleset bug Nov 13, 2017
Support Spawner that decrease Xmlsiege Hits? Oct 13, 2017