ID:87471
 
Not a bug
BYOND Version:460
Operating System:Windows Vista Home Premium 64-bit
Web Browser:Internet Explorer 8.0
Applies to:Dream Seeker
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:When making a verb delete an item from your inventory, you wont be able to use the verb 1/10 a second later, I am guessing because it won't let you until it's completed deleting the first item from your contents.

Numbered Steps to Reproduce Problem:1.Create a new project.
2.Put the code below in it, u dont even need icons or map, i didn't have them.

Code Snippet (if applicable) to Reproduce Problem:
obj
Item
verb
Use()
world<<"Item consumed."
del(src)
mob
Login()
var/Count
while(Count<10)
Count++
new /obj/Item(src)
Stat()
statpanel("Inventory",contents)


Expected Results:It to be able to use quickly the item.

Actual Results:It takes a few seconds, maybe because the item isn't yet fully gone from your inventory just yet.

Does the problem occur:
Every time? Or how often?Every Time
In other games?All Games
In other user accounts?Yes
On other computers?Yes

When does the problem NOT occur?I guess it might not happen if the verb was on the player rather than the item, but I haven't tested, or it may not happen in some other cases, but I haven't tried anything else.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

I think it always occured.

Workarounds:Not sure of any.

http://www.byond.com/docs/ref/info.html#/client/proc/Stat

In other words it takes a while for the clients stat panel to update even if you do change it. You can fix your problem by lowering world.tick_lag to zero in single player. It might cause a bit of overhead in multiplayer if you lower it though.
Well, lowering world.tick_lag to 0 worked, but is there a way without lowering world.tick_lag to fix how slow it is?

The Stat() code I posted was only to make it show your inventory, and I wouldn't expect that to update until Stat() is called, but I expected it to delete the item right away even before calling Stat() because I use Stat() only for display.

Does it wait for Stat() to even update ur contents by default instead of when you call del Item? If so, why is this? It needs to be changed.

You can delete Stat() and this will still be default behavior it seems, I want the item deleted more instantly so I can use a different item.

lowering world.tick_lag worked, but you only voiced that it should be used in sigle player mode, how do I make a multiplayer solution?
If for the simplest of things, I would even be willing to make calls to Stat() manually if possible, and delete the automatic calls using the world.tick_lag value, even if u cant stop it, id like to know if there is a way to call it manually. I might try if making my own interface or something can come up with a way to use items more often, but I am not sure it will if I base anything off of the contents var, because that for some reason is thrown off of Stat() when really it should update inventory instantly, not when a call to Stat() is made, the Stat() I typed in was purely visual, so it's a byond reason as to why it updates contents when Stat() is called.
Have you tried "set instant = 1" ?
on what?
the verb? that likely wont work because the problem is it getting deleted from inventory, not that it wont let me call verb again.

Something that does work is using a alternate inventory, but, you can't use set src in Inventory, so there is no way to get the default right click menu to show up for non-default inventory.
Superbike: The deletion is happening instantly, you can use the verb a number of times in a 1/10 of a second. Stat isn't updating in order to show you that, however. Try outputting tick values in the Use() verb, then try it.
Jp, I think you are mistaken, I remove Stat() code and it's still slow when holding down the macro, but when I make myself an inventory that does not use usr.contents, it works fine and lets me spam the Use verb.

This behavior can only mean that usr.contents does not get updated until Stat() is called again.

Regardless of whether or not it really does, it does not stop the fact that it will let me keep spamming with using an inventory using a list other than usr.contents, so something about the usr.contents does not work good, I should be able to spam the verb.
usr.contents is just a list like any other.
it does nothing special.
it would not matter if you used one list or another, they would do the same thing, unless you want it do something else.
obviously not, using a list I made, it will let me use items fast, but using the built in contents list, it only lets me go slow, so, there is something wrong where it updates only on Stat() or something, because, it's not letting me spam like when I am using a custom inventory list.