Full Version : Adding XMLSiege to baseboat.cs
xmlspawner >>XMLSiege Troubleshooting >>Adding XMLSiege to baseboat.cs
<< Prev | Next >>
penndragon- 06-21-2006
Ok... I have been trying to add the xml siege att to baseboat. I got it to compile fine on basehouse but I must be doing something wrong in baseboat. I get half a mile of compile errors...... Would appreciate any help.
Here is the latest failing attempt.
public virtual BaseDockedBoat DockedBoat{ get{ return null; } }
private static ArrayList m_Instances = new ArrayList();
public static ArrayList Boats{ get{ return m_Instances; } }
public BaseBoat() : base( 0x4000 )
{
// automatically add an xmlsiege attachment to this object
XmlAttach.AttachTo(this, new XmlSiege());
m_DecayTime = DateTime.Now + BoatDecayDelay;
m_TillerMan = new TillerMan( this );
m_Hold = new Hold( this );
m_PPlank = new Plank( this, PlankSide.Port, 0 );
m_SPlank = new Plank( this, PlankSide.Starboard, 0 );
m_PPlank.MoveToWorld( new Point3D( X + PortOffset.X, Y + PortOffset.Y, Z ), Map );
m_SPlank.MoveToWorld( new Point3D( X + StarboardOffset.X, Y + StarboardOffset.Y, Z ), Map );
the edits at 1492
IPooledEnumerable eable = this.Map.GetObjectsInBounds( new Rectangle2D( X + mcl.Min.X, Y + mcl.Min.Y, mcl.Width, mcl.Height ) );
foreach ( object o in eable )
{
if ( o != this && !(o is TillerMan || o is Hold || o is Plank || o is AddonComponent) )
toMove.Add( o );
}
eable.Free();
for ( int i = 0; i < toMove.Count; ++i )
{
object o = toMove[i];
if ( o is Item )
{
Item item = (Item)o;
if ( Contains( item ) && (item.Visible || item is BaseAddon) && item.Z >= Z )
item.Location = new Point3D( item.X + xOffset, item.Y + yOffset, item.Z + zOffset );
}
else if ( o is Mobile )
{
Mobile m = (Mobile)o;
the edits around 1584
foreach ( object o in eable )
{
if ( o is Item )
{
Item item = (Item)o;
if ( item != this && Contains( item ) && (item.Visible || item is BaseAddon) && item.Z >= Z && !(item is TillerMan || item is Hold || item is Plank || item is AddonComponent) )
toMove.Add( item );
// support rotation of siege weapons when turning boats
if (item is BaseSiegeWeapon)
{
((BaseSiegeWeapon)item).Facing = ((int)((BaseSiegeWeapon)item).Facing - ((int)old - (int)facing)/2);
}
}
else if ( o is Mobile && Contains( (Mobile)o ) )
{
toMove.Add( o );
((Mobile)o).Direction = (Direction)((int)((Mobile)o).Direction - (int)old + (int)facing);
}
}
Any help is appreciated.
ArteGordon- 06-21-2006
make sure that you add this to the beginning of the baseboat.cs scripts

CODE
using Server.Engines.XmlSpawner2;

It sounds like you have a syntax error somewhere. I didnt see any problems in what you posted. If you post the entire baseboat.cs I can take a look at it.
ArteGordon- 06-21-2006
hmm. well, I downloaded the baseboat.cs that you posted, and it had no errors. It compiled just fine.
The errors must be coming from something else. Post the errors that you are getting and I can take a look.
penndragon- 06-21-2006
Well....... maybe I dropped or added a character before..... I will give it a try and let you know.... Me and my wife thank you very much..... We love your systems.....
penndragon- 06-21-2006
Well.......... it works....... not sure what I had messed up but it works fine now. Thanks again Arte......