The Nexus Forums: Help with a script. - The Nexus Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help with a script.

#1 User is offline   Erikdeda1 

  • Enthusiast
  • PipPip
  • Group: Members
  • Posts: 105
  • Joined: 09-January 08

Posted 07 November 2009 - 10:30 AM

This is the StealthArmorMKII mod night vision script but the recharging menu annoys me; so how do i disable power drain and the popping up menu?

scn NVNightVisionQScript

;================================
;Mr. Lab Technician - Quest control script for creating chemicals
;Marvin Raymakers
;mrslackpants@gmail.com
;================================

short KeyCD
short KeyCD1
short DoOnce
short Initialize
short MaxPower
short DoOnce0
short DoOnce25
short DoOnce50
short DoOnce75
short DoOnce100
short GogglesPower
short GoggleRecharge
short AutoCharge
short UseEndurable
short AutoChargeButton
short SECPower
short MFCPower
short ECPPower
short FiBPower
float fBatteryPower
short DrainPower
short ShowMenu
short UnlockPowers
short IncExcl
short ExcludeSEC
short ExcludeMFC
short ExcludeECP
short ExcludeFiB

begin gamemode
; Called by equiping the goggles
if ( UnlockPowers == 1 )
if ( ShowMenu == -1 )
ShowMessage GoggleRechargeMsg
Set GoggleRecharge to -1
Set ShowMenu to 0
endif
; Poweramounts for the different sources
if ( Initialize == 0 )
Set Initialize to 1
Set SECPower to 90
Set MFCPower to 300
Set ECPPower to 600
Set FiBPower to 1200
endif
;================================ NIGHTVISION FUNCTION ================================
; FOSE command for the "N" key
if ( IsKeyPressed 49 )
if ( KeyCD == 0 )
if ( Player.IsImageSpaceActive NVGogglesISM == 1 ) ; Has nightvision?
Set DrainPower to 0 ; Stop power draining
Player.rimod NVGogglesISM ; remove nightvision
PlaySound UIPipBoyLightOff
elseif ( Player.IsImageSpaceActive NVGogglesISM == 0 ) ; Nightvision not active?
if ( GogglesPower == 0 ) ; No power left?
ShowMessage GoggleRechargeMsg ; Show menu for recharging
Set GoggleRecharge to -1
else
Set DrainPower to -1 ; otherwise start draining power and turn on nightvision
Player.imod NVGogglesISM
PlaySound UIPipBoyLightOn
endif
endif
Set KeyCD to 1
endif
elseif ( KeyCD == 1 )
Set KeyCD to 0
endif
; Recharging Menu
if ( GoggleRecharge == -1 )
Set GoggleRecharge to GetButtonPressed
Set DoOnce to 0
if ( GoggleRecharge == 0 )
return
elseif ( GoggleRecharge == 1 ) ; Following is just the player choice of what to recharge with + setting the power to its max again
if ( fBatteryPower < 10 )
Player.RemoveItem AmmoSmallEnergyCell 10 1
Set MaxPower to SECPower
Set fBatteryPower to SECPower
Set GogglesPower to 1
ShowMessage GogglesPoweredMsg
else
ShowMessage StillSomePowerLeftMsg ; If there's still some power left, you cant recharge yet. (though this is also controlled by a condition set on the messagebox itself)
endif ; So you probably wont see this messagebox ever
elseif ( GoggleRecharge == 2 )
if ( fBatteryPower < 10 )
Player.RemoveItem AmmoMicroFusionCell 5 1
Set MaxPower to ECPPower
Set fBatteryPower to ECPPower
Set GogglesPower to 1
ShowMessage GogglesPoweredMsg
else
ShowMessage StillSomePowerLeftMsg
endif
elseif ( GoggleRecharge == 3 )
if ( fBatteryPower < 10 )
Player.RemoveItem AmmoElectronChargePack 2 1
Set MaxPower to ECPPower
Set fBatteryPower to ECPPower
Set GogglesPower to 1
ShowMessage GogglesPoweredMsg
else
ShowMessage StillSomePowerLeftMsg
endif
elseif ( GoggleRecharge == 4 )
if ( fBatteryPower < 10 )
Player.RemoveItem FissionBattery 1 1
Set MaxPower to FiBPower
Set fBatteryPower to FiBPower
Set GogglesPower to 1
ShowMessage GogglesPoweredMsg
else
ShowMessage StillSomePowerLeftMsg
endif
elseif ( GoggleRecharge == 5 ) ; Auto charge sub-menu
ShowMessage AutoChargeOnMsg
Set AutoChargeButton to -1
endif
endif

if ( AutoChargeButton == -1 ) ; Sub-menu for auto charging
Set AutoChargeButton to GetButtonPressed
if ( AutoChargeButton == 0 )
Set UseEndurable to -1
Set AutoCharge to -1
ShowMessage AutoChargeA
elseif ( AutoChargeButton == 1 )
Set UseEndurable to 1
Set AutoCharge to -1
ShowMessage AutoChargeB
elseif ( AutoChargeButton == 2 )
ShowMessage IncExclMenuMsg
Set IncExcl to -1
elseif ( AutoChargeButton == 3 )
Set AutoCharge to 0
if ( Player.IsImageSpaceActive NVGogglesISM == 1 ) ; i added this to prevent an exploit, though it's probably obsolete as the mod is now.
Set DrainPower to -1
endif
ShowMessage AutoChargeOffMsg
endif
endif

if ( IncExcl == -1 )
Set IncExcl to GetButtonPressed
if ( IncExcl == 0 )
ShowMessage AutoChargeOnMsg
Set AutoChargeButton to -1
elseif ( IncExcl == 1 )
if ( ExcludeSEC == 1 )
Set ExcludeSEC to 0
else
Set ExcludeSEC to 1
endif
ShowMessage IncExclMenuMsg
Set IncExcl to -1
elseif ( IncExcl == 2 )
if ( ExcludeMFC == 1 )
Set ExcludeMFC to 0
else
Set ExcludeMFC to 1
endif
ShowMessage IncExclMenuMsg
Set IncExcl to -1
elseif ( IncExcl == 3 )
if ( ExcludeECP == 1 )
Set ExcludeECP to 0
else
Set ExcludeECP to 1
endif
ShowMessage IncExclMenuMsg
Set IncExcl to -1
elseif ( IncExcl == 4 )
if ( ExcludeFiB == 1 )
Set ExcludeFiB to 0
else
Set ExcludeFiB to 1
endif
ShowMessage IncExclMenuMsg
Set IncExcl to -1
elseif ( IncExcl == 5 )
ShowMessage IncExclOverviewMsg, ExcludeSEC, ExcludeMFC, ExcludeECP, ExcludeFiB
Set IncExcl to -1
ShowMessage IncExclMenuMsg
endif
endif

if ( DrainPower == -1 ) ; the power draining script with message to how much power is left.
if fBatteryPower > 0
Set fBatteryPower to fBatteryPower - GetSecondsPassed
if ( fBatteryPower <= ( MaxPower * 0.25 ) ) && ( DoOnce == 2 )
Set DoOnce to 3
ShowMessage NVGogglesDrain25
elseif ( fBatteryPower <= ( MaxPower * 0.5 ) ) && ( DoOnce == 1 )
Set DoOnce to 2
ShowMessage NVGogglesDrain50
elseif ( fBatteryPower <= ( MaxPower * 0.75 ) ) && ( DoOnce == 0 )
Set DoOnce to 1
ShowMessage NVGogglesDrain75
endif
elseif ( DoOnce == 3 ) ; When power is used up, this happens, though if you have auto charging on, this part never turns true
ShowMessage NVGoggles0 ; So goggles will stay on with auto charge. Handy. :)
Set GogglesPower to 0 ; With auto charging on, this will only happen when player runs out of power sources
Set DoOnce to 4 ; Usualy power is recharged BEFORE power runs out
Player.rimod NVGogglesISM
PlaySound UIPipBoyLightOff
Set DrainPower to 0
endif
endif
; AmmoSmallEnergyCell, AmmoMicroFusionCell, AmmoElectronChargePack, FissionBattery
if ( AutoCharge == -1 ) ; Auto charge is on
if ( UseEndurable == -1 ) ; Option A
If fBatteryPower <= ( MaxPower * 0.02 )
Set DoOnce to 0
if ( Player.GetItemCount AmmoSmallEnergyCell >= 10 ) && ( ExcludeSEC == 0 ) ; The script will first check this and remove it if player has it
Player.RemoveItem AmmoSmallEnergyCell 10 1
Set MaxPower to SECPower
Set fBatteryPower to SECPower
Set GogglesPower to 1
ShowMessage NVAutoChargedMsg
elseif ( Player.GetItemCount AmmoMicroFusionCell >= 5 ) && ( ExcludeMFC == 0 ) ; Otherwise it will remove this.
Player.RemoveItem AmmoMicroFusionCell 5 1
Set MaxPower to ECPPower
Set fBatteryPower to ECPPower
Set GogglesPower to 1
ShowMessage NVAutoChargedMsg
elseif ( Player.GetItemCount AmmoElectronChargePack >= 2 ) && ( ExcludeECP == 0 ) ; etc.
Player.RemoveItem AmmoElectronChargePack 2 1
Set MaxPower to ECPPower
Set fBatteryPower to ECPPower
Set GogglesPower to 1
ShowMessage NVAutoChargedMsg
elseif ( Player.GetItemCount FissionBattery >= 1 ) && ( ExcludeFiB == 0 ) ; etc.
Player.RemoveItem FissionBattery 1 1
Set MaxPower to FiBPower
Set fBatteryPower to FiBPower
Set GogglesPower to 1
ShowMessage NVAutoChargedMsg
else
Set AutoCharge to 0 ; If no sources are found a message is displayed.
ShowMessage AutoChargeDisabledMsg
endif
endif
elseif ( UseEndurable == 1 ) ; Option B
If fBatteryPower <= ( MaxPower * 0.02 )
Set DoOnce to 0
if ( Player.GetItemCount FissionBattery >= 1 ) && ( ExcludeFiB == 0 )
Player.RemoveItem FissionBattery 1 1
Set MaxPower to FiBPower
Set fBatteryPower to FiBPower
Set GogglesPower to 1
ShowMessage NVAutoChargedMsg
elseif ( Player.GetItemCount AmmoElectronChargePack >= 2 ) && ( ExcludeECP == 0 )
Player.RemoveItem AmmoElectronChargePack 2 1
Set MaxPower to ECPPower
Set fBatteryPower to ECPPower
Set GogglesPower to 1
ShowMessage NVAutoChargedMsg
elseif ( Player.GetItemCount AmmoMicroFusionCell >= 5 ) && ( ExcludeMFC == 0 )
Player.RemoveItem AmmoMicroFusionCell 5 1
Set MaxPower to ECPPower
Set fBatteryPower to ECPPower
Set GogglesPower to 1
ShowMessage NVAutoChargedMsg
elseif ( Player.GetItemCount AmmoSmallEnergyCell >= 10 ) && ( ExcludeSEC == 0 )
Player.RemoveItem AmmoSmallEnergyCell 10 1
Set MaxPower to SECPower
Set fBatteryPower to SECPower
Set GogglesPower to 1
ShowMessage NVAutoChargedMsg
else
Set AutoCharge to 0
ShowMessage AutoChargeDisabledMsg
endif
endif
endif
endif
endif
end
0

#2 User is offline   csb 

  • Old hand
  • PipPipPip
  • Group: Members
  • Posts: 665
  • Joined: 28-April 08

Posted 08 November 2009 - 05:54 AM

Comment out the lines dealing with ShowMenu and ShowMessage. For the power thing, just keep it a constant value.
0

#3 User is offline   Erikdeda1 

  • Enthusiast
  • PipPip
  • Group: Members
  • Posts: 105
  • Joined: 09-January 08

Posted 08 November 2009 - 06:31 PM

Damn it...every time I try to delete a line and try to save it complains and won't save...more help :biggrin: ? :thanks:
0

#4 User is offline   Erikdeda1 

  • Enthusiast
  • PipPip
  • Group: Members
  • Posts: 105
  • Joined: 09-January 08

Posted 10 November 2009 - 06:16 PM

bump
0

#5 User is offline   Erikdeda1 

  • Enthusiast
  • PipPip
  • Group: Members
  • Posts: 105
  • Joined: 09-January 08

Posted 12 November 2009 - 04:31 PM

bump
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Skin by Skinbox
Quality & cheap IPB skins, premade vBulletin styles, cheap Web templates and more! - Skinbox