Jump to content

Leveled list items and script bug. Something strange.


Xilandro

Recommended Posts

Working with containers and found strange bug with GetNumItems and GetItemCount. Everytime I'm checking empty containers like Vending Machine - it always return value > 0. I found that some containers have leveled items inside. Even if it's marked as "empty" for player, leveled item is still there, and script will count it just like regular item. Already tried to fix it with list filled with all leveled items (ClutterNukaVending75 and so on), and it didn't fix the problem. Seems like the engine treats "ClutterNukaVending75" like regular Nuka Cola bottle. Does anybody knows how to workaround it?

Link to comment
Share on other sites

Working with containers and found strange bug with GetNumItems and GetItemCount. Everytime I'm checking empty containers like Vending Machine - it always return value > 0. I found that some containers have leveled items inside. Even if it's marked as "empty" for player, leveled item is still there, and script will count it just like regular item. Already tried to fix it with list filled with all leveled items (ClutterNukaVending75 and so on), and it didn't fix the problem. Seems like the engine treats "ClutterNukaVending75" like regular Nuka Cola bottle. Does anybody knows how to workaround it?

 

Yeah I remember reading this on the discussion page quite a while back. If your getting a 1 count for each leveled list then the following below applies. Long answer short the logic seems to change from the number of items to a true/false comparison (so you get a 1/true for each leveled list). I havn't seen any workaround/bug fix :sad:

 

 

discussion page

"This function seems to change when dealing with Level Items that are no longer in the originating container.
Using the Level Item "FoodLiquorHard100" as an example, lets say there's a container that has 3 of them in it. What spawns in the container would be something like:
2 Beer
1 Vodka
3 Whiskey
1 Wine
Running [GetItemCount] on "Beer" will return "2", Vodka "1", Whiskey "3", etc (IE correct). But, after the player takes all of the items out of the container, it should return:
0 Beer
0 Vodka
0 Whiskey
0 Wine
But instead, returns:
1 Beer
1 Vodka
1 Whiskey
1 Wine
Any item from the Level Item list originally spawned in the container will return "1" even if there are now "0" and even though there were more than "1" at spawn.
The logic seems to change from "how many are in the container?" to "was this item in a LVL List that spawned in the container?".
If you place an actual "Beer" item in the container (not a LVL Item container Beer), it will always return the correct count. IE, if you place 3 Beers in the container, GetItemCount will return "3". After the player (or whomever) takes them, it will return "0"."
There's also a thread on bethesda's forum
Link to comment
Share on other sites

@Devinpatterson

Thanks for the answer. Well, seems like it's not fixable via scripting. I found that leveled list inside leveled list works fine, but it's a lot of non-scripting work and may be incompatible with mods that change leveled items lists.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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