Okay habe es jetzt mit dem Editorloader hinbekommen. Vielen Vielen dank für die antworten.
Beiträge von SammyTLOK
-
-
An dieser Anleitung habe ich mich orientiert. Alles genau so gemacht wie dort beschrieben und es geht nicht.
-
Also erstmal vielen vielen dank für die Bemühungen.
Bis jetzt habe ich es aber tatsächlich nicht hinbekommen.
Ich habe die init.c wie folgt bearbeitet (mehreres ausprobiert da ich mir nicht genau sicher was was ich alles löschen soll)
Ich weiß es ist ein bisel viel aber ich habe nicht genau verstanden ob alles weg soll oder nur das void main() deshalb bin ich alle varianten durch gegangen.
Ich poste die mal als spoiler bis dahin wo was wetter anfängt.
{
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 );
}
{
//costum spawned objects
SpawnObject( "Land_Village_Pub", "5211.245117 182.620300 3584.243896", "50.000004 0.000000 0.000000" );
SpawnObject( "Land_Misc_Greenhouse", "5222.144531 179.712952 3583.107666", "59.000000 0.000000 0.000000" );
SpawnObject( "Land_FuelStation_Feed_Enoch", "5237.483398 179.219208 3591.264648", "57.999996 0.000000 0.000000" );
SpawnObject( "Land_Misc_Well_Pump_Blue", "5216.048340 179.052048 3587.480469", "-25.000002 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5211.183105 180.498962 3601.516113", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5216.668457 180.549652 3605.205078", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5227.429688 182.484833 3606.719727", "-179.999985 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5236.079590 181.992615 3595.307129", "-55.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5218.542480 181.962067 3583.725586", "11.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5211.026367 182.390427 3595.397705", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Garage_Row_Small", "5230.877441 180.006943 3588.543457", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5222.116211 180.566116 3608.897217", "-35.000004 0.000000 0.000000" );
}
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.4, 0.6), 1, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
//INIT ECONOMY--------------------------------------
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
void main()
{
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 );
}
{
//costum spawned objects
SpawnObject( "Land_Village_Pub", "5211.245117 182.620300 3584.243896", "50.000004 0.000000 0.000000" );
SpawnObject( "Land_Misc_Greenhouse", "5222.144531 179.712952 3583.107666", "59.000000 0.000000 0.000000" );
SpawnObject( "Land_FuelStation_Feed_Enoch", "5237.483398 179.219208 3591.264648", "57.999996 0.000000 0.000000" );
SpawnObject( "Land_Misc_Well_Pump_Blue", "5216.048340 179.052048 3587.480469", "-25.000002 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5211.183105 180.498962 3601.516113", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5216.668457 180.549652 3605.205078", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5227.429688 182.484833 3606.719727", "-179.999985 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5236.079590 181.992615 3595.307129", "-55.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5218.542480 181.962067 3583.725586", "11.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5211.026367 182.390427 3595.397705", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Garage_Row_Small", "5230.877441 180.006943 3588.543457", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5222.116211 180.566116 3608.897217", "-35.000004 0.000000 0.000000" );
}
{
//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.4, 0.6), 1, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
{
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 );
}
{
//costum spawned objects
SpawnObject( "Land_Village_Pub", "5211.245117 182.620300 3584.243896", "50.000004 0.000000 0.000000" );
SpawnObject( "Land_Misc_Greenhouse", "5222.144531 179.712952 3583.107666", "59.000000 0.000000 0.000000" );
SpawnObject( "Land_FuelStation_Feed_Enoch", "5237.483398 179.219208 3591.264648", "57.999996 0.000000 0.000000" );
SpawnObject( "Land_Misc_Well_Pump_Blue", "5216.048340 179.052048 3587.480469", "-25.000002 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5211.183105 180.498962 3601.516113", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5216.668457 180.549652 3605.205078", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5227.429688 182.484833 3606.719727", "-179.999985 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5236.079590 181.992615 3595.307129", "-55.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5218.542480 181.962067 3583.725586", "11.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5211.026367 182.390427 3595.397705", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Garage_Row_Small", "5230.877441 180.006943 3588.543457", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5222.116211 180.566116 3608.897217", "-35.000004 0.000000 0.000000" );
}
{
//INIT WEATHER BEFORE ECONOMY INIT------------------------
Weather weather = g_Game.GetWeather();
weather.MissionWeather(false); // false = use weather controller from Weather.c
//Spawn helper function
void SpawnObject( string type, vector position, vector orientation )
{
auto obj = GetGame().CreateObject_WIP( type, position, ECE_CREATEPHYSICS );
obj.SetFlags( EntityFlags.STATIC, false );
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 );
}
//Your custom spawned objects
SpawnObject( "Land_Village_Pub", "5211.245117 182.620300 3584.243896", "50.000004 0.000000 0.000000" );
SpawnObject( "Land_Misc_Greenhouse", "5222.144531 179.712952 3583.107666", "59.000000 0.000000 0.000000" );
SpawnObject( "Land_FuelStation_Feed_Enoch", "5237.483398 179.219208 3591.264648", "57.999996 0.000000 0.000000" );
SpawnObject( "Land_Misc_Well_Pump_Blue", "5216.048340 179.052048 3587.480469", "-25.000002 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5211.183105 180.498962 3601.516113", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5216.668457 180.549652 3605.205078", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5227.429688 182.484833 3606.719727", "-179.999985 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5236.079590 181.992615 3595.307129", "-55.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5218.542480 181.962067 3583.725586", "11.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5211.026367 182.390427 3595.397705", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Garage_Row_Small", "5230.877441 180.006943 3588.543457", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5222.116211 180.566116 3608.897217", "-35.000004 0.000000 0.000000" );
}
{
//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.4, 0.6), 1, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
void main()
void SpawnObject( string type, vector position, vector orientation )
{
auto obj = GetGame().CreateObject_WIP( type, position, ECE_CREATEPHYSICS );
obj.SetFlags( EntityFlags.STATIC, false );
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 );
}
//Your custom spawned objects
SpawnObject( "Land_Village_Pub", "5211.245117 182.620300 3584.243896", "50.000004 0.000000 0.000000" );
SpawnObject( "Land_Misc_Greenhouse", "5222.144531 179.712952 3583.107666", "59.000000 0.000000 0.000000" );
SpawnObject( "Land_FuelStation_Feed_Enoch", "5237.483398 179.219208 3591.264648", "57.999996 0.000000 0.000000" );
SpawnObject( "Land_Misc_Well_Pump_Blue", "5216.048340 179.052048 3587.480469", "-25.000002 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5211.183105 180.498962 3601.516113", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5216.668457 180.549652 3605.205078", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5227.429688 182.484833 3606.719727", "-179.999985 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5236.079590 181.992615 3595.307129", "-55.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5218.542480 181.962067 3583.725586", "11.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5211.026367 182.390427 3595.397705", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Garage_Row_Small", "5230.877441 180.006943 3588.543457", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5222.116211 180.566116 3608.897217", "-35.000004 0.000000 0.000000" );
}
{
//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.4, 0.6), 1, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
//Spawn helper function
void SpawnObject( string type, vector position, vector orientation )
{
auto obj = GetGame().CreateObject_WIP( type, position, ECE_CREATEPHYSICS );
obj.SetFlags( EntityFlags.STATIC, false );
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 );
}
//Your custom spawned objects
SpawnObject( "Land_Village_Pub", "5211.245117 182.620300 3584.243896", "50.000004 0.000000 0.000000" );
SpawnObject( "Land_Misc_Greenhouse", "5222.144531 179.712952 3583.107666", "59.000000 0.000000 0.000000" );
SpawnObject( "Land_FuelStation_Feed_Enoch", "5237.483398 179.219208 3591.264648", "57.999996 0.000000 0.000000" );
SpawnObject( "Land_Misc_Well_Pump_Blue", "5216.048340 179.052048 3587.480469", "-25.000002 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5211.183105 180.498962 3601.516113", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5216.668457 180.549652 3605.205078", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5227.429688 182.484833 3606.719727", "-179.999985 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5236.079590 181.992615 3595.307129", "-55.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5218.542480 181.962067 3583.725586", "11.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5211.026367 182.390427 3595.397705", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Garage_Row_Small", "5230.877441 180.006943 3588.543457", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5222.116211 180.566116 3608.897217", "-35.000004 0.000000 0.000000" );
}
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.4, 0.6), 1, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
Diese ganzen sachen habe ich ausprobiert aber keinen erfolg gehabt. Noch jemand ne idee ?
-
Ja das sollten alles Vanillagebäude sein, die "BuilderItems" mod habe ich gar nicht drauf.
Ich habe jetzt den Text jetzt mal an denn Anfang gemacht (siehe Spoiler)
Es kommt aber auch dort nach wie vor der selbe Fehler.
void main()
//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()
{
//costum spawned objects
SpawnObject( "Land_Village_Pub", "5211.245117 182.620300 3584.243896", "50.000004 0.000000 0.000000" );
SpawnObject( "Land_Misc_Greenhouse", "5222.144531 179.712952 3583.107666", "59.000000 0.000000 0.000000" );
SpawnObject( "Land_FuelStation_Feed_Enoch", "5237.483398 179.219208 3591.264648", "57.999996 0.000000 0.000000" );
SpawnObject( "Land_Misc_Well_Pump_Blue", "5216.048340 179.052048 3587.480469", "-25.000002 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5211.183105 180.498962 3601.516113", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5216.668457 180.549652 3605.205078", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5227.429688 182.484833 3606.719727", "-179.999985 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5236.079590 181.992615 3595.307129", "-55.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5218.542480 181.962067 3583.725586", "11.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5211.026367 182.390427 3595.397705", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Garage_Row_Small", "5230.877441 180.006943 3588.543457", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5222.116211 180.566116 3608.897217", "-35.000004 0.000000 0.000000" );
}
{
//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.4, 0.6), 1, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
//INIT ECONOMY--------------------------------------
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
//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 )
{
float rndHlt = Math.RandomFloat( 0.45, 0.65 );
itemEnt.SetHealth01( "", "", rndHlt );
}
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
playerEnt = GetGame().CreatePlayer( identity, characterName, pos, 0, "NONE" );
Class.CastTo( m_player, playerEnt );
GetGame().SelectPlayer( identity, m_player );
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
EntityAI itemClothing;
EntityAI itemEnt;
ItemBase itemBs;
float rand;
itemClothing = player.FindAttachmentBySlotName( "Body" );
if ( itemClothing )
{
SetRandomHealth( itemClothing );
itemEnt = itemClothing.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 = itemClothing.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 );
}
itemClothing = player.FindAttachmentBySlotName( "Legs" );
if ( itemClothing )
SetRandomHealth( itemClothing );
itemClothing = player.FindAttachmentBySlotName( "Feet" );
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}
-
Ich Wünsche einen schönen guten tag.
Ich habe die letzten zwei tage daran gesessen eine Base mit dem OfflineEditor zu Bauen.
das klappte auch alles sehr gut.
Habe mich an diese Anleitung gehalten:https://github.com/Arkensor/Da…to-your-server-or-mission
Das was mir ausgegeben wurde habe ich der init.c hinzugefügt und auf dem Server geladen.
Sobald die Datei drauf ist geht der beitritt nicht.
DayZ sagt nur.... Ein unbekannter Fehler ist aufgetreten.
Habe dann in diesem Beitrag alle Hilfestellungen ausprobiert nützt aber alles nichts.
Vielleicht hat noch jemand eine Idee?
würde mich sehr freuen.
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.4, 0.6), 1, 0);
weather.GetRain().Set( 0, 0, 1);
weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
//INIT ECONOMY--------------------------------------
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
//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);
}
}
}
}
//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()
{
//Your custom spawned objects
SpawnObject( "Land_Village_Pub", "5211.245117 182.620300 3584.243896", "50.000004 0.000000 0.000000" );
SpawnObject( "Land_Misc_Greenhouse", "5222.144531 179.712952 3583.107666", "59.000000 0.000000 0.000000" );
SpawnObject( "Land_FuelStation_Feed_Enoch", "5237.483398 179.219208 3591.264648", "57.999996 0.000000 0.000000" );
SpawnObject( "Land_Misc_Well_Pump_Blue", "5216.048340 179.052048 3587.480469", "-25.000002 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5211.183105 180.498962 3601.516113", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5216.668457 180.549652 3605.205078", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5227.429688 182.484833 3606.719727", "-179.999985 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5236.079590 181.992615 3595.307129", "-55.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5218.542480 181.962067 3583.725586", "11.000000 0.000000 0.000000" );
SpawnObject( "Land_Power_Pole_Wood1_Lamp_Amp", "5211.026367 182.390427 3595.397705", "90.000000 0.000000 0.000000" );
SpawnObject( "Land_Garage_Row_Small", "5230.877441 180.006943 3588.543457", "-35.000004 0.000000 0.000000" );
SpawnObject( "Land_Shed_W6", "5222.116211 180.566116 3608.897217", "-35.000004 0.000000 0.000000" );
}
class CustomMission: MissionServer
{
void SetRandomHealth(EntityAI itemEnt)
{
if ( itemEnt )
{
float rndHlt = Math.RandomFloat( 0.45, 0.65 );
itemEnt.SetHealth01( "", "", rndHlt );
}
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
playerEnt = GetGame().CreatePlayer( identity, characterName, pos, 0, "NONE" );
Class.CastTo( m_player, playerEnt );
GetGame().SelectPlayer( identity, m_player );
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
EntityAI itemClothing;
EntityAI itemEnt;
ItemBase itemBs;
float rand;
itemClothing = player.FindAttachmentBySlotName( "Body" );
if ( itemClothing )
{
SetRandomHealth( itemClothing );
itemEnt = itemClothing.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 = itemClothing.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 );
}
itemClothing = player.FindAttachmentBySlotName( "Legs" );
if ( itemClothing )
SetRandomHealth( itemClothing );
itemClothing = player.FindAttachmentBySlotName( "Feet" );
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}