This is a fresh n' dope inventory management engine: a powerful turnkey solution for use in your projects. Features - 3 independent user inventories - simultaneous display of all 3 inventories - export or import inventories to or from string via reconciliator - adjustable number of slots per inventory - supports infinite different items - supports stackable items, up to infinite stacks - supports different max stacks for each item - each inventory's visual layout is adjustable - thorough logging (for debugging) - powerful integrated error checker (enabled by default) - engine relays user interactions back to the host project - powerful debug menu - powerful, high-speed API with various simple commands: ---- add/delete/swap/replace items within the same or between different inventories ---- query 'what item ID is in X slot?' / 'how many of X item is in my inventory?' / 'how many free spaces are left?' / etc... ---- display/hide inventories at will - a stable and purpose designed codebase ------------------------------------------------------------------ TEST IT OUT: Try out the debug menu by clicking on it. This will let you test some of the key commands. More inside the project. Recommendation: - first <initialize [A] of slots in new inventory [B]> (recommend 10, 1) - then <show inventory [A]> (recommend 1) - then just read commands and use Note that in this demo there are only 9 placeholder icons (for item IDs 1-9), and that the max stack of each item is pre-set to a very high number. The validator (built in error checker) is also enabled so if you input invalid commands it will beep at you. ------------------------------------------------------------------ EXAMPLE API USE: - To check if the player has enough gold for a purchase you would call the "Report number of item [ID] in inventory [INV ID]?", where [ID] would refer to the ID for gold, and [INV ID] would be inventory (1-3) you are checking. The engine would then report the total gold inside that inventory in a variable called "nv.return". - To take the gold out of the player's inventory and add a sword (eg., buying a sword from a shop), you would first call a "delete" and then "add" command in succession. OR you would call "MACRO: Only if at least # [AMT 1] of item [ID 1] is in inventory [INV ID], then delete and add [AMT 2] of item [ID 2]" where [AMT 1] is the cost of the sword, [ID 1] is the ID of gold, [AMT 2] is the number of swords (1), and [ID 2] is the ID for a sword. [INV ID] would be the inventory where this takes place (1-3). ------------------------------------------------------------------ SETUP: Follow the directions inside the "USER" sprite carefully. There are a lot of global variables & lists that you must make - make sure they are global (not private) and that you spell everything correctly. ------------------------------------------------------------------ TECHNICAL INFORMATION: There are three hardcoded inventories. Each inventory has two lists, both with indices representing 'slot ID'. One list's values contain the item ID in that slot, the other contains stack size. Combined, they correlate slot, item ID, and amount in that slot (example: a 900 stack of gold coins). The engine is composed of several sprites: - "nV_Engine" is the heavy lifter that tracks actual inventory data; slots/items/stack sizes. This is also the sprite that receives API calls (eg, add 5 fish to inventory 1) - "nV_UI" is the sprite that draws the actual inventory icons, you simply load your icons as costumes inside the sprite - with costume number cooresponding to item ID, and a 'blank' slot icon as the last costume. You wont interact with nV_UI through API calls directly (the nV_Engine sprite calls its functions), but you can adjust the layout of inventory icons on the screen by changing variables inside the sprite. - "nV_stkwrite" stands for stack writer, which is what prints the stack count numbers on the inventory when you display it. You will never need to touch this sprite besides importing it into your project along with the other core engine sprites. - "I3F Recon" allows imp/export of inventories as strings. - "DEBUG MENU" is just a development tool/demo that lets you test some commands. It uses the engine's API just like your project would. It's not a necessary for the engine to function but may help speed up development - "API" and "USER" sprites are just informational, read them to help you understand how to setup the engine. ------------------------------------------------------------------ VERSIONS: 07M/16D/2018 - v1.3 updates from escape: sdc, nvengine 2.0, i3f recon 2, stkwriter, stringtools. 01M/18D/2018 - v1.2 added reconciliator 05M/17D/2017 - v1.01 stable, typo fix lel 05M/13D/2017 - v1 stable, added debug, stack counter, bug fixes, more API 05M/12D/2017 - v1 beta, no stack counter, no demo, needs security (to prevent item swap b/t non-initialized inventories etc)