Zorkaz Posted May 22, 2022 Share Posted May 22, 2022 How do I properly write OnWorkshopMode() Event OnWorkshopMode(bool aStart) Astart = True If aStart == True TheMarker = Self.PlaceAtNode("SpawnPoint2", SMFMarker, 1, TRUE, FALSE, FALSE, TRUE) Self.setlinkedref (TheMarker, SMFKeyword2) TheMarker.Setlinkedref(Self, SMFKeyword2) Endif EndEventBecause this doesn't work. Even with our without Astart = True Link to comment Share on other sites More sharing options...
SKKmods Posted May 22, 2022 Share Posted May 22, 2022 What are you attaching the script to ? That native event is only received by the Workshop ObjectReference (and attached quest aliases) so any other script will need to registerForRemoteEvent. Link to comment Share on other sites More sharing options...
Zorkaz Posted May 22, 2022 Author Share Posted May 22, 2022 Okay I used it on a movable static that has the workshopobjectscript attached to it. I want to place a dummy marker on a node, so the object has a visible marker when in workshop mode and otherwise not Link to comment Share on other sites More sharing options...
SKKmods Posted May 22, 2022 Share Posted May 22, 2022 What I do for workshops is run a quest which loads the Workshops array into a RefCollectionAlias (referesh every OnPlayerLoad game to catch new DLC/MOD added workshops) and run an OnWorkshopMode() event trigger on that alias. A template: ScriptName MyQuestScript Extends Quest Actor Property pPlayerREF Auto Const Mandatory Quest Property pWorkshopParent Auto Const Mandatory RefCollectionAlias Property Alias_MyWorkshops Auto Const Mandatory Event OnQuestInit() UpdateWorkshops() EndEvent Event Actor.OnPlayerLoadGame(Actor akSender) UpdateWorkshops() EndEvent Function UpdateWorkshops() Self.UnRegisterForRemoteEvent(pPlayerREF, "OnPlayerLoadGame") ObjectReference[] WorkshopList = (pWorkshopParent as WorkshopParentScript).Workshops as ObjectReference Alias_MyWorkshops.AddArray(WorkshopList) Self.RegisterForRemoteEvent(pPlayerREF, "OnPlayerLoadGame") EndFunction ---------------------------------------------------- Scriptname MyWorkshopsAliasScript extends RefCollectionAlias Event OnWorkshopMode(ObjectReference akSender, bool aStart) ;Do stuff EndEvent You could also loop the WorkshopArray and registerforremoteevent your script for each new workshop but thats slower and less maintainable. Link to comment Share on other sites More sharing options...
Zorkaz Posted May 22, 2022 Author Share Posted May 22, 2022 Thank you. I will try that. Link to comment Share on other sites More sharing options...
BlahBlahDEEBlahBlah Posted May 26, 2022 Share Posted May 26, 2022 I also might say to try, if it's just not doing 'anything', a short wait before attempting to place the marker...maybe? I've definitely seen the event itself work (use it in a few different mods myself), so maybe it's either getting stuck timing wise or just not liking what you're trying to do within the event itself (through no faullt off your own, just 'Oof, Papyrus/Engine Freakout! =P ). Link to comment Share on other sites More sharing options...
LarannKiar Posted May 27, 2022 Share Posted May 27, 2022 (edited) Another approach might be to create a quest which is started by the Story Manager Event Node upon "Location Loaded" with Conditions that restrict the event location to a (optionally specific) workshop location. SM Event Node >> Location Loaded >> New Stacked Quest Node. Add the Condition GetEventData to the quest node: Parameter 1: HasKeywordParameter 2: LocationParameter 3: LocTypeWorkshop The quest needs to have a Location Alias (for the location sent by the story manager) and a Reference Alias (for the workshop reference of Location Alias). Use additional alias (Fill Type) Conditions if you want to restrict the location or the workshop reference to specific locations or references, e.g., settlements only, Player Houses only, Sanctuary Hills, etc. And don't forget to uncheck the Run Once flag (Quest Data tab). Quest template: MinRecruitLocationLoadedStub, SM Event Node template: MinRadiantLocationLoadedNode. Location Loaded is not listed on the Creation Kit wiki site. Attach a script with OnWorkshopMode to the Reference Alias. Edited May 27, 2022 by LarannKiar Link to comment Share on other sites More sharing options...
Recommended Posts