Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
void main()
{
// 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);
}
}
}
SpawnObject("Land_Construction_Crane", "6149.272949 28.847200 2346.562256", "-57.999992 0.000000 0.000000");
SpawnObject("Land_Construction_House2", "6159.585938 13.708900 2346.833008", "0.000000 0.000000 0.000000");
GetCEApi().ExportProxyData("7500 0 7500", 10000); // Center of map, radius of 10 km
}
Object SpawnObject(string type, vector position, vector orientation)
{
auto obj = GetGame().CreateObject(type, position);
if (obj)
{
obj.SetPosition(position);
obj.SetOrientation(orientation);
// Fix object pitch and roll
vector roll = obj.GetOrientation();
roll[2] = 0; // Reset roll
obj.SetOrientation(roll);
if (obj.CanAffectPathgraph())
{
obj.SetAffectPathgraph(true, false);
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj);
}
}
return obj;
}
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");
player.SetQuickBarEntityShortcut(itemEnt, 1);
string chemlightArray[] = { "Chemlight_White", "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();
}