• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Error with STORE_INBOX

Mjmackan

Mapper ~ Writer
Premium User
Joined
Jul 18, 2009
Messages
1,424
Solutions
15
Reaction score
176
Location
Sweden
Why is this an issue in the latest TFS 1.3? but not in my older repo.
Code:
local backpack = self:getSlotItem(CONST_SLOT_STORE_INBOX)
local expBoostCharm = backpack:getItemById(11401)

Getting these errors:
Code:
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onGainSkillTries
data/events/scripts/player.lua:472: attempt to call method 'getItemsById' (a nil value)
stack traceback:
        [C]: in function 'getItemsById'
        data/events/scripts/player.lua:472: in function <data/events/scripts/player.lua:470>
and...
Code:
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onGainSkillTries
data/events/scripts/player.lua:472: attempt to index local 'backpack' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/events/scripts/player.lua:472: in function <data/events/scripts/player.lua:470>
 
new store inbox implementation:
But the slot STORE_INBOX is still there, why cant i call it in lua? I can't call SLOT_HEAD either in this new repo :S
How can i manage to add "ok" items to put in store_inbox?
 
Last edited:
It is worth mentioning if the article does not have the StoreInbox attribute it is impossible to add it to the StoreInbox, I don't know why it works like this, but I don't like it either :D, I guess it's a bug, because it doesn't make sense for it to be like that

I had to create these two functions to have a better handling of this StoreInbox
1617223235398.png
It really sucks, it would be good if at some point change this and the container behaves normally

Note: btw this trick does not work with containers that have other items further inside, you simply cannot add them to the StoreInbox, there is no way to do it, not even by applying the above mentioned trick to each item inside the backpack
 
Last edited:
It is worth mentioning if the article does not have the StoreInbox attribute it is impossible to add it to the StoreInbox, I don't know why it works like this, but I don't like it either :D, I guess it's a bug, because it doesn't make sense for it to be like that

I had to create these two functions to have a better handling of this StoreInbox
View attachment 57152
It really sucks, it would be good if at some point change this and the container behaves normally

Note: btw this trick does not work with containers that have other items further inside, you simply cannot add them to the StoreInbox, there is no way to do it, not even by applying the above mentioned trick to each item inside the backpack
No, it's not a bug. It's intended, it could be configurable I guess, but it's not. If you want to add item without setting it as a store item then just pass FLAG_NOLIMIT.
And it really makes sense, as only reserved store items are able to be put in this container.
 
No, it's not a bug. It's intended, it could be configurable I guess, but it's not. If you want to add item without setting it as a store item then just pass FLAG_NOLIMIT.
And it really makes sense, as only reserved store items are able to be put in this container.
FLAG_NOLIMIT it does not work
the function item:moveTo(), already has this flag by default and it does not work

Currently the items with item:setStoreItem(true) you can only be moved from the storeInbox to Depot and vice versa, I wonder what happens if I buy a wand from the store, how do I equip it if it cannot be moved to another place other than the storeInbox <> Depot?

The normality would be that you could take item from the storeInbox but not put anything in it, however using code it could be manipulated like any Container

The rules would be the following:
* Player
** Move items anywhere outside the storeInbox ✅
** Move items within the storeInbox ❌

* Scripting
** Do whatever with the storeInbox, remove, add, addEx, moveTo, etc... ✅
 
FLAG_NOLIMIT it does not work
the function item:moveTo(), already has this flag by default and it does not work

Currently the items with item:setStoreItem(true) you can only be moved from the storeInbox to Depot and vice versa, I wonder what happens if I buy a wand from the store, how do I equip it if it cannot be moved to another place other than the storeInbox <> Depot?

The normality would be that you could take item from the storeInbox but not put anything in it, however using code it could be manipulated like any Container

The rules would be the following:
* Player
** Move items anywhere outside the storeInbox ✅
** Move items within the storeInbox ❌

* Scripting
** Do whatever with the storeInbox, remove, add, addEx, moveTo, etc... ✅
You can put out items out of store inbox, but you cannot move anything into store inbox that isn't store item. If you can't move items out of store inbox, then it's because your item isn't store item.
About the flag_nolimit, you are right and it's a bug. I forgot to include this flag in queryAdd. I'll fix it.

 
Last edited:
Back
Top