Jump to content

[Script] Event for Workshop Mode Enter


Zorkaz

Recommended Posts

One would hope that it was as simple as Event OnMenuOpenCloseEvent(string asMenuName, bool abOpening) on "WorkshopMenu" but I found that unreliable so had to hand roll a more complicated solution;

	WorkshopScript[] WorkshopREFs = (pWorkshopParent as WorkshopParentScript).Workshops
	Int iIndex = 0 
	While (iIndex < WorkshopREFs.Length)
		Self.RegisterForRemoteEvent(WorkshopREFs[iIndex] , "OnWorkshopMode") 
		iIndex +=1
	Endwhile

This needs to run every OnPlayerLoadGame to include any DLC and mod added registered workshops.

Event ObjectReference.OnWorkshopMode(ObjectReference ThisWorkshopRef, bool bStart)
   ;do stuff
EndEvent

If you also need to trap standalone non registered workshops then you need to detect their object references (many different ways to do that) and add registrations for them.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...