System Knive's Town Houses 2.1 - Majorly Cleaned Up 2014-11-29

Optimized for .NET 4.0

  1. Tresdni

    Tresdni Illustrious Member JustUO Developer

    Tresdni submitted a new resource:

    Knive's Town Houses 2.1 - Majorly Cleaned Up - Optimized for .NET 4.0

    Read more about this resource...
     
    Last edited: Nov 29, 2014
    • Winner Winner x 4
    • Like Like x 3
  2. Dragon Slayer

    Dragon Slayer Grandmaster Member

    awesome job :) I use this system glad to see it cleaned up.. you should update knives chat system it uses the old email method
     
  3. Tasanar

    Tasanar Super Contributor

    What exactly does Linq do?
     
  4. Dragon Slayer

    Dragon Slayer Grandmaster Member

  5. Tresdni

    Tresdni Illustrious Member JustUO Developer

    It lets you perform queries on lists and arrays, and other data. It looks similar to SQL queries.
     
  6. Tresdni

    Tresdni Illustrious Member JustUO Developer

    Hmm, more specifically? I can fix it up :)
     
  7. Tasanar

    Tasanar Super Contributor

    Ah ok so ill be rough to convert RunUO to use it in just this instance?
     
  8. Tresdni

    Tresdni Illustrious Member JustUO Developer

    I'm guessing you replaced the old one that was already serialized with this one? This isn't a direct replacement, since there were arrays serialized, I had to change the serialize/deserialize method on some as lists.
     
  9. Tresdni

    Tresdni Illustrious Member JustUO Developer

    You don't have to update RunUO at all to use Linq, it's built into .NET 4.0.
     
  10. Tasanar

    Tasanar Super Contributor

    Ah ok I have tried in the past to take a few scripts from here but I got errors with the RunUO.exe in response to Linq
     
  11. Dragon Slayer

    Dragon Slayer Grandmaster Member

    well I just started a my test server fresh I droped it in and I found out where it was missing

    in your
    RUOverison.cs was missing them at the end

    Code:
            public override void Serialize(GenericWriter writer)
            {
                base.Serialize(writer);
            }
    
            public override void Deserialize(GenericReader reader)
            {
                base.Deserialize(reader);
            }
     
  12. Tresdni

    Tresdni Illustrious Member JustUO Developer

    Works fine on mine, those are redundant, they are just calling base methods.
     
  13. Dragon Slayer

    Dragon Slayer Grandmaster Member

    well server was compiling just seen the warnings lol
     
  14. Dragon Slayer

    Dragon Slayer Grandmaster Member

    I think its safe for you to remove support for old runuo as this just going to support JustUO any way right? I been doing that to old scripts that still have support for old versions... I just removed them just to be working with justuo
     
  15. Tresdni

    Tresdni Illustrious Member JustUO Developer

    I did remove most of the support, may have missed a few though, it's a lot of code :p
     
  16. Tresdni

    Tresdni Illustrious Member JustUO Developer

    • Funny Funny x 1
  17. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    does this require houses to be frozen ?
    or can you just build a house by hand and make it a town house? ( i'm guessing this system creates a rectangle and zones it as a house area that then recognizes house commands )
     
  18. Tresdni

    Tresdni Illustrious Member JustUO Developer

    It is mostly for static buildings that aren't being used, but I've also used it with addons and it worked just fine. I wouldn't build a house piece by piece, it would add up to major lag down the road.
     
    • Agree Agree x 1
  19. Dian

    Dian Administrator

    This system pretty well works off of the region you create for it. It doesnt care what building is or is not within the boundary's or how they are built/placed :)

    One thing though, make sure you have any doors (etc) placed prior to creating the house region, so they are recognized as house doors. If you add them afterwards, they will not have the security setting ability and what not.
     
  20. jamesreg1973

    jamesreg1973 Illustrious Member

    I have a question just to make sure I am right on this.

    On the edit to base house it says to replace this method with this code
    Code:
    public virtual bool IsInside( Point3D p, int height )
            {
                Sector sector = Map.GetSector( p );
    
                foreach( BaseMulti m in sector.Multis )
                {
                    if ( m != this
                    && m is Knives.TownHouses.TownHouse
                    && ((Knives.TownHouses.TownHouse)m).ForSaleSign is Knives.TownHouses.RentalContract
                    && ((Knives.TownHouses.TownHouse)m).IsInside( p, height ) )
                        return false;
                }
    
                return Region.Contains( p );
            }
    This is what my method looks like in my househouse.cs

    Code:
     public virtual bool IsInside(Point3D p, int height)
            {
                if (this.Deleted)
                    return false;
    
                MultiComponentList mcl = this.Components;
    
                int x = p.X - (this.X + mcl.Min.X);
                int y = p.Y - (this.Y + mcl.Min.Y);
    
                if (x < 0 || x >= mcl.Width || y < 0 || y >= mcl.Height)
                    return false;
    
                if (this is HouseFoundation && y < (mcl.Height - 1) && p.Z >= this.Z)
                    return true;
    
                StaticTile[] tiles = mcl.Tiles[x][y];
    
                for (int j = 0; j < tiles.Length; ++j)
                {
                    StaticTile tile = tiles[j];
                    int id = tile.ID & TileData.MaxItemValue;
                    ItemData data = TileData.ItemTable[id];
    
                    // Slanted roofs do not count; they overhang blocking south and east sides of the multi
                    if ((data.Flags & TileFlag.Roof) != 0)
                        continue;
    
                    // Signs and signposts are not considered part of the multi
                    if ((id >= 0xB95 && id <= 0xC0E) || (id >= 0xC43 && id <= 0xC44))
                        continue;
    
                    int tileZ = tile.Z + this.Z;
    
                    if (p.Z == tileZ || (p.Z + height) > tileZ)
                        return true;
                }
    
                return false;
            }
    
    Would I need to replace every bit of that? Just wanted to make sure as if there were changes from when the townhouse script was created and the current basehouse.cs we have now that none of that is needed?
     
  21. Dian

    Dian Administrator

    Yes, you are correct. Replace the entire method with the one provided. I have been using this same change for years, and both TownHouse and Deeded Houses still seem to work just fine.
    I also was uncertain, as it would seem that the deeded houses would be effected with some problem, but they are both fine.
     
  22. jamesreg1973

    jamesreg1973 Illustrious Member

    I hate asking stupid questions but I looked at all that and was like im not so sure about replacing all that. Thank you ask townhouse features are a major thing I want to play with. Have you ever had any problems with the amount of townhouses used in game? Ideally I would like to replace much of the NPC vendor shops in towns and make them rentable Vendor shops to Players can the system handle this much load based on your experiences.
     
  23. Ravenwolfe

    Ravenwolfe Administrator Staff Member JustUO Developer

    Should take less memory than having the same number of houses. It's basically a region checking thing so it doesnt even add to the number of items like having the same number of player houses would.
     
    • Like Like x 1
  24. jamesreg1973

    jamesreg1973 Illustrious Member

    This compiles just fine but in all the shard loading text I have this message going on

    Warning: Knives.TownHouses.VersionHouse
    - No Serialize() method
    - No Deserialize() method
     
  25. jamesreg1973

    jamesreg1973 Illustrious Member

    I also get this same message with the server rebirth rares script

    I am using the most current version of JustUO and the version of townhouses on this thread fresh installs
     
    Last edited: Jan 27, 2015

Share This Page