RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Resource icon

[2.x] Tillerman Gump 2.1

No permission to download

Djeryv

Sorceror
Djeryv submitted a new resource:

Tillerman Gump (version 2.1) - A handy way to steer your ship

I was looking to improve my old Sea Navigator...

http://www.runuo.com/community/threads/sea-navigator-2-0-final.100983/#post-834086

...as I felt the look could be improved along with the actual "steering" part of the gump. I came across the one by Evany by accident...

http://www.runuo.com/community/threads/tillerman-gump.504648/

...and decided to modify their gump as it removed the necessity that mine had to have an item in your pack to use the gump. So almost all...

Read more about this resource...
 

Macil

Sorceror
So, I tried adding this to my ships and I keep getting this error on line 74. I'm pretty sure I did everything according to instructions...

Code:
Errors:
 + Multis/Boats/TillerMan.cs:
    CS0246: Line 74: The type or namespace name 'TillerManGump' could not be fou
nd (are you missing a using directive or an assembly reference?)

Code:
using System;
using Server;
using Server.Multis;
using Server.Network;
 
namespace Server.Items
{
public class TillerMan : Item
{
private BaseBoat m_Boat;
 
public TillerMan( BaseBoat boat ) : base( 0x3E4E )
{
m_Boat = boat;
Movable = false;
}
 
public TillerMan( Serial serial ) : base(serial)
{
}
 
public void SetFacing( Direction dir )
{
switch ( dir )
{
case Direction.South: ItemID = 0x3E4B; break;
case Direction.North: ItemID = 0x3E4E; break;
case Direction.West:  ItemID = 0x3E50; break;
case Direction.East:  ItemID = 0x3E55; break;
}
}
 
public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
 
list.Add( m_Boat.Status );
}
 
public void Say( int number )
{
PublicOverheadMessage( MessageType.Regular, 0x3B2, number );
}
 
public void Say( int number, string args )
{
PublicOverheadMessage( MessageType.Regular, 0x3B2, number, args );
}
 
public override void AddNameProperty( ObjectPropertyList list )
{
if ( m_Boat != null && m_Boat.ShipName != null )
list.Add( 1042884, m_Boat.ShipName ); // the tiller man of the ~1_SHIP_NAME~
else
base.AddNameProperty( list );
}
 
public override void OnSingleClick( Mobile from )
{
if ( m_Boat != null && m_Boat.ShipName != null )
LabelTo( from, 1042884, m_Boat.ShipName ); // the tiller man of the ~1_SHIP_NAME~
else
base.OnSingleClick( from );
}
 
public override void OnDoubleClick( Mobile from )
{
            if ( m_Boat != null )
            {
                if( m_Boat.Owner == from || from.AccessLevel >= AccessLevel.Administrator )
                {
                    if( m_Boat.Contains( from ) )
                    {
                        from.SendGump( new TillerManGump( from, m_Boat, false ) ); //m_Boat.BeginRename( from );
                    }
                    else
                    {
                        m_Boat.BeginDryDock( from );
                    }
                }
                else from.SendLocalizedMessage( 501023 ); // You must be the owner to use this item
            }
}
 
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( dropped is MapItem && m_Boat != null && m_Boat.CanCommand( from ) && m_Boat.Contains( from ) )
{
m_Boat.AssociateMap( (MapItem) dropped );
}
 
return false;
}
 
public override void OnAfterDelete()
{
if ( m_Boat != null )
m_Boat.Delete();
}
 
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
 
writer.Write( (int) 0 );//version
 
writer.Write( m_Boat );
}
 
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
 
int version = reader.ReadInt();
 
switch ( version )
{
case 0:
{
m_Boat = reader.ReadItem() as BaseBoat;
 
if ( m_Boat == null )
Delete();
 
break;
}
}
}
}
}
 

Hammerhand

Knight
hehe... you forgot something alright..

At the top of both "BaseBoat.cs" and "Tillerman.cs", put...

using Server.Gumps;

Thats the reason for the whole "are you missing a using directive" part of the error. :p
 

Macil

Sorceror
Oh, oops! I thought that was only needed at the top of BaseBoat. I didn't see where it said AND TillerMan. Thanks. =)
 

Macil

Sorceror
So, I've had an opportunity to finally actually sit down and USE this script after Hammerhand was kind enough to show me how to get it working XD.

Amazing script! Definitely something that should have came with stock UO several years back. I even find it useful with the new galleons despite them having mouse steering movement. The reason I find it so useful is if you try moving too fast in one direction with the galleons and mouse steering is the ship rotates. So theres no quick way to maintain orientation and still move fast in one direction without rotating the ship accidentally. So bravo on making this, I will get a TON of use out of it!

The map overlay is another amazing plus. Genius!

Lastly though, a quick question. Is there any way to add an additional feature in the step/full speed feature so that the ships can travel half speed (snails pace). This would help further I would think in navigating tight places quickly where you may not want to be flying around too quickly, but one-stepping is a bit too slow for my taste. Just curious. =)

A+ script thus far, thank you so much for this release!
 
Top