Jump to content

Scripting Issues


Captain Novolin

Recommended Posts

I'm trying to make a mod that does a thing similar to the vending machine in the megaton house in FO3, but my script won't work for some reason. It just fails to save whenever I hit save or try to exit the script editor. I've looked it over, and had a couple friends look it over, but none of us can figure out what's wrong. Any help would be greatly appreciated.

 

scn zIceColdNuka

;Modified version of the Fallout 3 Nuka-cola Machine Script
;Allows the Player to add and chill Nuka-Colas and Sunset Sarsasparillas
;Jesus Christ why did I decide not to take that compsci course in High school

int Button
int NukasOnMe
int SSOnMe
int GoNuka


begin OnActivate

   if ( IsActionRef Player == 1 )
       if ( Player.GetItemCount NukaCola >= 1 ) && ( Player.GetItemCount SSBottleFull <1 )
           ShowMessage zNukaMachineNoSunsYesNuka 
           set GoNuka to 2
       elseif ( Player.GetItemCount NukaCola < 1 ) && ( Player.GetItemCount SSBottleFull <1 )
           ShowMessage zNukaMachineNothing
           set GoNuka to 1
       elseif ( Player.GetItemCount NukaCola <1 ) && ( Player.GetItemCount SSBottleFull >= 1 )
           ShowMessage zNukaMachineYesSunsNoNuka
           set GoNuka to 3
       elseif ( Player.GetItemCount NukaCola >= 1 ) && ( Player.GetItemCount SSBottleFull >= 1 )
           ShowMessage zNukaMachineBoth
           set GoNuka to 4
       endif    
   endif

end

begin gamemode

   set Button to GetButtonPressed

   if ( Button == 0 ) && ( GoNuka >= 1 )
       Activate
       set GoNuka to 0
   elseif ( Button == 1 ) && ( GoNuka == 2 )            ;Add all nukas
       set NukasOnMe to ( Player.GetItemCount NukaCola ) 
       Player.RemoveItem NukaCola NukasOnMe
       zNukaHouseMachine.AddItem zIceNuka 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
   elseif ( Button == 2 ) && ( GoNuka == 3 )
       ;Do Nothing
       set GoNuka to 0
   elseif ( Button == 4 ) && ( GoNuka == 4 )
       ;Do Nothing
       set GoNuka to 0
   elseif ( Button == 1 ) && ( GoNuka == 3 )            ;Add all Sunset Sarsasparilla
       set SSOnMe to ( Player.GetItemCount SSBottleFull )
       Player.RemoveItem SSBottleFull SSOnMe
       zNukaHouseMachine.additem zIceColdSS SSOnMe
       set SSOnMe to 0
       set GoNuka to 0
   elseif ( Button == 1 ) && ( GoNuka == 4 )
       set NukasOnMe to ( Player.GetItemCount NukaCola )
       Player.RemoveItem NukaCola NukasOnMe
       zNukaHouseMachine.AddItem zIceNuka NukasOnMe
       set NukasOnMe to 0
       set GoNuka to 0
   elseif ( Button == 2 ) && ( GoNuka == 4 )
       set SSOnMe to ( Player.GetItemCount SSBottleFull )
       Player.RemoveItem SSBottleFull SSOnMe
       zNukaHouseMachine.additem zIceColdSS SSOnMe
       set SSOnMe to 0
       set GoNuka to 0
   elseif ( Button == 3 ) && ( GoNuka == 4 )
       ;Add Nuka-Cola
       set NukasOnMe to ( Player.GetItemCount NukaCola )
       Player.RemoveItem NukaCola NukasOnMe
       zNukaHouseMachine.AddItem zIceNuka NukasOnMe
       set NukasOnMe to 0
       ;!---------ADD SS--------!
       set SSOnMe to ( Player.GetItemCount SSBottleFull )
       Player.RemoveItem SSBottleFull SSOnMe
       zNukaHouseMachine.additem zIceColdSS SSOnMe
       set SSOnMe to 0
       set GoNuka to 0
   endif

end

Link to comment
Share on other sites

  • Recently Browsing   0 members

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