New or Improved Events - kinggath/WorkshopFramework GitHub Wiki
New or Improved Events
Many events in the Workshop scripts were expanded on to add additional info that I found myself often wanting so that I didn't have to test for it again in some other way. I've also introduced several new events, either in response to existing mechanics, or that were necessary to make new mechanics function.
WorkshopParentScript
WorkshopActorUnassigned - added arg: kArgs[2] = ActorRef (WorkshopNPCScript) WorkshopActorAssignedToWork - added arg: kArgs[2] = ActorRef (WorkshopNPCScript) WorkshopEnterMenu - added arg kArgs[2] = bEnteredWorkshopMode (boolean)
WorkshopRemoveActor - new event: Fired when a settler leaves the settlement, either due to them being sent somewhere else, or because they died (check IsDead()).
kArgs[0] = ActorRef (WorkshopNPCScript) kArgs[1] = workshopRef (WorkshopScript)
WSFW_Main
WorkshopFramework:MainQuest.PlayerEnteredSettlement: Fired when the player enters a settlement, but NOT when they cross cells within the same settlement. This includes a boolean to tell you if the player ever went far enough away to have this settlement unload. That way, if they keep entering and exiting the same settlement without entering a different one in between, you’ll know. For example, if the player is going in and out of the border.
kArgs[0] = workshopRef (WorkshopScript) kArgs[1] = bSettlementUnloadedSinceLastVisit (boolean)
WorkshopFramework:MainQuest.PlayerExitedSettlement: Fired when the player exits a settlement, but NOT when they cross cells within the same settlement. This includes a boolean to tell you if the location is loaded or not. This will fire once each time they leave the settlement border, and one additional time after the cell finally unloads for the last settlement they had been in.
kArgs[0] = workshopRef (WorkshopScript) kArgs[1] = bWorkshopLocationLoaded (boolean)
Others
The new production manager will also fire a new custom event if you register custom consumption via the API.
WorkshopFramework:WorkshopProductionManager.NotEnoughResources - This will fire near the end of the daily production cycle after it is determined that a settlement was unable to consume enough of a custom Consumption Resource that was registered via the API.
kArgs[0] = kWorkshopRef (WorkshopScript) kArgs[1] = ResourceAV (ActorValue) kArgs[2] = ConsumeForm (Form) kArgs[3] = iMissing (Integer)