Jump to content

Photo

Oven script extension, help please


  • Please log in to reply
1 reply to this topic

#1
AncientSion

AncientSion

    Enthusiast

  • Members
  • PipPip
  • 124 posts

So, there is a mod that makes ovens useable.

 

 

http://newvegas.nexu....com/mods/35334

 

 

 

I checked the script and what it does is checking for 4 cases, either the oven works, or you need to repair it, or you need fuel or you need fuel and repair.

What i want is to add a 5th case in which the oven simly does not work. I can add the correct messages myself, but i dont know about the script.

 

 

Can someone please help me in adding code that adds a fifth case that links to a message (like "ovennotwork") which simply shows the message and quits the menu ?

The odds arent important, i can fix them myself, i just want a fifth case that pops up a message of my liking and stops the whole thingy.

 

thank you.

 

 

 

scn PovOvenScript



short WorkingChance

short GasChance

short OvenState ;//value from 0 to 4, 0=AutoDoOnce, 1=Working, 2=NeedsRepair, 3=NeedsGas 4=NeedsBoth

short MenuState ;// value from 0 to 4, 0=DoNothing, 1=WorkingMsg, 2=NeedsRepair/Gas, 3=NeedsGas

short nButton ;// -1=Wait Input 0=OptionA 1=OptionB 2=Leave Alone

ref user



BEGIN OnActivate

        Set User to GetActionRef

        Set nButton to -1

        

        If GetActionRef != Player

                User.Activate

                return

        elseif GetActionRef == Player

                if OvenState == 1

                        set MenuState to 1

                        showmessage PovOvenMessageCraftingReady

                elseif OvenState == 3

                        set MenuState to 3

                        ShowMessage PovOvenMessageNoGas

                elseif OvenState == 2 || 4

                        set MenuState to 2

                        ShowMessage PovOvenMessageNoWork

                endif

        endif

END



BEGIN GameMode



if GetInSameCell Player == 0

        Return

endif



;// Runs this once when playet enters cell, determines the state of the oven

if OvenState == 0

        set WorkingChance to GetRandomPercent + (player.getav Luck * 4)

        set GasChance to GetRandomPercent + (player.getav Luck * 4)

        if WorkingChance >= 60 && GasChance >= 68

                Set OvenState to 1

        elseif WorkingChance < 60 && GasChance >= 68

                Set OvenState to 2

        elseif WorkingChance >= 60 && GasChance < 68

                Set OvenState to 3

        elseif WorkingChance < 60 && GasChance < 68

                Set OvenState to 4

        endif

endif



;// Everything Works

;// 0 Cook Stuff (if you have gear works if not sends message)

;// 1 Open Oven

;// 2 Leave Alone

if MenuState == 1

        set nButton to GetButtonPressed

        if nButton == 0

                player.showrecipemenu CampfireRecipes

        elseif nButton == 1

                activate

        endif

set MenuState to 0

endif



;// Needs Repair and Pilot light to work

;// 0 Open Stove

;// 1 Repair Stove

;// 2 Leave Alone

If MenuState == 2

        set nButton to GetButtonPressed

        if nButton == 0

                activate

        elseif nButton == 1

                if player.getitemcount PilotLight >= 1

                        if player.getav repair >= 50 || player.getav survival >= 50

                                ;//Succes: Skills OK

                                If OvenState == 2

                                        set OvenState to 1

                                elseif OvenState == 4

                                        set OvenState to 3      

                                endif

                                player.removeitem PilotLight 1

                                playsound UIRepairWeapon

                                playsound WPNFlamerJam

                          rewardxp 10

                        elseif player.getav repair < 50 && player.getav survival < 50

                                ;//Fail: Insufficient Skill

                                playsound WPNBreak

                                showmessage PovOvenMessageNoSkill

                        endif

                elseif player.getitemcount PilotLight < 1

                        ;//Fail: No Pilot Light

                        playsound WPNBreak

                        showmessage PovOvenMessageNoPilot

                endif

        endif

set MenuState to 0

endif



;// Needs Gas to work

;// 0 Open Stove

;// 1 Fill Stove

;// 2 Leave Alone

If MenuState == 3

        set nButton to GetButtonPressed

        if nButton == 0

                activate

        elseif nButton == 1

                if player.getitemcount ammoflamerfuel >= 10

                        ;//Succes: Filled with 10 flamer gas

                        player.removeitem ammoflamerfuel 10

                        playsound WPNIncineratorJam

                        playsound WPNFlamerReload

                        set OvenState to 1

                elseif player.getitemcount ammoflamerfuel < 10

                        playsound WPNKnifeSwitchbladeUnequip

                        showmessage PovOvenMessageNoFuel

                endif

        endif

set MenuState to 0

endif



END

Edited by AncientSion, 05 April 2013 - 05:06 PM.


#2
AncientSion

AncientSion

    Enthusiast

  • Members
  • PipPip
  • 124 posts

Come on...






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Page loaded in: 0.963 seconds