Future update: Item rework
Posted: November 6th, 2023, 4:18 pm
Future update: Item rework
Rather than posting vague screenshots of cargobobs in the sneak peek channel on Discord, I've decided to make a informative thread regarding a upcoming update that I've been working on. In this thread, I'll be going into details about why we're making these changes, what will change and more. This thread is also meant to gather some early feedback. You could consider this thread as some kind of "dev blog".
Why?
Simple. Currently items and item information are stored all over the place. This makes changing things involving items more difficult than it should be. I had the idea in mind for quite some time and was doubtfull to get started. However looking through certain suggestions convinced me to pull the trigger.
And before you say: "Instead of doing this you could be doing X Y instead!", the item rework is on a seperate branch and is basically something I work on when I have the time to. This means I can keep updating the current gamemode in parralel to the item rework without too much problems. The "main" branch is still taking my priority.
Commands
For the most part, commands are mostly the same. Some commands, however, might have things switched around a little. E.g. /houselocker store materials 3000 has been changed to /houselocker store 3000 materials. /houselocker now also shows you an UI that updates whenever you take/deposit an item.
Other than that, /usedrugs has been removed and replaced with /use <item name>. This command is only used for drugs as of the time of writing this thread, but will be used for other and newer items.
/inventory has also been changed, as it now shows you an UI with all your items.
Selecting an item in the new UI will present you with more information. (As seen in the screenshots below).
Items
All items become their own entitity rather than being stored randomly in the gamemode. From toolkits to bombs. Items can have different parameters, such as being tradeable, stackable (can have multiple in a single inventory slot), wether they should drop on death/disconnect, the max amount a player may have in their inventory, etc.
Item effects are now dynamic as well (cuz why not). We can easily add healing, damaging, commands, messages, to items. I also added a way to reload items whilst in-game, meaning we could essentially create new items with different effects without having to recompile the gamemode. That being said, all items can now be used through /use. Their older commands (/toolkit, etc) still work however /usedrugs is deprecated and removed.
We opted out of making weapons and ammo seperated items for now.
All the code that involves items, from buying them in businesses to using them has been changed.
Inventories
Inventories have been entirely reworked. It is now 50x easier to add an inventory to an entity(house/player e.g.) and to add interactions. You can use them mostly the same as you always used them.
Player inventory
Player inventories have a default size of 15 inventory slots. Premium (lvl 5+) members get an additional 5 slots.
House locker
House lockers have a default size of 30 inventory slots. You are unable to deposit untradable items in your house locker.
Frisking a player
We decided to keep frisking pretty much the same as it is now, except with more items and details.
Testing
Due to the scale of this update, and how it affects the economy, we've been testing and will continue to test to ensure all works as intended. We might host a public beta in the very near future to speed up this process.
What's left?
A lot. Mostly testing to ensure everything is covered and there won't be any bugs that cause players to lose items. I'm also looking at ways to display certain item variables, such as if an item is illegal, if it is tradeable, etc.
Rather than posting vague screenshots of cargobobs in the sneak peek channel on Discord, I've decided to make a informative thread regarding a upcoming update that I've been working on. In this thread, I'll be going into details about why we're making these changes, what will change and more. This thread is also meant to gather some early feedback. You could consider this thread as some kind of "dev blog".
Why?
Simple. Currently items and item information are stored all over the place. This makes changing things involving items more difficult than it should be. I had the idea in mind for quite some time and was doubtfull to get started. However looking through certain suggestions convinced me to pull the trigger.
And before you say: "Instead of doing this you could be doing X Y instead!", the item rework is on a seperate branch and is basically something I work on when I have the time to. This means I can keep updating the current gamemode in parralel to the item rework without too much problems. The "main" branch is still taking my priority.
Commands
For the most part, commands are mostly the same. Some commands, however, might have things switched around a little. E.g. /houselocker store materials 3000 has been changed to /houselocker store 3000 materials. /houselocker now also shows you an UI that updates whenever you take/deposit an item.
Other than that, /usedrugs has been removed and replaced with /use <item name>. This command is only used for drugs as of the time of writing this thread, but will be used for other and newer items.
/inventory has also been changed, as it now shows you an UI with all your items.
Selecting an item in the new UI will present you with more information. (As seen in the screenshots below).
Items
All items become their own entitity rather than being stored randomly in the gamemode. From toolkits to bombs. Items can have different parameters, such as being tradeable, stackable (can have multiple in a single inventory slot), wether they should drop on death/disconnect, the max amount a player may have in their inventory, etc.
Item effects are now dynamic as well (cuz why not). We can easily add healing, damaging, commands, messages, to items. I also added a way to reload items whilst in-game, meaning we could essentially create new items with different effects without having to recompile the gamemode. That being said, all items can now be used through /use. Their older commands (/toolkit, etc) still work however /usedrugs is deprecated and removed.
We opted out of making weapons and ammo seperated items for now.
All the code that involves items, from buying them in businesses to using them has been changed.
Inventories
Inventories have been entirely reworked. It is now 50x easier to add an inventory to an entity(house/player e.g.) and to add interactions. You can use them mostly the same as you always used them.
Player inventory
Player inventories have a default size of 15 inventory slots. Premium (lvl 5+) members get an additional 5 slots.
House locker
House lockers have a default size of 30 inventory slots. You are unable to deposit untradable items in your house locker.
Frisking a player
We decided to keep frisking pretty much the same as it is now, except with more items and details.
Testing
Due to the scale of this update, and how it affects the economy, we've been testing and will continue to test to ensure all works as intended. We might host a public beta in the very near future to speed up this process.
What's left?
A lot. Mostly testing to ensure everything is covered and there won't be any bugs that cause players to lose items. I'm also looking at ways to display certain item variables, such as if an item is illegal, if it is tradeable, etc.