Hallo,
Kann mir einer sagen warum kein essen im Inventar ist ?
Kleidung ist normal abwechselung, hab ich schon vom anderen thread gefunden. essen erscheind nicht
C: ini
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.02, 0.1), 1, 0);
weather.GetRain().Set( 0, 1, 0);
weather.GetFog().Set( 0, 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 = 8, reset_day = 10;
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" );
{
itemEnt = player.GetInventory().CreateInInventory("Compass");
itemEnt = player.GetInventory().CreateInInventory("SodaCan_Pipsi");
itemEnt = player.GetInventory().CreateInInventory("SodaCan_Pipsi");
itemEnt = player.GetInventory().CreateInInventory("BandageDressing");
itemEnt = player.GetInventory().CreateInInventory("TunaCan");
itemEnt = player.GetInventory().CreateInInventory("TunaCan");
itemEnt = player.GetInventory().CreateInInventory("Apple");
itemEnt = player.GetInventory().CreateInInventory("Pear");
itemEnt = player.GetInventory().CreateInInventory("Plum");
itemEnt = player.GetInventory().CreateInInventory("Chemlight_White");
};
//
player.RemoveAllItems();
ref TStringArray topsArray = {"Hoodie_Blue","Hoodie_Green","Hoodie_Grey"};
ref TStringArray pantsArray = {"Jeans_Black","Jeans_Green","Jeans_Grey"};
ref TStringArray shoesArray = {"JoggingShoes_Black","JoggingShoes_Blue","JoggingShoes_Red"};
EntityAI item1 = player.GetInventory().CreateInInventory(topsArray.GetRandomElement());
EntityAI item2 = player.GetInventory().CreateInInventory(pantsArray.GetRandomElement());
EntityAI item3 = player.GetInventory().CreateInInventory(shoesArray.GetRandomElement());
//
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[] = { "", "", "", "" };
int rndIndex = Math.RandomInt( 0, 4 );
itemEnt = itemClothing.GetInventory().CreateInInventory( chemlightArray[rndIndex] );
SetRandomHealth( itemEnt );
}
itemClothing = player.FindAttachmentBySlotName( "Legs" );
if ( itemClothing )
SetRandomHealth( itemClothing );
itemClothing = player.FindAttachmentBySlotName( "Feet" );
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}
Alles anzeigen
Gruss Andy