Is there a way to set what sides of a house foundation are passable, or the facing direction? Where would that code be kept? I've tried digging in the house-related multi scripts, but no luck so far. I'm using publish 57.
 
yea you add stairs and a pavers then you go in. if you could make a deed possibly from morphing some other addon deed you could make it so players can place it themselves.
 
Hey thanks for replying! Do you mean to the side of the foundation? because that only works on the southern/southeast sides, I'm hoping to open up the back of the foundation as well. I'm probably explaining it weird lol.
 
1607269784684.png
Post automatically merged:

example of a script that was modded should be working:
using System;

namespace Server.Items
{
    public class TableWithBlueClothAddon2 : BaseAddon
    {
        [Constructable]
        public TableWithBlueClothAddon2()
            : base()
        {
            AddComponent(new LocalizedAddonComponent(1865, 1076791), -2, 0, -5);
                    AddComponent(new LocalizedAddonComponent(1312, 1076791), -1, 0, 0);
        }

        public TableWithBlueClothAddon2(Serial serial)
            : base(serial)
        {
        }

        public override BaseAddonDeed Deed
        {
            get
            {
                return new TableWithBlueClothDeed2();
            }
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.WriteEncodedInt(0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();
        }
    }

    public class TableWithBlueClothDeed2 : BaseAddonDeed
    {
        [Constructable]
        public TableWithBlueClothDeed2()
            : base()
        {
            this.LootType = LootType.Blessed;
        }

        public TableWithBlueClothDeed2(Serial serial)
            : base(serial)
        {
        }

        public override BaseAddon Addon
        {
            get
            {
                return new TableWithBlueClothAddon2();
            }
        }
        public override int LabelNumber
        {
            get
            {
                return 1076276;
            }
        }// Table With A Blue Tablecloth
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.WriteEncodedInt(0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();
        }
    }
}

You will need to clean it up and what not... Also you will need to modify baseaddon to allow things to go off the side of the house.
Post automatically merged:

Try replacing the code in BaseAddon with this...
C#:
        public virtual AddonFitResult CouldFit(IPoint3D p, Map map, Mobile from, ref BaseHouse house)
        {
            if (Deleted)
                return AddonFitResult.Blocked;

            foreach (var c in m_Components)
            {
                var p3D = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z);

                if (!map.CanFit(p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, (c.Z == 0)))
                    return AddonFitResult.Valid;
                if (!CheckHouse(from, p3D, map, c.ItemData.Height, ref house))
                    return AddonFitResult.Valid;

                if (c.NeedsWall)
                {
                    var wall = c.WallPosition;

                    if (!IsWall(p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map))
                        return AddonFitResult.Valid;
                }
            }

            if (house != null)
            {
                var doors = house.Doors;

                for (var i = 0; i < doors.Count; ++i)
                {
                    var door = doors[i] as BaseDoor;

                    var doorLoc = door.GetWorldLocation();
                    var doorHeight = door.ItemData.CalcHeight;

                    foreach (var c in m_Components)
                    {
                        var addonLoc = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z);
                        var addonHeight = c.ItemData.CalcHeight;

                        if (Utility.InRange(doorLoc, addonLoc, 1) && (addonLoc.Z == doorLoc.Z ||
                                                                      ((addonLoc.Z + addonHeight) > doorLoc.Z && (doorLoc.Z + doorHeight) > addonLoc.Z)))
                            return AddonFitResult.Valid;
                    }
                }
            }
 
Last edited:
i was digging through the house-related files and the answer was in BaseAddOn all along ?! good lord I'm glad I asked, that would never have occurred to me. I'll have to take a look at this, thanks a lot!
 
C#:
                var p3D = new Point3D(p.X, p.Y, p.Z);
               
                if (!map.CanFit(p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true))
                    return AddonFitResult.Blocked;
                if (!CheckHouse(from, p3D, map, c.ItemData.Height, ref house))
                    return AddonFitResult.NotInHouse;

I'm pretty sure this will work. Haven't tested though.

So the trick is to think of an item that does something similar and then convert it to your new item... Its really easy that way.
 

Attachments

  • HouseStepsNorth.cs
    1.9 KB · Views: 3
  • HouseStepsWest.cs
    1.9 KB · Views: 2
Hey thanks for replying! Do you mean to the side of the foundation? because that only works on the southern/southeast sides, I'm hoping to open up the back of the foundation as well. I'm probably explaining it weird lol.
I see what youre saying now. There is nothing keeping it visible you have to pass over the front steps to activate the pavers on the west and north sides... There is probably something in the code that we could edit to make it update from like 2 tiles all around the house. I will look into it but for now you can only exit west and north ;/
Post automatically merged:

I tried some stuff in house foundation but it didnt work.... Maybe I didnt compile? Anyways if you try to enter the house on your owner account it works fine but not on a player account... all you need to do is find code and change it to allow players to see too...
Post automatically merged:

line 5233 in PlayerMobile.cs

C#:
            else if (AccessLevel == AccessLevel.Player)
            {
                Region r = item.GetRegion();

                if (r is BaseRegion && !((BaseRegion)r).CanSee(this, item))
                {
                    return false;
                }
            }

change to

C#:
            else if (AccessLevel == AccessLevel.Player)
            {
                Region r = item.GetRegion();

                if (r is BaseRegion && !((BaseRegion)r).CanSee(this, item))
                {
                    return true;
                }
            }

and you can access on west / north now!
 
Last edited:
Back