Jump to content

Link craftable Activator to Workshop Workbenchi


Recommended Posts

hi everyone,

I hope you guys can help me out .

So i was able to make a custom craftable Activator and

link it to a specific workshop workbench with this script: using CK

Scriptname DCF_SupplyBoxFactoryScript extends ObjectReference



ObjectReference Property MasterContainer Auto

auto STATE closedPosition
	EVENT onActivate(objectReference triggerRef)
 		gotoState("busy")
		
		; Wait for the open animation to complete.
		Utility.wait(0.1)
		
		; Activate the Master Container.
		MasterContainer.activate(Game.getPlayer())

		; Wait till the Inventory Menu closes. The wait function pauses when the game is in menu mode.
		Utility.wait(0.1)
		
		; Set the container as opened and re-activate it to end the animation.
		gotoState("openedPosition")
		Self.activate(Game.getPlayer())
	endEVENT
endSTATE

STATE busy
	EVENT onActivate(objectReference triggerRef)
		; Do Nothing.
	endEVENT
endSTATE

STATE openedPosition
	EVENT onActivate(objectReference triggerRef)
		; Perform the closing container animation and sound.
		gotoState("busy")
		Utility.wait(0.01)
		gotoState("closedPosition")
	endEVENT
endSTATE 

So it's exactly what i want and that is to be able share resources from everywhere with a specific Workshop Workbench with a custom craftable Activator.

It's working fine only one problem is that when i activate it, it start also the workshop mode , How can i get rid of that and have only the inventory menu open?

(or maybe someone can fix it for me if i upload my mod... )

I include video link so you understand better what i mean.

Link to the Video

Edited by H3S
Link to comment
Share on other sites

I do something very similar to what you're wanting to do in the Transfer Items feature of my Workshop Control Panel mod. This feature allows you to remotely access the workshop workbench of any settlement that you have connected via supply line. It looks like you're activating the workbench, in which case you need to set the abDefaultProcessingOnly parameter value of the Activate() function to true. You currently have it set to false because you have not included it in your script.

 

So, for example, I do this:

AbernathyFarm.Activate(akActivator = PlayerRef, abDefaultProcessingOnly = True)
Edit: This happens because a script is attached to the workshop workbench that starts workshop mode when you activate it. The abDefaultProcessingOnly parameter allows you to avoid triggering the activate event that the script detects.
Link to comment
Share on other sites

  On 8/26/2018 at 8:07 PM, KernalsEgg said:

I do something very similar to what you're wanting to do in the Transfer Items feature of my Workshop Control Panel mod. This feature allows you to remotely access the workshop workbench of any settlement that you have connected via supply line. It looks like you're activating the workbench, in which case you need to set the abDefaultProcessingOnly parameter value of the Activate() function to true. You currently have it set to false because you have not included it in your script.

 

So, for example, I do this:

AbernathyFarm.Activate(akActivator = PlayerRef, abDefaultProcessingOnly = True)
Edit: This happens because a script is attached to the workshop workbench that starts workshop mode when you activate it. The abDefaultProcessingOnly parameter allows you to avoid triggering the activate event that the script detects.

 

Thnx for your reply :thumbsup:

i'm not good in scripting and new in modding this is my first mod.

So i would very much appreciate it if you can explain me where i can find that line of script or where to put it.

Should i put it in the script that i use or new one or somewhere else i realy don't know ? :unsure:

Link to comment
Share on other sites

All I'm saying is set the abDefaultProcessingOnly parameter to true when you activate the workshop workbench. Doing this will mean that workshop mode will not start, but you will still be able to open the workshop workbench container. Going by your script, change the following line:

MasterContainer.activate(Game.getPlayer())

To this:

MasterContainer.Activate(akActivator = Game.GetPlayer(), abDefaultProcessingOnly = True)

You don't need to include the parameter names if you don't want to.

Link to comment
Share on other sites

  On 8/27/2018 at 3:46 PM, KernalsEgg said:

All I'm saying is set the abDefaultProcessingOnly parameter to true when you activate the workshop workbench. Doing this will mean that workshop mode will not start, but you will still be able to open the workshop workbench container. Going by your script, change the following line:

MasterContainer.activate(Game.getPlayer())

To this:

MasterContainer.Activate(akActivator = Game.GetPlayer(), abDefaultProcessingOnly = True)

You don't need to include the parameter names if you don't want to.

WoW it's working thank you very much :thumbsup: two months i was looking on forums and internet for a solution

could not find one and almost give up now you give me a simple and fast (GOLDEN) solution. Finely YES :dance:

:cool: H A V E A N I C E D A Y :cool:

Edited by H3S
Link to comment
Share on other sites

  • Recently Browsing   0 members

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