We think this could be usefull... or at least fast
A function to obtain items (array of UObject) placed directly in the container passed as parameter... like EnumerateItemsInContainer() without sub-container items
Even if this can done with a simple eScript function, POL core should certainly be much faster... especially if container has many items...
ListRootItemsInContainer(container)
Moderator: POL Developer
-
- Apprentice Poster
- Posts: 58
- Joined: Sun Feb 05, 2006 1:34 pm
Script it. Not everything is going to be put in the core.
Even though you most likely already know how to do it... for others and future requests:
Im going to coin the new term:
'Scriptaphobe' -A fear of scripting because everything (even 1+1) takes up too many cycles.
If everything was desired to be hardcoded into the executable for speed, wouldn't UOX still be on top?
Even though you most likely already know how to do it... for others and future requests:
Code: Select all
function ListRootItemsInContainer(container)
var item_list := array;
foreach item in ( EnumerateItemsInContainer(container)
if ( item.container == container )
item_list.Append(item);
endif
SleepMs(2);
endforeach
return item_list;
endfunction
'Scriptaphobe' -A fear of scripting because everything (even 1+1) takes up too many cycles.
If everything was desired to be hardcoded into the executable for speed, wouldn't UOX still be on top?
-
- Apprentice Poster
- Posts: 58
- Joined: Sun Feb 05, 2006 1:34 pm
-
- Apprentice Poster
- Posts: 58
- Joined: Sun Feb 05, 2006 1:34 pm
Even if max items is 125, a container with many subcontainers, with many subcontainers, ... results in a large array, no? :?
Anyway... just one last thing...
No new function, but what about adding a flag to EnumerateItemsInContainer()?
As ENUMERATE_IGNORE_LOCKED, something like ENUMERATE_IGNORE_SUBCONTAINERS...
Useless like above suggestion?
I thought it was fast to implement... if not, never mind, I'll go on as usual and I'll post other suggestions
Anyway... just one last thing...
No new function, but what about adding a flag to EnumerateItemsInContainer()?
As ENUMERATE_IGNORE_LOCKED, something like ENUMERATE_IGNORE_SUBCONTAINERS...
Useless like above suggestion?
I thought it was fast to implement... if not, never mind, I'll go on as usual and I'll post other suggestions
Its still recursive... so if you have a container in a container, and insert something lower, it still counts towards the top... so you never go over the max item amount.
Example using MuadDib's standard backpack layout
The parenthesis shows its item count.
Example using MuadDib's standard backpack layout
The parenthesis shows its item count.
Code: Select all
*BACK PACK* (6)
*BAG* (5)
*LOCKED STRONGBOX* (4)
- Thong panties
- Underwire bra
- Wild Turkey bottle
- Book titled "Lipstick on Sheep"