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!

need help with customizable houses

nottingham

Sorceror
so in what file would I turn on the ability to make all the later customizable stuff like roofs the new walls and floors I run a LBR shard just need a nudge in the right way im sure its just changing the core to LBR on something least I hope if not all help is greatly appreciated
 

nottingham

Sorceror
so im running a LBR shard and I have customizable houses on it well up to size 15 15 have a smaller custom map

but off topic lol

so when my player go to customize the house they cant use roofs or the newer walls ect says im wrong expansion and is greyed out is there anyway to open this up
 

Dian

Sorceror
Ah, yea you are right with assuming its a Core check in the script preventing the content. At least near certain. I have not looked into the house scripts in quite some time now, but you should be able to simply change or remove the Core checks that are in place, determining what is available to use to build, yes.

If you really can not find the areas let us know and I or someone can take a look for where to make the edits :)
Id imagine most would be set at if(Core.AOS) or if(!Core.AOS) though.
 

nottingham

Sorceror
so went in looking for the right core to change and changed some with nothing coming up then was looking at this and if it this I don't know what to do so hoping it isn't lol


ComponentVerification



Code:
using System;
using System.Collections.Generic;
using System.IO;
 
namespace Server.Multis
{
    public class ComponentVerification
    {
        private int[] m_ItemTable;
        private int[] m_MultiTable;
 
        public bool IsItemValid( int itemID )
        {
            if ( itemID <= 0 || itemID >= m_ItemTable.Length )
                return false;
 
            return CheckValidity( m_ItemTable[itemID] );
        }
 
        public bool IsMultiValid( int multiID )
        {
            if ( multiID <= 0 || multiID >= m_MultiTable.Length )
                return false;
 
            return CheckValidity( m_MultiTable[multiID] );
        }
       
        public bool CheckValidity( int val )
        {
           
            if ( val == -1 )
                return false;
 
            return ( val == 0 || (ExpansionInfo.CurrentExpansion.CustomHousingFlag & val) != 0 );
        }
       
       
        public ComponentVerification()
        {
       
            m_ItemTable = CreateTable( 0x10000 );
            m_MultiTable = CreateTable( 0x4000 );
 
            LoadItems( "Data/Components/walls.txt", "South1", "South2", "South3", "Corner", "East1", "East2", "East3", "Post", "WindowS", "AltWindowS", "WindowE", "AltWindowE", "SecondAltWindowS", "SecondAltWindowE" );
            LoadItems( "Data/Components/teleprts.txt", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16" );
            LoadItems( "Data/Components/stairs.txt", "Block", "North", "East", "South", "West", "Squared1", "Squared2", "Rounded1", "Rounded2" );
            LoadItems( "Data/Components/roof.txt", "North", "East", "South", "West", "NSCrosspiece", "EWCrosspiece", "NDent", "EDent", "SDent", "WDent", "NTPiece", "ETPiece", "STPiece", "WTPiece", "XPiece", "Extra Piece" );
            LoadItems( "Data/Components/floors.txt", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16" );
            LoadItems( "Data/Components/misc.txt", "Piece1", "Piece2", "Piece3", "Piece4", "Piece5", "Piece6", "Piece7", "Piece8" );
            LoadItems( "Data/Components/doors.txt", "Piece1", "Piece2", "Piece3", "Piece4", "Piece5", "Piece6", "Piece7", "Piece8" );
 
            LoadMultis( "Data/Components/stairs.txt", "MultiNorth", "MultiEast", "MultiSouth", "MultiWest" );
        }
 
        private int[] CreateTable( int length )
        {
            int[] table = new int[length];
 
            for ( int i = 0; i < table.Length; ++i )
                table[i] = -1;
 
            return table;
        }
 
        private void LoadItems( string path, params string[] itemColumns )
        {
            LoadSpreadsheet( m_ItemTable, path, itemColumns );
        }
 
        private void LoadMultis( string path, params string[] multiColumns )
        {
            LoadSpreadsheet( m_MultiTable, path, multiColumns );
        }
 
        private void LoadSpreadsheet( int[] table, string path, params string[] tileColumns )
        {
            Spreadsheet ss = new Spreadsheet( path );
 
            int[] tileCIDs = new int[tileColumns.Length];
 
            for ( int i = 0; i < tileColumns.Length; ++i )
                tileCIDs[i] = ss.GetColumnID( tileColumns[i] );
 
            int featureCID = ss.GetColumnID( "FeatureMask" );
 
            for ( int i = 0; i < ss.Records.Length; ++i )
            {
                DataRecord record = ss.Records[i];
 
                int fid = record.GetInt32( featureCID );
 
                for ( int j = 0; j < tileCIDs.Length; ++j )
                {
                    int itemID = record.GetInt32( tileCIDs[j] );
 
                    if ( itemID <= 0 || itemID >= table.Length )
                        continue;
 
                    table[itemID] = fid;
                }
            }
        }
    }
 
    public class Spreadsheet
    {
        private class ColumnInfo
        {
            public int m_DataIndex;
 
            public string m_Type;
            public string m_Name;
 
            public ColumnInfo( int dataIndex, string type, string name )
            {
                m_DataIndex = dataIndex;
 
                m_Type = type;
                m_Name = name;
            }
        }
 
        private ColumnInfo[] m_Columns;
        private DataRecord[] m_Records;
 
        public DataRecord[] Records { get { return m_Records; } }
 
        public int GetColumnID( string name )
        {
            for ( int i = 0; i < m_Columns.Length; ++i )
            {
                if ( m_Columns[i].m_Name == name )
                    return i;
            }
 
            return -1;
        }
 
        public Spreadsheet( string path )
        {
            using ( StreamReader ip = new StreamReader( path ) )
            {
                string[] types = ReadLine( ip );
                string[] names = ReadLine( ip );
 
                m_Columns = new ColumnInfo[types.Length];
 
                for ( int i = 0; i < m_Columns.Length; ++i )
                    m_Columns[i] = new ColumnInfo( i, types[i], names[i] );
 
                List<DataRecord> records = new List<DataRecord>();
 
                string[] values;
 
                while ( ( values = ReadLine( ip ) ) != null )
                {
                    object[] data = new object[m_Columns.Length];
 
                    for ( int i = 0; i < m_Columns.Length; ++i )
                    {
                        ColumnInfo ci = m_Columns[i];
 
                        switch ( ci.m_Type )
                        {
                            case "int":
                                {
                                    data[i] = Utility.ToInt32( values[ci.m_DataIndex] );
                                    break;
                                }
                            case "string":
                                {
                                    data[i] = values[ci.m_DataIndex];
                                    break;
                                }
                        }
                    }
 
                    records.Add( new DataRecord( this, data ) );
                }
 
                m_Records = records.ToArray();
            }
        }
 
        private string[] ReadLine( StreamReader ip )
        {
            string line;
 
            while ( ( line = ip.ReadLine() ) != null )
            {
                if ( line.Length == 0 )
                    continue;
 
                return line.Split( '\t' );
            }
 
            return null;
        }
    }
 
    public class DataRecord
    {
        private Spreadsheet m_Spreadsheet;
        private object[] m_Data;
 
        public Spreadsheet Spreadsheet { get { return m_Spreadsheet; } }
        public object[] Data { get { return m_Data; } }
 
        public DataRecord( Spreadsheet ss, object[] data )
        {
            m_Spreadsheet = ss;
            m_Data = data;
        }
 
        public int GetInt32( string name )
        {
            return GetInt32( this[name] );
        }
 
        public int GetInt32( int id )
        {
            return GetInt32( this[id] );
        }
 
        public int GetInt32( object obj )
        {
            if ( obj is int )
                return (int) obj;
 
            return 0;
        }
 
        public string GetString( string name )
        {
            return this[name] as string;
        }
 
        public object this[string name]
        {
            get
            {
                return this[m_Spreadsheet.GetColumnID( name )];
            }
        }
 
        public object this[int id]
        {
            get
            {
                if ( id < 0 )
                    return null;
 
                return m_Data[id];
            }
        }
    }
}
 

nottingham

Sorceror
so have tried a few things in that like adding

if (Core.LBR) I didn't get errors but it didn't do anything at all
in a couple spot and changing CurrentExpansion with a couple things with no luck :(
still learning a lot of stuff so again thx for help
 

nottingham

Sorceror
so anyone happen to know what file that needs to be changed to make it so you can use every housing decoration from roofs to the newer walls on any expansion like newer walls and roof on customizable house on era T2A of UOR
 

zerodowned

Sorceror
in housegumpaos

you'll see something like
if( Core.ML && index >= 5 )
{
switch( index )
{
case 5: newType = FoundationType.ElvenGrey; break;
case 6: newType = FoundationType.ElvenNatural; break;
case 7: newType = FoundationType.Crystal; break;
case 8: newType = FoundationType.Shadow; break;
default: return;
}
}
 

zerodowned

Sorceror
If you're not using the ML expansion or higher and want to enable using those types of house items, you'll have to change

if( Core.ML && index >= 5 )

to

if( index >= 5 )
 

nottingham

Sorceror
kewl ty for reply didn't work though still is greyed out and says you must update to latest expansion

ill keep trying though you rock though thx for taking time to reply though
 
Top