Jump to content

Nuka Vending Machine Bug


Rembo

Recommended Posts

Before I start my post, I'd just like to say I've tried looking around the forums for an answer to my question, since I KNOW people have solved it, and it could be on here... But I didn't find it, so here I am, bugging you with the following question.

 

I've made a little house mod for myself, nothing fancy, but I keep running into this little snag. My Pristine vending machine is busted... It's the standard bug I've seen quie a few posts about, namely the script takes my nukas, but doesn't add any ice cold ones to my vending machine... I've looked over the scripts for it, and I mostly get how they work, since I have some programming experience (c++ mainly), but I do not see what is going wrong with it.

 

As I stated above, I know others have had this problem, and have fixed it, but nowhere have I found a description of how exactly they did it... So, if anyone could help me, or point me in the right direction, I would be much obliged :thanks:

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

I guess you just copied one of the default player machines?

 

scn HD01NukaVendingMachineScript

;This script is designed to handle the Nuka-Cola Machine that the Player buys for his house
;The Player can add Nuka-Colas to the machine and have them changed to Ice-Cold Nuka-Colas
;He can then dispense them as he wants to take some or drink them

short Button
short NukasOnMe
short GoNuka


begin OnActivate

if ( IsActionRef Player == 1 )
	if ( Player.GetItemCount NukaCola >= 1 )
		ShowMessage HD00NukaMachineWith
		set GoNuka to 2
	elseif ( Player.GetItemCount NukaCola < 1 )
		ShowMessage HD00NukaMachineWithout
		set GoNuka to 1
	endif	
endif

end

begin gamemode

set Button to GetButtonPressed

if ( Button == 0 ) && ( GoNuka >= 1 )
	Activate
	set GoNuka to 0
elseif ( Button == 1 ) && ( GoNuka == 2 )
	set NukasOnMe to ( Player.GetItemCount NukaCola )
	Player.RemoveItem NukaCola NukasOnMe
	HD01NukaMachineRef.AddItem MS05IceNukaCola NukasOnMe
	set NukasOnMe to 0
	set GoNuka to 0
elseif ( Button == 1 ) && ( GoNuka == 1 )
;Do Nothing
	set GoNuka to 0
elseif ( Button == 2 ) && ( GoNuka == 2 )
;Do Nothing
	set GoNuka to 0
endif

end

 

scn HD02NukaVendingMachineScript

;This script is designed to handle the Nuka-Cola Machine that the Player buys for his house
;The Player can add Nuka-Colas to the machine and have them changed to Ice-Cold Nuka-Colas
;He can then dispense them as he wants to take some or drink them

short Button
short NukasOnMe
short GoNuka


begin OnActivate

if ( IsActionRef Player == 1 )
	if ( Player.GetItemCount NukaCola >= 1 )
		ShowMessage HD00NukaMachineWith
		set GoNuka to 2
	elseif ( Player.GetItemCount NukaCola < 1 )
		ShowMessage HD00NukaMachineWithout
		set GoNuka to 1
	endif	
endif

end

begin gamemode

set Button to GetButtonPressed

if ( Button == 0 ) && ( GoNuka >= 1 )
	Activate
	set GoNuka to 0
elseif ( Button == 1 ) && ( GoNuka == 2 )
	set NukasOnMe to ( Player.GetItemCount NukaCola )
	Player.RemoveItem NukaCola NukasOnMe
	HD02NukaMachineRef.AddItem MS05IceNukaCola NukasOnMe
	set NukasOnMe to 0
	set GoNuka to 0
elseif ( Button == 1 ) && ( GoNuka == 1 )
;Do Nothing
	set GoNuka to 0
elseif ( Button == 2 ) && ( GoNuka == 2 )
;Do Nothing
	set GoNuka to 0
endif

end

 

Note how these scripts make reference to "HD01NukaMachineRef" and "HD02NukaMachineRef". Your Nuka Vending machine needs to be similar. Just make a copy one of the vending machine objects (in the object window) and give it a script that works with your machine's reference ID.

Link to comment
Share on other sites

all you have to do is give the nukamachine a refname in the id after you placed it in the house.

 

fill in where now stands hd01nukamachineref your ref name in the script.

 

this is to let the script connect to your nuka machine.

 

if this isn't working then pm me, i got two houses with nukamacines in it both working perfectly.

 

;This script is designed to handle the Nuka-Cola Machine that the Player buys for his house

;The Player can add Nuka-Colas to the machine and have them changed to Ice-Cold Nuka-Colas

;He can then dispense them as he wants to take some or drink them

 

these lines don't have to be there actually. :thumbsup:

Link to comment
Share on other sites

  • 12 years later...
  • Recently Browsing   0 members

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