Jump to content

need some help with a vending machine


redfandango

Recommended Posts

so i'm making a shelter and i have some vending machine models, however i have no idea how to get them to work.
Does anyone by any chance have a script to automatically open a store when you interact with an object? (as with regular FO4 vendors)

 

(this is the vending machine model)

d79fa5c79d2fa6147eacd5d8832c7ad7.jpg

Link to comment
Share on other sites

Hello redfandango,

 

As Zorkaz said, the barter menu is tied to actors but what you can do is to create a dummy NPC whose sole purpose is to act as a vendor when your vending machine is activated.

 

1. Create a dummy vendor NPC and a vendor faction.

 

 

 

34555-1630956087-1658507042.png

34555-1630956091-896645092.png

 

 

 

(I have the "essential" and "unique" boxes ticked here, but this is completely unnecessary.)

 

2. Create a dummy interior cell to house this dummy NPC vendor and the vendor chest.

 

 

 

34555-1630956096-432782304.png

 

 

 

The cell doesn't have to be functional. Just something to hold the NPC and the chest.

 

3. Create an activator to access this dummy vendor NPC.

 

 

 

34555-1630956078-668586283.png

 

 

 

The vendor NPC and the activator share the same name for consistency when bringing up the barter menu.

 

4. Attach a script to this activator.

 

 

 

Scriptname DLsSafehouses:UM_VendorTerminalScript extends ObjectReference Const

Actor Property VendorNPC Auto Const

Sound Property SoundFX Auto Const


Event OnActivate(ObjectReference akActionRef)
	If akActionRef == Game.GetPlayer() 
		InputEnableLayer myLayer = InputEnableLayer.Create()
		myLayer.DisablePlayerControls(true, true, true, true, true, true, true, true, true, true, true)
		SoundFX.PlayAndWait(Self)
		myLayer.EnablePlayerControls()
		VendorNPC.ShowBarterMenu() 
	EndIf
EndEvent

34555-1630956082-487359561.png

 

 

 

This script example plays a sound FX, and then opens a barter menu with the dummy vendor NPC. I think I had to disable player control while the sound FX played so that the player won't move once it is activated.

 

Once this thing is activated in game, it will directly show the barter menu associated with the dummy NPC.

 

I hope this helps.

Edited by DiodeLadder
Link to comment
Share on other sites

You may explore Talking Activator

 

AFK. I think interactable intercoms etc. are TalkingActivators.

 

Add a voice type and you can use the the TalkingActivator for quest/dialogue.

 

Also, as everything activator I think the nif must have collision data in order for the activation to work.

 

Fo4:

https://www.creationkit.com/fallout4/index.php?title=TalkingActivator

 

Skyrim (some more info):

https://www.creationkit.com/index.php?title=TalkingActivator

Link to comment
Share on other sites

  • 2 years later...

Since they are not actors it might not be possible. But there are some simple container scripts that could work. Or even better using a messagebox

Hello, 2 years and almost 3 have passed since my last post. Im sorry for being afk all this time.

I've passed alot, but i dont wanna bother you with that...

Amm, im trying to recover my old proyects, this time with more detail than 2y ago. And i was following your tutorial but i got stocked in multiple points:

 

1. i found different tutorials for vendors, but i don't wanna have a vendor as a fo4 normal vendor with four dialogue options. Instead, just go to the machine, interact and pop up the trading menu.

2. i didn't understand the "4. Attach a script to this activator." cos... i don't know how to... sorry... could help me with a more detailed guide?

3. this not a doubt, thanks again for answering this post 2 years ago. Few other ppl have stopped to help me as much as you. I appreciate the guide, but I am quite poorly versed in modding and scripting and cannot properly follow the steps, since most of the gives are huge and im not a native eng. speaker, so... sometimes its hard for me.

Edited by redfandango
Link to comment
Share on other sites

  • Recently Browsing   0 members

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