Jump to content

Container Display Mod


SirStupidofCheydinhalII

Recommended Posts

I just did a quick test, out of curiosity.

 

From what I figure, it is has to do with items not at full health (either damaged or above 100%) AND stacked

 

You may have as many damaged items as you want, as long as there is only one of each

You may have as many stacked items as you want, as long as they are all at 100% heath

You may have ONE stacked-not-100%-item

 

For every two additional stacked-not-100%-item, one item will be hidden in the container window (usually first in, first out)

 

Lets call Item Xn a stacked-not-100%-item

So . . .

 

Add Item XA - OK

Add Item XB - OK

Add Item XC - Item XA disappears

Add Item XD - Item XD shows, Item XA remains hidden

Add Item XE - Item XE shows, Item XB disappears, Item XA remains hidden

. . . and so forth
If you make a mod that moves somewhere else the stacked-not-100%-items, leaving just one of each, I guess the bug is avoided .
(I did not play with enchanted items, so I know how they affect the bug, if at all)

 

 

 

 

 

Link to comment
Share on other sites

@QQuix, can you provide me detailed 'test case' to recreate this bug step by step not with illustrate?

from your illustration, it provide many good information to help uncover this issue.

so far I can think 2 approach

 

first method : identify which item should be transferred and place it to another temporary container

 

second method : by sorting out every container when player access it

 

I need the 'test case' so I can check this two methods it works or not

Link to comment
Share on other sites

Here is the script I used.

 

Add it to a quest.

Add a persistent, empty container to the world and call it aaqqxxMyCrate

 

Every time you hit the Num0 key, a new item is added to the container.

 

After adding a few and seeing some disappear, click on some stacked item to move it to the player inventory and see items reappearing. Move back and some will disappear again.

scn aaaContainerBugTestQuestSCRIPT
;-------------------------------------------
float fQuestDelayTime
ref bas
ref reff
short n
short ix
string_var s

begin gamemode
let fQuestDelayTime := .001

 if OnKeyDown   82   ;  NUM0

  ;=== Create an new Base Object ===
  let n += 1
  let s := "Item " + sv_Construct "%03.0f" n

  let bas := CloneForm WeapIronDagger 
  SetName $s bas 

  ;=== Create an unique item ===
  let reff := CreateTempRef bas
  reff.SetRefCount 2 
  reff.SetCurrentHealth 69 ; original health = 70

  reff.CopyIR aaqqxxMyCrate ; add to container 
  
  aaqqxxMyCrate.activate PlayerRef

 endif


end 
Link to comment
Share on other sites

Yes I forgot to mention that it also affects items repaired above 100% (which was how I got started on using smiths for repairing my stuff for storing ... my current guy isn't high enough in Armorer for that to be an issue yet).

 

Oh ya Lubronbrons, QQuix can make a keyboard sit up and take notice. I've taken a gander through some of QQuix's code and can tell you I'd need all of a cat's nine lives worth of time to get halfway to where QQuix spends a normal day.

Link to comment
Share on other sites

yeah QQuix is expert for sure, I take a look his mod list.

 

well I am stuck at line where the script is like this

' set sh1 to obj.GetCurrentHealth '

why is that line error anyway I just don't understand. Because we need to identify object health to achieve this in invetory

scn aaaContainerBugTestQuestSCRIPT
;-------------------------------------------
float fQuestDelayTime
ref bas
ref reff
short n
short rndDur
string_var s

;used for check container
short i
ref obj

short sh1

;store the health
short blockKey
short objDur
ref rf
ref rfCurr
ref lastCont
short lastContOpen
array_var arObj
array_var arDur
ref InvSelRef
begin gamemode
	let fQuestDelayTime := 0.03
	set rf to GetCrosshairRef
	if rf != 0
		if rf.IsContainer && rf != player
			if OnKeyDown 57 ;spacebar
				;store baseObj+dur info & set all to 100
				set i to rf.GetNumItems
				if i > 0
					;prep
					Let arObj := ar_Null
					Let arObj := ar_Construct Array
					Let arDur := ar_Null
					Let arDur := ar_Construct Array
					;if this obj is equipable & not have exact 100% health, then force to 100 & store the value to array
					While i > 0
						set i to i - 1
						set obj to rf.GetInventoryObject i
						set objDur to rf.GetObjectHealth obj
						set sh1 to obj.GetCurrentHealth
						if obj != 0 && IsPlayable2 obj && objDur > 0 && rf.GetItemCount obj > 1
							PrintToConsole "%n fix disappear bug! %g" obj objDur
							Let arObj[ar_Size arObj] := obj
							Let arDur[ar_Size arDur] := sh1
;							obj.SetCurrentHealth objDur
						endif
					Loop
				endif
				;finishing: open the container
				rf.Activate player, 1
			endif

			if OnKeyDown 22 ;U
				;=== Create an new Base Object ===
				let n += 1
				let s := "Item " + sv_Construct "%03.0f" n
				let bas := CloneForm WeapIronDagger
				SetName $s bas
				;=== Create an unique item ===
				let reff := CreateTempRef bas
				reff.SetRefCount 2
				set rndDur to Rand 1 69
				reff.SetCurrentHealth rndDur ; original health = 70
				SetObjectHealth 1
				reff.CopyIR rf ; add to container
				PrintToConsole "%n created health %g" reff rndDur
			endif
		endif
	endif
end
Link to comment
Share on other sites

I think every float value, will automatically converted to short.

example : 13.7 force it to short then will be 13

anyway the problem is not that...

its just .... in that case 'GetCurrentHealth' will break the quest script (until next game start)

if I comment that line, the script works..... we need GetCurrentHealth to works, but error ! :tongue:

Edited by lubronbrons
Link to comment
Share on other sites

Does the GetInventoryObject return a reference or a base object? The CS Wiki example looks like it might return a base object: http://cs.elderscrolls.com/index.php?title=GetInventoryObject

 

And if it does, GetCurrentHealth will throw an error because the ref is no a reference but a base object. Maybe?

 

Edit: Also, thank you for mentioning the float to int. If it really works that way, I think I can save quite a few variables. I just assumed the game was so dumb it could not do that. At least in Skyrim, the Papyrus docs clearly state it strips the decimals automatically. :P

Edited by PhilippePetain
Link to comment
Share on other sites

  • Recently Browsing   0 members

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