HogsMaws 2 Posted November 11, 2020 Can someone help me with editing the starting gear loadout? i did this a long time ago in .62 time frame and i can't remember which file it is anymore. Share this post Link to post Share on other sites
drgullen 597 Posted November 11, 2020 2 hours ago, HogsMaws said: Can someone help me with editing the starting gear loadout? i did this a long time ago in .62 time frame and i can't remember which file it is anymore. Try searching this site for "init.c" without the quotes as that is the file you edit and I'm sure you'll find lots of examples on here. 1 Share this post Link to post Share on other sites
HogsMaws 2 Posted November 12, 2020 8 hours ago, drgullen said: Try searching this site for "init.c" without the quotes as that is the file you edit and I'm sure you'll find lots of examples on here. thanks! Share this post Link to post Share on other sites
HogsMaws 2 Posted November 12, 2020 (edited) 12 hours ago, drgullen said: Try searching this site for "init.c" without the quotes as that is the file you edit and I'm sure you'll find lots of examples on here. i think you helped me way back in the day. can someone check my code? ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 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); } } } } class CustomMission: MissionServer { void SetRandomHealth(EntityAI itemEnt) { if ( itemEnt ) { float rndHlt = Math.RandomFloat( 0.25, 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) { player.RemoveAllItems(); EntityAI itemTop; EntityAI itemEnt; ItemBase itemBs; float rand; itemTop = player.FindAttachmentBySlotName( "Body" ); itemEnt = player.GetInventory().CreateInInventory("AliceBag_Green"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("PlateCarrierVest"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("PlateCarrierHolster"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("PlateCarrierPouches"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("MilitaryBelt"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("CombatBoots_Green"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("TacticalGloves_Green"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("M65Jacket_Olive"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("BDUPants"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("WoodAxe"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("HuntingKnife"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Compass"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("CanOpener"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Canteen"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Rag"); itemBs = ItemBase.Cast(itemEnt); itemBs.SetQuantity( 6 ); itemEnt = player.GetInventory().CreateInInventory("SardinesCan"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("SardinesCan"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("SardinesCan"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("SardinesCan"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Glock19"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Mag_Glock_15Rnd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Mag_Glock_15Rnd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Mag_Glock_15Rnd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Mag_Glock_15Rnd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Mag_Glock_15Rnd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("PistolSuppressor"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Ammo_9x19"); itemBs = ItemBase.Cast(itemEnt); itemBs.SetQuantity( 10 ); itemEnt = player.GetInventory().CreateInInventory("M4A1"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("M4_MPHndgrd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("M4_MPBttstck"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("M4_Suppressor"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Mag_CMAG_40Rnd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Mag_CMAG_40Rnd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Mag_CMAG_40Rnd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Mag_CMAG_40Rnd"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("ACOGOptic"); itemBs = ItemBase.Cast(itemEnt); itemEnt = player.GetInventory().CreateInInventory("Ammo_556x45"); itemBs = ItemBase.Cast(itemEnt); itemBs.SetQuantity( 10 ); itemEnt = player.GetInventory().CreateInInventory("LargeTent"); itemBs = ItemBase.Cast(itemEnt); } }; Mission CreateCustomMission(string path) { return new CustomMission(); } Edited November 12, 2020 by HogsMaws Share this post Link to post Share on other sites
HogsMaws 2 Posted November 12, 2020 (edited) i'm getting an error. itemEnt = player.GetInventory().CreateInInve ntory( "AliceBag_Green" ); itemBs = ItemBase.Cast(itemEnt); i think the word "player" no longer works? this is the error i'm getting but i don't think i'm missing any syntax? Edited November 12, 2020 by HogsMaws Share this post Link to post Share on other sites
drgullen 597 Posted November 14, 2020 One thing I see is you have a semi-colon next to a } near the bottom of the script. Try removing that. Share this post Link to post Share on other sites