hier meine Init.c ....... speziell geht es hier um den Versuch den Char beim respawn zu beeinflussen. Hier direkt ab der Zeile // Random array bis ]; vor Mission CreateCustomMission(string path) (GRÜN hervorgehoben)...... in diesem Bereich muss ich einen Fehler reingebamselt haben und ich komm nicht drauf wasses ist. (Begriffe wie G36, Glock18 und alle Items die mit "Mass" beginnen sind es nicht. Diese funktionieren, es sind Begriffe aus installierten MOD's. Findet eine versierte Person vielleicht den Fehler?
DANKE vorab
void main()
{
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
Weather weather = g_Game.GetWeather();
weather.GetOvercast().SetLimits( 0.0 , 0.5 );
weather.GetRain().SetLimits( 0.0 , 0.0 );
weather.GetFog().SetLimits( 0.0 , 0.0 );
weather.GetOvercast().SetForecastChangeLimits( 0.5, 0.8 );
weather.GetRain().SetForecastChangeLimits( 0.1, 0.3 );
weather.GetFog().SetForecastChangeLimits( 0.0, 0.0 );
weather.GetOvercast().SetForecastTimeLimits( 3600 , 3600 );
weather.GetRain().SetForecastTimeLimits( 300 , 300 );
weather.GetFog().SetForecastTimeLimits( 3600 , 3600 );
weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.3), 0, 0);
weather.GetRain().Set( Math.RandomFloatInclusive(0.0, 0.2), 0, 0);
weather.GetFog().Set( Math.RandomFloatInclusive(0.0, 0.1), 0, 0);
weather.SetWindMaximumSpeed(30);
weather.SetWindFunctionParams(0.0, 0.0, 50);
GetGame().GetWorld().SetDate( 2018, 6, 21, 7, 0);
}
class CustomMission: MissionServer
{
void SetRandomHealth(EntityAI itemEnt)
{
int rndHlt = Math.RandomInt(40,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)
{
/*
player.RemoveAllItems();
*/
EntityAI itemEnt;
ItemBase itemBs;
// Random array
ref TStringArray eyeArray = {"ThinFramesGlasses","TacticalGoogles"};
ref TStringArray handArray = {"TacticalGloves_Black","TacticalGloves_Beige","TacticalGloves_Green"};
ref TStringArray headArray = {"Massurbancamohat"};
ref TStringArray maskArray = {"BandanaMask_CamoPattern"};
ref TStringArray topsArray = {"Massurbancamom65"};
ref TStringArray pantsArray = {"Massurbancamocargopants",};
ref TStringArray shoesArray = {"MilitaryBoots_Black","MilitaryBoots_Brown"};
ref TStringArray backpackArray = {"MasscamoTaloon"};
ref TStringArray vestsArray = {"HighCapacityVest_Olive","HighCapacityVest_Black","Masswoodlandcamovest"};
ref TStringArray canArray = {"PeachesCan_Opened","SardinesCan_Opened","SpaghettiCan_Opened","TacticalBaconCan_Opened","TunaCan_Opened"};
ref TStringArray knifeArray = {"CombatKnife"};
ref TStringArray drinkArray = {"WaterBottle"};
player.RemoveAllItems();
EntityAI item0 = player.GetInventory().CreateInInventory(eyeArray.GetRandomElement());
EntityAI item1 = player.GetInventory().CreateInInventory(handArray.GetRandomElement());
EntityAI item2 = player.GetInventory().CreateInInventory(headArray.GetRandomElement());
EntityAI item3 = player.GetInventory().CreateInInventory(maskArray.GetRandomElement());
EntityAI item4 = player.GetInventory().CreateInInventory(topsArray.GetRandomElement());
EntityAI item5 = player.GetInventory().CreateInInventory(pantsArray.GetRandomElement());
EntityAI item6 = player.GetInventory().CreateInInventory(shoesArray.GetRandomElement());
EntityAI item7 = player.GetInventory().CreateInInventory(backpackArray.GetRandomElement());
EntityAI item8 = player.GetInventory().CreateInInventory(vestsArray.GetRandomElement());
EntityAI item9 = player.GetInventory().CreateInInventory(canArray.GetRandomElement());
EntityAI item10 = player.GetInventory().CreateInInventory(knifeArray.GetRandomElement());
EntityAI item11 = player.GetInventory().CreateInInventory(drinkArray.GetRandomElement());
EntityAI item12 = player.GetInventory().CreateInInventory(drinkArray.GetRandomElement());
//Random guns
switch (Math.RandomInt(0, 1))
{
// G36
case 0:
EntityAI gun3 = player.GetHumanInventory().CreateInHands("G36");
gun3.GetInventory().CreateAttachment("M4_Suppressor");
gun3.GetInventory().CreateAttachment("ACOGOptic");
addMags(player, "Mag_STANAGCoupled_30Rnd", 2);
player.SetQuickBarEntityShortcut(gun3, 0, true);
itemBs = ItemBase.Cast(itemEnt);
break;
};
//Give universal gear
itemEnt = player.GetInventory().CreateInInventory("ACOGOptic");
itemEnt = player.GetInventory().CreateInInventory("CanOpener");
itemEnt = player.GetInventory().CreateInInventory("Armband_White");
itemEnt = player.GetInventory().CreateInInventory("Armband_Black");
itemEnt = player.GetInventory().CreateInInventory("PeachesCan");
itemEnt = player.GetInventory().CreateInInventory("PeachesCan");
itemEnt = player.GetInventory().CreateInInventory("WaterBottle");
itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45");
itemEnt = player.GetInventory().CreateInInventory("Rag");
EntityAI Glock18Pstl = player.GetInventory().CreateInInventory("Glock18");
EntityAI Mag1Glock18= player.GetInventory().CreateInInventory("mag_g18_30rnd");
EntityAI Mag2Glock18= player.GetInventory().CreateInInventory("mag_g18_30rnd");
itemBs = ItemBase.Cast(itemEnt);
itemBs.SetQuantity(4);
player.SetQuickBarEntityShortcut(Glock18, 3, true);
player.SetQuickBarEntityShortcut(mag1_g18_30rnd, 4, true);
player.SetQuickBarEntityShortcut(mag2_g18_30rnd, 5, true);
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}