protected override void InitCommon(IModSystemRegistry modSystemRegistry) { string sInit = "Initialising Wico Research. Version: " + CurrentModVersion; MyAPIGateway.Utilities.ShowNotification(sInit, 5000, MyFontEnum.DarkBlue); ModLog.Info(sInit); if (MyAPIGateway.Session.IsServer) { MyVisualScriptLogicProvider.SendChatMessage(sInit, "Wicorel", 0, MyFontEnum.DarkBlue); } bool bResearch = Session.SessionSettings.EnableResearch; // This works to change the setting. Session.SessionSettings.EnableResearch = true; if (!bResearch) { ModLog.Info("Research was not turned on"); } TextAPI = new HudAPIv2(); researchControl = new ResearchControl(audioSystem); researchControl.InitResearchRestrictions(); researchHacking = new ResearchHacking(researchControl, TextAPI, networkComms); networkComms.Init(audioSystem, researchControl, researchHacking); modSystemRegistry.AddCloseableModSystem(networkComms); modSystemRegistry.AddUpatableModSystem(audioSystem); MyAPIGateway.Utilities.MessageEntered += MessageEntered; }
// after loading of saved data protected override void InitHostPostLoading(IModSystemRegistry modSystemRegistry) { ModLog.Info("Original world was loaded by Version:" + modBuildWhenGameStarted.ToString()); ModLog.Info("Loaded world was saved by Version:" + modBuildWhenLastSaved.ToString()); npcGroupManager.SetBuildWhenSaved(modBuildWhenLastSaved); researchHacking.InitHackingLocations(); // Uses research restrictions and save data DuckUtils.MakePeaceBetweenFactions("MIKI", "CRASH"); DuckUtils.MakePeaceBetweenFactions("MIKI", "GCORP"); //V27 for SE 1.192 DuckUtils.RemoveFaction("SPRT"); DuckUtils.SetAllPlayerReputation("MIKI", 0); audioSystem.AudioRelay = networkComms; networkComms.StartWipeHostToolbar(); modSystemRegistry.AddRapidUpdatableModSystem(turretManager); modSystemRegistry.AddUpatableModSystem(researchHacking); modSystemRegistry.AddUpatableModSystem(missionSystem); modSystemRegistry.AddUpatableModSystem(mikiScrapManager); modSystemRegistry.AddUpatableModSystem(npcGroupManager); modSystemRegistry.AddUpatableModSystem(baseManager); modSystemRegistry.AddUpatableModSystem(convoySpawner); }
// after loading of saved data protected override void InitHostPostLoading(IModSystemRegistry modSystemRegistry) { ModLog.Info("Original world was loaded by Version:" + modBuildWhenGameStarted.ToString()); ModLog.Info("Loaded world was saved by Version:" + modBuildWhenLastSaved.ToString()); researchHacking.InitHackingLocations(); // Uses research restrictions and save data audioSystem.AudioRelay = networkComms; // networkComms.StartWipeHostToolbar(); modSystemRegistry.AddUpatableModSystem(researchHacking); }
protected override void InitClient(IModSystemRegistry modSystemRegistry) { var player = MyAPIGateway.Session.Player; if (player != null) { networkComms.NotifyServerClientJoined(player); } }
protected override void InitClient(IModSystemRegistry modSystemRegistry) { var player = MyAPIGateway.Session.Player; if (player != null) { networkComms.NotifyServerClientJoined(player); DuckUtils.PutPlayerIntoFaction("CRASH"); // V28 } }
protected override void InitCommon(IModSystemRegistry modSystemRegistry) { MyAPIGateway.Utilities.ShowNotification("Initialising Calpurnius build " + CurrentModVersion, 10000, MyFontEnum.DarkBlue); hudTextApi = new HUDTextAPI(11873852597); researchControl = new ResearchControl(audioSystem); researchControl.InitResearchRestrictions(); researchHacking = new ResearchHacking(researchControl, hudTextApi, networkComms); networkComms.Init(audioSystem, researchControl, researchHacking); modSystemRegistry.AddCloseableModSystem(hudTextApi); modSystemRegistry.AddCloseableModSystem(networkComms); modSystemRegistry.AddUpatableModSystem(audioSystem); CalFactions.Player.JoinCurrentPlayerToFaction(); }
protected override void InitHostPostLoading(IModSystemRegistry modSystemRegistry) { researchHacking.InitHackingLocations(); // Uses research restrictions and save data CalFactions.Init(); audioSystem.AudioRelay = networkComms; networkComms.StartWipeHostToolbar(); modSystemRegistry.AddRapidUpdatableModSystem(turretManager); modSystemRegistry.AddUpatableModSystem(researchHacking); modSystemRegistry.AddUpatableModSystem(missionSystem); // mabel modSystemRegistry.AddUpatableModSystem(mikiScrapManager); modSystemRegistry.AddUpatableModSystem(npcGroupManager); modSystemRegistry.AddUpatableModSystem(baseManager); modSystemRegistry.AddUpatableModSystem(convoySpawner); // turn OFF dust storms with commented out code. // dustStorm = new DustStorm(); // modSystemRegistry.AddUpatableModSystem(dustStorm); }
protected virtual void InitClient(IModSystemRegistry clientUpdateables) { }
protected virtual void InitHostPostLoading(IModSystemRegistry modSystemRegistry) { }
protected virtual void InitCommon(IModSystemRegistry proxy) { }
protected override void InitCommon(IModSystemRegistry modSystemRegistry) { var stringIdInit = MyStringId.TryGet("Init"); string sInit = VRage.MyTexts.Get(stringIdInit).ToString() + " " + CurrentModVersion; var TranslationByID = MyStringId.TryGet("TranslationBy"); string sTranslationBy = VRage.MyTexts.Get(TranslationByID).ToString(); if (!string.IsNullOrWhiteSpace(sTranslationBy)) { sInit += "\n " + sTranslationBy; } var AudioByID = MyStringId.TryGet("AudioBy"); string sAudioBy = VRage.MyTexts.Get(AudioByID).ToString(); if (!string.IsNullOrWhiteSpace(sAudioBy)) { sInit += "\n " + sAudioBy; } // string sInit = "Initialising Escape From Mars build " + CurrentModVersion; MyAPIGateway.Utilities.ShowNotification(sInit, 5000, MyFontEnum.DarkBlue); ModLog.Info(sInit); MyLog.Default.Info("EFM Init" + sInit); // var gamelanguage = MySpaceTexts.ToolTipOptionsGame_Language; var gamelanguage = MyAPIGateway.Session.Config.Language; ModLog.Info("Game Language=" + gamelanguage.ToString()); /* * var idString1=MyStringId.TryGet("String1"); * var String1=VRage.MyTexts.Get(idString1); * ModLog.Info("idString1=" + idString1); * ModLog.Info("String1=" + String1); */ if (MyAPIGateway.Session.IsServer) { MyVisualScriptLogicProvider.SendChatMessage(sInit, "Wicorel", 0, MyFontEnum.DarkBlue); } gameVersion = MyAPIGateway.Session.Version; ModLog.Info("SE Version=" + gameVersion.ToString()); /* * ModLog.Info(" Major=" + gameVersion.Major.ToString()); * ModLog.Info(" MajorRevision=" + gameVersion.MajorRevision.ToString()); * ModLog.Info(" Minor=" + gameVersion.Minor.ToString()); * ModLog.Info(" MinorRevision=" + gameVersion.MinorRevision.ToString()); * ModLog.Info(" Build=" + gameVersion.Build.ToString()); */ /* * // TESTING: (they seem to be the same) * if (MyAPIGateway.Session.IsServer) * ModLog.Info("MyAPIGateway.Session.IsServer.IsServer"); * else * ModLog.Info("MyAPIGateway.Session.NOT Server"); * if (MyAPIGateway.Multiplayer.IsServer) * ModLog.Info("MyAPIGateway.Multiplayer.IsServer"); * else * ModLog.Info("MyAPIGateway.Multiplayer.NOT Server"); */ bool bResearch = Session.SessionSettings.EnableResearch; // This works to change the setting. Session.SessionSettings.EnableResearch = true; Session.SessionSettings.EnableBountyContracts = false; // SE V1.192 if ((gameVersion.Major == 1 && gameVersion.Minor >= 192) || gameVersion.Major > 1) { ModLog.Info("Economy items enabled"); CargoType.AllowEconomyItems(); } if ((gameVersion.Major == 1 && gameVersion.Minor >= 198) || gameVersion.Major > 1) { ModLog.Info("Warefare1 items enabled"); CargoType.AllowWarefare1Items(); } if ((gameVersion.Major == 1 && gameVersion.Minor >= 200) || gameVersion.Major > 1) { ModLog.Info("Warefare2 items enabled"); CargoType.AllowWarefare2Items(); } if (!bResearch) { // MyAPIGateway.Utilities.ShowNotification("Save, then Exit. Edit world /Advanced settings and Enable progression", 50000, MyFontEnum.Red); ModLog.Info("Research was not turned on"); } TextAPI = new HudAPIv2(); // if (modBuildWhenGameStarted > 4) V37 { DuckUtils.PutPlayerIntoFaction("CRASH"); } researchControl = new ResearchControl(audioSystem); researchControl.InitResearchRestrictions(); researchHacking = new ResearchHacking(researchControl, TextAPI, networkComms); networkComms.Init(audioSystem, researchControl, researchHacking); modSystemRegistry.AddCloseableModSystem(networkComms); modSystemRegistry.AddUpatableModSystem(audioSystem); MyAPIGateway.Utilities.MessageEntered += MessageEntered; }
protected override void InitCommon(IModSystemRegistry modSystemRegistry) { string sInit = "Initialising Escape From Mars build " + CurrentModVersion; MyAPIGateway.Utilities.ShowNotification(sInit, 5000, MyFontEnum.DarkBlue); ModLog.Info(sInit); if (MyAPIGateway.Session.IsServer) { MyVisualScriptLogicProvider.SendChatMessage(sInit, "Wicorel", 0, MyFontEnum.DarkBlue); } gameVersion = MyAPIGateway.Session.Version; ModLog.Info("SE Version=" + gameVersion.ToString()); /* * ModLog.Info(" Major=" + gameVersion.Major.ToString()); * ModLog.Info(" MajorRevision=" + gameVersion.MajorRevision.ToString()); * ModLog.Info(" Minor=" + gameVersion.Minor.ToString()); * ModLog.Info(" MinorRevision=" + gameVersion.MinorRevision.ToString()); * ModLog.Info(" Build=" + gameVersion.Build.ToString()); */ /* * // TESTING: (they seem to be the same) * if (MyAPIGateway.Session.IsServer) * ModLog.Info("MyAPIGateway.Session.IsServer.IsServer"); * else * ModLog.Info("MyAPIGateway.Session.NOT Server"); * if (MyAPIGateway.Multiplayer.IsServer) * ModLog.Info("MyAPIGateway.Multiplayer.IsServer"); * else * ModLog.Info("MyAPIGateway.Multiplayer.NOT Server"); */ bool bResearch = Session.SessionSettings.EnableResearch; // This works to change the setting. Session.SessionSettings.EnableResearch = true; Session.SessionSettings.EnableBountyContracts = false; // SE V1.192 if ((gameVersion.Major == 1 && gameVersion.Minor >= 192) || gameVersion.Major > 1) { ModLog.Info("Economy items enabled"); CargoType.AllowEconomyItems(); } if (!bResearch) { // MyAPIGateway.Utilities.ShowNotification("Save, then Exit. Edit world /Advanced settings and Enable progression", 50000, MyFontEnum.Red); ModLog.Info("Research was not turned on"); } TextAPI = new HudAPIv2(); if (modBuildWhenGameStarted > 4) { DuckUtils.PutPlayerIntoFaction("CRASH"); } researchControl = new ResearchControl(audioSystem); researchControl.InitResearchRestrictions(); researchHacking = new ResearchHacking(researchControl, TextAPI, networkComms); networkComms.Init(audioSystem, researchControl, researchHacking); modSystemRegistry.AddCloseableModSystem(networkComms); modSystemRegistry.AddUpatableModSystem(audioSystem); MyAPIGateway.Utilities.MessageEntered += MessageEntered; }