Jump to content

"RemoveAllItems" not working correctly?


UltimateClay

Recommended Posts

I'm working on a mod, and at some point, the player has their inventory taken away from them. I move their inventory to a safe (with "Persistent Reference" enabled), and once they enter a trigger, their inventory is returned. But, for some reason, the player won't always receive all their items (mostly, they won't receive their weapons and armor). Sometimes, they receive one weapon and all armor. Other times, they receive all weapons but one and then no armor.

 

Here's my code for taking the Player's inventory:

scn 00MLKGBQ02HallucinationScript

int GBQ02HallucinationTriggered ; this variable is changed to 1 by another script.

Begin GameMode
	
        if (GBQ02HallucinationTriggered == 1)
		Player.MoveTo MLKGBQ02HallucinationStartMarkerREF
		Player.RemoveAllItems MLKGBQ02PlayerSafeREF 1 1
        
		ApplyImageSpaceModifier 00MLKgbq02HallucinationISFX
		
		set GBQ02HallucinationTriggered to 2
        endif

end

And here's my code for retrieving the player's inventory:

scn 00MLKGBQ02PlayerInventoryReturnScript

int iInventoryReturned

Begin OnTrigger Player

	if (iInventoryReturned == 0)
		HallucinationPlayerSafeREF.RemoveAllItems Player 1 1 ; Returns Player's inventory
		set iInventoryReturned to 1
	endif

end

When I view the safe's content before emptying it to the player, everything (including the missing items) are there. However, when I check it after the inventory is returned, the safe is completely empty.

This has been a problem I haven't been able to solve for months now. Any help would be greatly appreciated!

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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