SKKmods Posted March 4, 2018 Share Posted March 4, 2018 Dear mod authors, having published a new game fast start mod with 80k actives that enables many new games to be started (rather than re-cycling the same old vault exit savegame) I have received much correspondence from users about your mods that add items to the player inventory on startup disappearing. The base game clears the player inventory between pre-war sanctuary and vault 111 (MQ101 quest fragment line 1722 RemoveAllItems). Whilst my mod does not clear the player inventory out of courtesy, some mods are stuffing the player inventory before it is even active around the looks menu. When you are next creating or updating mods which stuff holotapes and such in the player inventory, I would suggest a test to check that MQ101 has completed. Thank-You. Int iHolotapeTimer = 1 Event OnInit() If pMQ101.IsCompleted() == True ; new game player has left prewar GiveHolotape("OnInit") Else StartTimer(60,iHolotapeTimer) EndIf EndEvent Event OnTimer(int iTimer) If (iTimer == iHolotapeTimer) If pMQ101.IsCompleted() == True ; new game player has left prewar GiveHolotape("OnTimer") Else StartTimer(60,iHolotapeTimer) EndIf Endif EndEvent Link to comment Share on other sites More sharing options...
FlashyJoer Posted March 4, 2018 Share Posted March 4, 2018 (edited) Even better, use MQ102 stage 10, which is the stage set the moment the elevator reaches the top on Vault Exit. This is what I personally use. Scriptname StartMeUp extends QuestQuest Property MQ102 AutoQuest Property WhateverQuest auto Event OnQuestInit() While MQ102.IsStageDone(10) == False Utility.Wait(1) ; waiting until player successfully leaves the vault EndWhile WhateverQuest.Start() <--- quest that adds item to player inventoryEndEvent Edited March 4, 2018 by joerqc Link to comment Share on other sites More sharing options...
kitcat81 Posted March 4, 2018 Share Posted March 4, 2018 This not really very good if you have lots of such mods checking the same thing every second. No reason to use timers when you can use events. Link to comment Share on other sites More sharing options...
SKKmods Posted March 4, 2018 Author Share Posted March 4, 2018 Even better, use MQ102 stage 10, which is the stage set the moment the elevator reaches the top on Vault Exit. This is what I personally use. The issue with MQ102 Stage 10 is that some mods are active in V111 so the player needs tapes on cryo wakeup. Link to comment Share on other sites More sharing options...
SKKmods Posted March 4, 2018 Author Share Posted March 4, 2018 This not really very good if you have lots of such mods checking the same thing every second. No reason to use timers when you can use events. I would agree that 1 second wait polling is over aggressive, I have 10 SKK mods alone that would be waiting to stuff holotapes and weapons, all of them polling every second is a bit much. Whilst Wait() is less good than OnTimer() which is not as elegant as OnStageSet, lets not be elite about this. Start with easy and accessible, rather than best ever, solutions. Link to comment Share on other sites More sharing options...
Evangela Posted March 4, 2018 Share Posted March 4, 2018 (edited) Probably can track when the player "moves", through load screens and specifically when the player is moved in mq101 stage 900 where their inventory is dumped, by using OnPlayerTeleport. So it's a matter of checking for moves(load screens, and elevators, like the vault elevator), and add items then. Obviously move it to a "done" state afterwards, otherwise, the event will fire indefinitely for every instance of moving. Basically, don't mess with the inventory before or on mq101 stage 900. This would be the route I would take, but I generally don't do things with the player inventory on game start. Edited March 4, 2018 by Rasikko Link to comment Share on other sites More sharing options...
ThoraldGM Posted March 4, 2018 Share Posted March 4, 2018 Also be aware that alt starts like Start Me Up bypass Vault111Ext completely. BigAndFlabby wrote a nice function for Hitchhiker that adds the holotape and magazine to inventory: https://github.com/ThoraldGM/Hitchhiker/blob/master/HH_LaunchScript.psc Link to comment Share on other sites More sharing options...
DracoInvictus1 Posted March 4, 2018 Share Posted March 4, 2018 As a mod author who doesn't add anything to inventory, the back end of this is way over my pay grade. It is great to see modders thinking about this though because as a console player (XB1), it sucks having to be incredibly careful with my mod selection on new character start because it will crash my game if I have a mod enabled that adds inventory before vault exit. Then, once I've gone through my intro and exited the vault. I have to save, quit, enable the mods I wanted to use, let fallout restart, then load my save. Link to comment Share on other sites More sharing options...
JonathanOstrus Posted March 4, 2018 Share Posted March 4, 2018 What ThoraldGM said. The way I wrote that was to check if we're ready first, if so then stuff the inventory. If not, then grab location changes. Since at the start of a new game there's only a couple of location changes it doesn't fire often and after a few times (way less than a while loop on a wait timer) it will be true and finish up. Of course the way I've written that routine expects the player will have the PipBoy. Which unless an alternate start mod is bad, the player would have if they chose one of those. For quick reference the 3 locations I compare against to ignore are:PrewarSanctuaryHillsLocation, PrewarVault111Location, and Vault111Location It really isn't absolutely necessary to check location against the ignore list as the only other check it does is for the PipBoy. Originally I was using a different check than the PipBoy but decided that was more reliable. Since you don't get the PipBoy until either you are exiting the Vault, which the next location check would pass anyway, or with an alt start mod the first location check will usually pass. That seemed like the best point at which to auto load the player's inventory with stuff. Link to comment Share on other sites More sharing options...
kitcat81 Posted March 4, 2018 Share Posted March 4, 2018 (edited) This not really very good if you have lots of such mods checking the same thing every second. No reason to use timers when you can use events. I would agree that 1 second wait polling is over aggressive, I have 10 SKK mods alone that would be waiting to stuff holotapes and weapons, all of them polling every second is a bit much. Whilst Wait() is less good than OnTimer() which is not as elegant as OnStageSet, lets not be elite about this. Start with easy and accessible, rather than best ever, solutions. It's not a big deal when you have just few of them and hopefully you won't get any functions fail. But you can also use a less consiming way. It's not difficult or elite, just another way. BiggAndFlabby script can do this without timer loops too. And as someone else suggested using OnLocationChange together with checking the stage works as a charm. I can offer my version just as a possible alternative. It's from my mod and proved to work with no issues. Keyword Property LocSetVault Auto Const Quest Property MQ102 Auto Const bool Registered = false Event OnQuestInit() utility.Wait(2) If MQ102.IsStageDone(10) StartSetUp() Else RegisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange") EndIf EndEvent Function StartSetUp() Registered = true ; do my stuff(i.e. add item etc) EndFunction Event Actor.OnLocationChange(Actor akActor, Location akOldLoc, Location akNewLoc) If MQ102.IsStageDone(10) If akNewLoc && !akNewLoc.HasKeyword(LocSetVault); if we have left the Vault location UnregisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange") StartSetUp() EndIf EndIf EndEvent Edited March 5, 2018 by kitcat81 Link to comment Share on other sites More sharing options...
Recommended Posts