The World of Layonara  Forums

Author Topic: Dropping items.  (Read 185 times)

Hellblazer

Dropping items.
« on: March 27, 2007, 04:15:36 am »
I don't know if this is feasible or not, but here it goes.

I have seen many people post in the dispute and grievance thread ( my self included) about things being dropped, by either full inventory or no proper spacing in the inventory to fit the item.

So I am wondering, could it be possible to write up a scrip or anything that would work, that would check the inventory spacing, and if no place is found the item would simply not unequip. And when i mean that, I mean that it would  force the system to reequip the item prior to any other action made by the client, like movement and such.

Or

When the inventory opens, have the system make a quick comparasion of spacing availabe vs items equipped, and if no space can be found, the option of unequipping the item should not display.

I think that if a system that could be made would truly force the server to disable the unequip on an equipped item if no suitable place could be found to host it (boxes not including) would nullify the accidental drops and thus nullify the request for reimbursement.

darkstorme

Re: Dropping items.
« Reply #1 on: March 27, 2007, 04:33:54 am »
What you're talking about is the discretized knapsack problem, which is np-hard.  There is no way to guarantee that the algorithm will ever find a solution, which is why Bioware's inventory management system doesn't operate smoothly as-is.  Finding a space is non-trivial - happily, that's hard-coded.  Unfortunately, that means that slotspace is not a property on any given item.

Making an item re-equip after being unequipped won't alleviate the problem, since every equippable item would have to have an OnUnequip script... and even that wouldn't help, because that only fires AFTER the item is unequipped... and dropped.

As for disabling unequip, I can say definitively that there is no NWScript command that allows that, short of cursing the item.  However, checking all items equipped against inventory spacing any time the latter changes and applying the "cursed" flag to all violating items is, again, a non-trivial script to run every time anyone picks up an item.

Much as the system might be convenient, there's no easy way (that I know of, without rewriting source code), to make this happen... the best solution, as always, is keep space free, or suffer the consequences (vanishing items.)
 

Hellblazer

Re: Dropping items.
« Reply #2 on: March 27, 2007, 05:23:37 am »
Aye I know that is the best solution but sometime even that is not fullproof. Which is why I ask :D

 

anything