Hallo Zusammen,
ich bin gerade dabei mir einen Expansion Server einzurichten.
Leider habe ich beim starten des Servers ein Problem und bekomme die Meldung "@"$CurrentDir:mpmissions\Expansion.chernarusplus\init.c,12": Can't find variable 'ExpansionObjectSpawnTools'.
Wo soll sich die Datei denn befinden?
Code: init.c
void main()
{
bool loadTraderObjects = true;
bool loadTraderNPCs = true;
string MissionWorldName = "empty"; // Do not change
GetGame().GetWorldName(MissionWorldName);
if (MissionWorldName != "empty") // Do not change
{
//! Spawn mission objects and traders
ExpansionObjectSpawnTools.FindMissionFiles("$CurrentDir:\\mpmissions\\Expansion." + MissionWorldName, loadTraderObjects, loadTraderNPCs);
// If your mission is not named dayzOffline.MapName (example: dayzOffline.Chernarusplus)
// but instead something different like empty.MapName (example: empty.deerisle)
// replace dayzOffline by your mission name (in the example it was the word "empty")
}
//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( "BandageDressing" );
if ( Class.CastTo( itemBs, itemEnt ) )
itemBs.SetQuantity( 2 );
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();
}
Alles anzeigen
Klammere ich die Zeile
Code: init.c
ExpansionObjectSpawnTools.FindMissionFiles("$CurrentDir:\\mpmissions\\Expansion." + MissionWorldName, loadTraderObjects, loadTraderNPCs);
in der init.c aus, startet der Server ohne Probleme.
Code: script_log
Log C:\Steam\steamapps\common\DayZServer\ServerProfile\script_2022-01-23_19-18-28.log started at 23.01. 19:18:28
SCRIPT : Registered 220 temporary action enum(s), UAN==220
SCRIPT : CreateGame()
SCRIPT : ... Backlit Effects Enabled
SCRIPT (E): @"$CurrentDir:mpmissions\Expansion.chernarusplus\init.c,12": Can't find variable 'ExpansionObjectSpawnTools'
SCRIPT (E): Can't compile mission init script'!
$CurrentDir:mpmissions\Expansion.chernarusplus\init.c(12): Can't find variable 'ExpansionObjectSpawnTools'
SCRIPT : Creating Mission: mpmissions\Expansion.chernarusplus\mission.c
SCRIPT : ~DayZGame()
Alles anzeigen
Mit freundlichen Grüßen