Guten Tag,
ich versuche nun seit ein paar Tagen neue Gebäude auf meinem Server einzubinden.
Leider ist dies nicht von Erfolg gekrönt
Sobald ich die Init-Datei hochlade mit den Gebäuden anbei, kann man nicht mehr auf dem Server joinen.
Beim joinen kommt dann die Fehlermeldung: "Unbekannter Fehler"
Vielleicht erkennt hier ja einer den Fehler und kann mir behilflich sein
Hier einmal die Init:
//Spawn helper function
void SpawnObject( string type, vector position, vector orientation )
{
auto obj = GetGame().CreateObject( type, position );
obj.SetPosition( position );
obj.SetOrientation( orientation );
obj.SetOrientation( obj.GetOrientation() ); //Collision fix
obj.Update();
obj.SetAffectPathgraph( true, false );
if( obj.CanAffectPathgraph() ) GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( GetGame().UpdatePathgraphRegionByObject, 100, false, obj );
}
void main()
{
//INIT WEATHER BEFORE ECONOMY INIT------------------------
Weather weather = g_Game.GetWeather();
weather.MissionWeather(false); // false = use weather controller from Weather.c
weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.0), 0, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.00, 0.0), 0, 0);
weather.GetRain(0).SetLimits( 0, 0.0 );
//INIT ECONOMY--------------------------------------
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
{
SpawnObject( "Land_Mil_Barracks2", "4544.640137 319.088013 8329.929688", "-80.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks_Round", "4492.939941 315.872009 8305.099609", "140.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks_Round", "4499.270020 316.652008 8310.990234", "140.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks2", "4519.060059 317.846985 8334.410156", "-80.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_1", "4585.430176 318.983002 8273.900391", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_1", "4577.709961 318.811005 8274.190430", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_1", "4569.779785 318.429993 8274.519531", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_1", "4560.089844 318.104004 8243.589844", "-165.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_1", "4545.839844 317.166992 8247.080078", "-165.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_2", "4577.740234 318.161011 8366.509766", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_2", "4577.770020 318.098999 8358.150391", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_2", "4577.589844 318.183014 8348.509766", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_2", "4577.330078 318.208008 8338.730469", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big3", "4577.359863 319.554993 8325.440430", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big2_3", "4191.000000 340.407013 11069.700195", "10.000002 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big2_3", "4143.029785 340.386993 11038.900391", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big2_3", "4143.060059 340.386993 11030.700195", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big2_3", "4143.129883 340.397003 11022.299805", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big2_3", "4156.279785 340.397003 11038.900391", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big2_3", "4156.419922 340.386993 11030.900391", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big2_3", "4156.370117 340.386993 11022.500000", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_1", "4169.770020 338.390015 11022.599609", "89.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_1", "4169.669922 338.398987 11031.400391", "89.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tent_Big1_1", "4169.529785 338.407990 11039.200195", "89.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks2", "4181.279785 339.773987 10990.599609", "-105.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks2", "4170.890137 339.778015 10988.000000", "-105.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks2", "4160.709961 339.781006 10985.299805", "-105.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks5", "1184.670044 190.936996 7265.660156", "-95.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks2", "1186.819946 186.707993 7234.370117", "87.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks2", "1188.020020 186.639008 7214.910156", "-93.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tower_Small", "1168.660034 189.147995 7277.629883", "0.000000 0.000000 0.000000" );
SpawnObject( "Land_Mil_Tower_Small", "1170.640015 189.110992 7203.310059", "170.000015 0.000000 0.000000" );
SpawnObject( "Land_Mil_Barracks_Round", "1013.570007 180.619003 7443.169922", "-91.999992 0.000000 0.000000" );
}
//DATE RESET AFTER ECONOMY INIT-------------------------
int year, month, day, hour, minute;
int reset_month = 9, reset_day = 20;
GetGame().GetWorld().GetDate(year, month, day, hour, minute);
if ((month == reset_month) && (day < reset_day))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
else
{
if ((month == reset_month + 1) && (day > reset_day))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
else
{
if ((month < reset_month) (month > reset_month + 1))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
}
}
}
class CustomMission: MissionServer
{
void SetRandomHealth(EntityAI itemEnt)
{
if ( itemEnt )
{
int rndHlt = Math.RandomInt(55,100);
itemEnt.SetHealth("","",rndHlt);
}
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
Class.CastTo(m_player, playerEnt);
GetGame().SelectPlayer(identity, m_player);
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
EntityAI itemTop;
EntityAI itemEnt;
ItemBase itemBs;
float rand;
itemTop = player.FindAttachmentBySlotName("Body");
if ( itemTop )
{
itemEnt = itemTop.GetInventory().CreateInInventory("Rag");
if ( Class.CastTo(itemBs, itemEnt ) )
itemBs.SetQuantity(4);
SetRandomHealth(itemEnt);
string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" };
int rndIndex = Math.RandomInt(0, 4);
itemEnt = itemTop.GetInventory().CreateInInventory(chemlightArray[rndIndex]);
SetRandomHealth(itemEnt);
rand = Math.RandomFloatInclusive(0.0, 1.0);
if ( rand < 0.35 )
itemEnt = player.GetInventory().CreateInInventory("Apple");
else if ( rand > 0.65 )
itemEnt = player.GetInventory().CreateInInventory("Pear");
else
itemEnt = player.GetInventory().CreateInInventory("Plum");
SetRandomHealth(itemEnt);
}
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}