Jump to content

Requesting NV Scripting Help - Script Crashes to Desktop.


Recommended Posts

I got the script to be able to recognize a pimp-boy wristband and switch accordingly, but what I can't figure out is how to edit Mick's dialogue to change the pimp-boy to the wristband.

I can find the line in the dialogue editor (Freeside quest) but when I switch to topics the only topic that shows up is the freeside bodyguard topic. If I filter to only Mick's I can find his greeting dialogue but no options to view the lower dialogue and the one where he switches out the pipboys. I also tried to make the pip-boys playable to manually switch but they won't swap. Any Ideas?

 

Here is the current working code, but it requires to use the console to manually unequip the old wristband and equip the pimp wristband. You can't switch them in menu.

scn BIDEpipRemoverSCRIPT

short Phase
short PimpEquipped

short InitMod
short ModKey
short ModKeyState

short PipKeyState
float PipSpamTimer
ref EquippedItem
ref EquippedCondition

short ModMenuActive
short ModMenuButton
short RemapKeyFlag
short KeyRemapBuffer

float KeyTimer

short UninstallFlag

int NVSEcheck

begin Gamemode
	;Check to ensure NVSE is present before the initial removal occurs.
	;Loops continually until NVSE is found or the mod is uninstalled, in case
	;some unreasonable player decides to save after it doesn't work.
	if (NVSECheck == 0)
	;if GetNVSEVersion < 4
		set NVSECheck to GetNVSEVersion 
		return
	endif

	;If the mod has not been initialized, and the player is finished with the Doc.
	if (UninstallFlag == 0 && InitMod == 0 && getStage VMQ01 > 0)
		if player.getEquipped pimpboy
			set PimpEquipped to 1
				if (Phase == 0 && PimpEquipped == 1)
					set ModKey to 48
					player.unEquipItem Pimpboy 1 1
					player.removeItem PipboyGlove 1 1
					player.additem PimpboywristPC 1 1
					player.ShowRepairMenu
					player.EquipItem PimpboywristPC 1 1
					con_closeallmenus
					set InitMod to 1
					set Phase to 1
				elseif (Phase == 1 && PimpEquipped == 1)
					player.unEquipItem Pimpboy 1 1
					player.ShowRepairMenu
					player.EquipItem PimpboywristPC 1 1
					con_closeallmenus
					set InitMod to 1
					set Phase to 0
				endif			
		elseif player.getEquipped pipboy
			set PimpEquipped to 0		
				if (Phase == 0 && PimpEquipped == 0)
					set ModKey to 48
					player.unEquipItem Pipboy 1 1
					player.removeItem PipboyGlove 1 1
					player.additem PipboywristPC 1 1
					player.ShowRepairMenu
					player.EquipItem PipboywristPC 1 1
					con_closeallmenus
					set InitMod to 1
					set Phase to 1
				elseif (Phase == 1 && PimpEquipped == 0)
					player.unEquipItem Pipboy 1 1
					player.ShowRepairMenu
					player.EquipItem PipboywristPC 1 1
					con_closeallmenus
					set InitMod to 1
					set Phase to 0
				endif
		endif	
	endif

	;Mod menu functions.
	if (ModMenuActive == 1)
		set ModMenuButton to getButtonPressed
			if (ModMenuButton == 0)
				set ModMenuActive to 2
				set RemapKeyFlag to 1
				showMessage BIDEpipRemapKey
			elseif (ModMenuButton == 1)
				set UninstallFlag to 1
				set EquippedItem to player.getEquippedObject 2
				if (EquippedItem != 0)
					player.unEquipItem EquippedItem
				endif
				player.removePerk BIDEpipLightPerk
				player.removeItem PipboywristPC 1 1
				player.ShowRepairMenu
				player.equipItem Pipboy 1 1
				con_closeallmenus
				resetPipboyManager
				showMessage BIDEpipUninstall
				set ModMenuActive to 0
				stopQuest BIDEpipRemover
			elseif (ModMenuButton == 2)
				set ModMenuActive to 0
			endif
	elseif (ModMenuActive == 2)
		set RemapKeyFlag to 0
		set ModMenuActive to 0

	;Normal functionality
	elseif (UninstallFlag == 0 && player.getItemCount Pipboy != 0)
		if (PipSpamTimer > 0)
			set PipSpamTimer to PipSpamTimer - getSecondsPassed
		endif

		if (isControlPressed 14 == 1 && PipKeyState == 0 && PipSpamTimer <= 0)
			set pipKeyState to 1
		endif
	
		;Pip-Boy light and options menu callup functionality
		if (isKeyPressed ModKey == 1 && KeyTimer < 3)
			set KeyTimer to KeyTimer + getSecondsPassed
			set ModKeyState to 1
		elseif (KeyTimer >= 3)
			showMessage BIDEpipOptions
			set ModMenuActive to 1
			set KeyTimer to 0
			set ModKeyState to 0
		elseif (isKeyPressed ModKey == 0 && KeyTimer < 3 && ModKeyState == 1)
			if (player.hasPerk BIDEpipLightPerk == 0)
				player.addPerk BIDEpipLightPerk
				playSound UIPipBoyLightOn
			else
				player.removePerk BIDEpipLightPerk
				playSound UIPipBoyLightOff
			endif
			set ModKeyState to 0
			set KeyTimer to 0
		elseif (isKeyPressed ModKey == 0 && ModKeyState == 0 && KeyTimer > 0)
			set KeyTimer to 0
		endif

	;If the player loses the Pip-Boy, remove the light, if it had been on.
	elseif (UninstallFlag == 0 && player.getItemCount Pipboy == 0 && player.hasPerk BIDEpipLightPerk == 1)
		player.removePerk BIDEpipLightPerk
	endif
end

;Key remapping functionality.
begin Menumode 1001
	if (RemapKeyFlag == 1)
		set KeyRemapBuffer to getKeyPress 0
		if (KeyRemapBuffer > 0 && KeyRemapBuffer < 256)
			set ModKey to KeyRemapBuffer
		endif
	endif
end

begin Menumode 1
	if player.getEquipped pipboywristPC
		player.unEquipItem PipboywristPC 1 1
		player.EquipItem Pipboy 1 1
		resetPipboyManager
		set InitMod to 0
		set Phase to 1
	elseif player.getEquipped pimpboywristPC
		player.unEquipItem PimpboywristPC 1 1
		player.EquipItem Pimpboy 1 1
		resetPipboyManager
		set InitMod to 0
		set Phase to 1	
	endif
end
Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use