Jump to content

UnequipItemSlot Only Managing to Unequip the Pipboy


Recommended Posts

The UnequipItemSlot() function only manages to unequip the pipboy (rendering it invisible) when I run through each of the potential biped slots (30 to 61).

 

As this is part of a larger script, I'll quickly write up the relevant part of the script.

ScriptName UnequipPlease Extends Quest

; ==========
; Properties
; ==========

Actor Property PlayerRef Auto Const Mandatory

; ======
; Events
; ======

Event OnInit()
	; ---------
	; Variables
	; ---------
	
	Int IterationCount
	
	; ----------
	; Operations
	; ----------
	
	IterationCount = 30
	
	While (IterationCount <= 61)
		PlayerRef.UnequipItemSlot(aiSlot = IterationCount)
		
		IterationCount += 1
	EndWhile
EndFunction

Yes, the PlayerRef property has been correctly set up, and the .esp itself has been saved.

 

I can probably get away with just using the UnequipItem() function, but I'd prefer not to.

 

And yeah, I realise that this is about my millionth recent thread, sorry about that.

Link to comment
Share on other sites

I like to write and fill out each of the parameters in a function to improve the readability of the script and to better serve for future reference. The only exceptions I make to this are those that don't recognise the name of their parameters listed on the CK wiki for some reason (e.g. GetValue(), SetValue(), etc.), and the Show() function (afArg1, afArg2, ..., afArg9), which is just bloody long. It's just personal preference and I've been told that it doesn't affect the efficiency of the script.

Link to comment
Share on other sites

Ok, that's weird I've tested this myself, it seems that function cannot force game to unequip objects from slots as "can't unequip object" (or something similar in meaning as I am not playing english version) appears as notification. Maybe you should use unequipAll function if you want to remove every item from player.

Link to comment
Share on other sites

I just wonder why do you count from 30 to 61 ? For example clothes slot (i.e. army fatigues) is slot 3 and some armor parts are 11 and 13 slots. It works with console commands and I looked once at the undress script from some working mod. It unequips slots from zero to 29. Slot 30 = pipboy.

If you unequip slots from 0 to 29 it will leave the player naked but with the pipboy. Maybe I`m missing something and you are trying to unequip some invisible items that I don`t know about, sorry then.

Edited by kitcat81
Link to comment
Share on other sites

I just wonder why do you count from 30 to 61 ?  For example clothes slot (i.e. army fatigues) is slot 3 and some armor parts are 11 and 13 slots. It works with console commands and I looked once at the undress script from some working mod. It unequips slots from zero to 29. Slot 30 = pipboy. Â

If you unequip slots from 0 to 29 it  will leave the player naked but with the pipboy. Maybe I`m missing something and you are trying to unequip some invisible items that I don`t know about, sorry then.

I suppose we used information from here https://www.creationkit.com/fallout4/index.php?title=Biped_Slots

And biped slot numbers start from 30 there.

Link to comment
Share on other sites

I just wonder why do you count from 30 to 61 ? For example clothes slot (i.e. army fatigues) is slot 3 and some armor parts are 11 and 13 slots. It works with console commands and I looked once at the undress script from some working mod. It unequips slots from zero to 29. Slot 30 = pipboy.

If you unequip slots from 0 to 29 it will leave the player naked but with the pipboy. Maybe I`m missing something and you are trying to unequip some invisible items that I don`t know about, sorry then.

Where did you find those slot numbers? In the CK, the biped objects are much different than what you're saying. 60 = pipboy. 30 = hairtop

Link to comment
Share on other sites

I just wonder why do you count from 30 to 61 ? For example clothes slot (i.e. army fatigues) is slot 3 and some armor parts are 11 and 13 slots. It works with console commands and I looked once at the undress script from some working mod. It unequips slots from zero to 29. Slot 30 = pipboy.

If you unequip slots from 0 to 29 it will leave the player naked but with the pipboy. Maybe I`m missing something and you are trying to unequip some invisible items that I don`t know about, sorry then.

 

This is very interessting... i yesterday checkout the function from F4SE getwornitem and it didnt work well... nearly always returned none. Going to check 0-29.

Does someone use the GetWornItem(SlotIndex) function?

Link to comment
Share on other sites

 

I just wonder why do you count from 30 to 61 ?  For example clothes slot (i.e. army fatigues) is slot 3 and some armor parts are 11 and 13 slots. It works with console commands and I looked once at the undress script from some working mod. It unequips slots from zero to 29. Slot 30 = pipboy. Â

If you unequip slots from 0 to 29 it  will leave the player naked but with the pipboy. Maybe I`m missing something and you are trying to unequip some invisible items that I don`t know about, sorry then.

I suppose we used information from here https://www.creationkit.com/fallout4/index.php?title=Biped_Slots

And biped slot numbers start from 30 there.

 

I`m sorry, I`m not an a native English speaker ..Is there any differenmce between "biped slots" and item slots ? ( just not sure why they are named "biped", can`t translate it in a way that makes sence). The page can be just a copy from Skyrim. I saw many pages that were copied but they are not relevant for Fallout 4.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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