User Tools

Site Tools


hpl3:community:scripting:amnesia-style_inventory_doc

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl3:community:scripting:amnesia-style_inventory_doc [2015/10/25 03:24]
abion47
hpl3:community:scripting:amnesia-style_inventory_doc [2016/10/06 03:18] (current)
abion47
Line 1: Line 1:
 +====== Amnesia-styled Inventory ======
 +
 The Inventory System comes with two built-in modules: The Inventory Module and the Journal Module. Each of these modules comes with its own corresponding file with helper functions. The Inventory System comes with two built-in modules: The Inventory Module and the Journal Module. Each of these modules comes with its own corresponding file with helper functions.
  
-The Inventory System can be downloaded from the Steam Workshop ​(link pending) ​or from ModDB (link pending). With the download comes a sample map that demonstrates the most common usages of the Inventory System'​s capabilities.+The Inventory System can be downloaded from the [[http://​steamcommunity.com/​sharedfiles/​filedetails/?​id=541404608|Steam Workshop]] or from [[http://​www.moddb.com/​mods/​amnesia-style-inventory-management-system|ModDB]]. With the download comes a sample map that demonstrates the most common usages of the Inventory System'​s capabilities.
  
 ===== Inventory Module ===== ===== Inventory Module =====
  
-<code c++>void Inventory_UpdateToolDescription(const tString &in asTool,  +<code c++> 
- const tString &in asToolName,  +void Inventory_UpdateToolDescription(const tString &in asTool, 
- const tString &in asDescription)</​code>​+    const tString &in asToolName,​ 
 +    const tString &in asDescription) 
 +</​code>​
  
 **The Inventory Module works with the PlayerTool module to see which tools are in the player'​s possession, but Tools must also be registered with the Inventory Module to give them a corresponding title and description. Use this function to accomplish this.** **The Inventory Module works with the PlayerTool module to see which tools are in the player'​s possession, but Tools must also be registered with the Inventory Module to give them a corresponding title and description. Use this function to accomplish this.**
Line 19: Line 23:
 ---- ----
  
-<code c++>void Inventory_SetTransCategory(const tString &in asCategory)</​code>​+<code c++> 
 +void Inventory_SetTransCategory(const tString &in asCategory) 
 +</​code>​
  
 **The Inventory Module supports the use of the ImGui lang file TransCategories. Use this function to set the TransCategory you wish to use.** **The Inventory Module supports the use of the ImGui lang file TransCategories. Use this function to set the TransCategory you wish to use.**
Line 27: Line 33:
 ---- ----
  
-<code c++>bool Inventory_IsToolEquipped(const tString &in asTool)</​code>​+<code c++> 
 +bool Inventory_IsToolEquipped(const tString &in asTool) 
 +</​code>​
  
 **The Inventory Module works in tandem with the PlayerTool module when equipping tools through the Inventory interface. Use this function if you wish to check if the given Tool is the one that is equipped.** **The Inventory Module works in tandem with the PlayerTool module when equipping tools through the Inventory interface. Use this function if you wish to check if the given Tool is the one that is equipped.**
Line 37: Line 45:
 ---- ----
  
-<code c++>void Inventory_UnequipTool()</​code>​+<code c++> 
 +void Inventory_UnequipTool() 
 +</​code>​
  
 **If you wish to manually unequip the currently equipped tool, use this function.** **If you wish to manually unequip the currently equipped tool, use this function.**
Line 45: Line 55:
 ===== Journal Module ===== ===== Journal Module =====
  
-<code c++>void Journal_SetTransCategory(const tString &in asCategory)</​code>​+<code c++> 
 +void Journal_SetTransCategory(const tString &in asCategory) 
 +</​code>​
  
 **The Journal Module supports the use of the ImGui lang file TransCategories. Use this function to set the TransCategory you wish to use.** **The Journal Module supports the use of the ImGui lang file TransCategories. Use this function to set the TransCategory you wish to use.**
Line 53: Line 65:
 ---- ----
  
-<code c++>​void ​Journal_SetLangFile(const tString &in asLangfile)</​code>​+<code c++> 
 +void Journal_SetCondensedLangFile(const tString &in asLangfile) 
 +</​code>​
  
-**Because of certain technical limitations, in order to use the ImGui lang file, the Journal Module requires that the file name and location of the main lang file also be provided. ​(Typically ​the "​english.lang" file.)**+**Because of certain technical limitations,​ the Journal Module requires that the entries for condensed categories be stored in their own separate ​lang file (using the same schema and category name).**
  
 //tString asLangfile//​ - The relative path to the lang file. //tString asLangfile//​ - The relative path to the lang file.
Line 61: Line 75:
 ---- ----
  
-<code c++>bool Journal_AddCategory(const tString &in asCategoryName,​  +<code c++> 
- const tString &in asCategoryTitle,​ +bool Journal_AddCategory(const tString &in asCategoryName,​ 
- int alCategoryWeight = 0, +    const tString &in asCategoryTitle,​ 
- bool abCollapseEntries = false)</​code>​+    int alCategoryWeight = 0, 
 +    bool abCollapseEntries = false) 
 +</​code>​
  
-** This function allows the creation of journal categories. The categories are groups that any entries will be sorted into. If a category is marked as "​collapsed",​ all entries within that category will be treated as a non-interactable list rather than a set of individual entries. (This is useful to achieve things like current objectives.)**+**This function allows the creation of journal categories. The categories are groups that any entries will be sorted into. If a category is marked as "​collapsed",​ all entries within that category will be treated as a non-interactable list rather than a set of individual entries. (This is useful to achieve things like current objectives.)**
  
 //tString asCategoryName//​ - The unique name of the given category. //tString asCategoryName//​ - The unique name of the given category.
Line 80: Line 96:
 ---- ----
  
-<code c++>bool Journal_AddEntry(const tString &in asEntryName,​  +<code c++> 
- const tString &in asEntryTitle,​  +bool Journal_AddEntry(const tString &in asEntryName,​ 
- const tString &in asEntryDate,​ +    const tString &in asEntryTitle,​ 
- const tString &in asEntryJournalCategory,​ +    const tString &in asEntryDate,​ 
- const tString &in asEntryOnReadCallback,​  +    const tString &in asEntryJournalCategory,​ 
- const tString &in asEntryContents,​ +    const tString &in asEntryOnReadCallback,​ 
- int alEntryWeight = 0, +    const tString &in asEntryContents,​ 
- bool abContentIsImage = false)</​code>​+    int alEntryWeight = 0, 
 +    bool abContentIsImage = false) 
 +</​code>​
  
 **This is the function that allows the addition of specific journal entries. The entries will be sorted into their corresponding categories and by weight. (Note: If the entry is intended for a collapsed journal category, only the entryName and entryTitle will be used.)** **This is the function that allows the addition of specific journal entries. The entries will be sorted into their corresponding categories and by weight. (Note: If the entry is intended for a collapsed journal category, only the entryName and entryTitle will be used.)**
Line 111: Line 129:
 ---- ----
  
-<code c++>bool Journal_UpdateCategory(const tString &in asCategoryName,​  +<code c++> 
- const tString &in asCategoryTitle,​ +bool Journal_UpdateCategory(const tString &in asCategoryName,​ 
- int alCategoryWeight = 0, +    const tString &in asCategoryTitle,​ 
- bool abCollapseEntries = false)</​code>​+    int alCategoryWeight = 0, 
 +    bool abCollapseEntries = false) 
 +</​code>​
  
-** This function allows the modification of existing journal categories.**+**This function allows the modification of existing journal categories.**
  
 //tString asCategoryName//​ - The unique name of the category to be modified. //tString asCategoryName//​ - The unique name of the category to be modified.
Line 128: Line 148:
 ---- ----
  
-<code c++>bool Journal_UpdateEntry(const tString &in asEntryName,​  +<code c++> 
- const tString &in asEntryTitle,​  +bool Journal_UpdateEntry(const tString &in asEntryName,​ 
- const tString &in asEntryDate,​ +    const tString &in asEntryTitle,​ 
- const tString &in asEntryJournalCategory,​ +    const tString &in asEntryDate,​ 
- const tString &in asEntryOnReadCallback,​  +    const tString &in asEntryJournalCategory,​ 
- const tString &in asEntryContents,​ +    const tString &in asEntryOnReadCallback,​ 
- int alEntryWeight = 0)</​code>​+    const tString &in asEntryContents,​ 
 +    int alEntryWeight = 0) 
 +</​code>​
  
 **This function updates the contents of existing journal entries.** **This function updates the contents of existing journal entries.**
Line 156: Line 178:
 ---- ----
  
-<code c++>bool Journal_RemoveCategory(const tString &in asCategoryName)</​code>​+<code c++> 
 +bool Journal_RemoveCategory(const tString &in asCategoryName) 
 +</​code>​
  
 **This function removes a journal category from the list. (This action will remove all entries under the category as well. This cannot be reversed.)** **This function removes a journal category from the list. (This action will remove all entries under the category as well. This cannot be reversed.)**
Line 166: Line 190:
 ---- ----
  
-<code c++>bool Journal_RemoveEntry(const tString &in asEntryName)</​code>​+<code c++> 
 +bool Journal_RemoveEntry(const tString &in asEntryName) 
 +</​code>​
  
 **This function removes a journal entry from the list. (This action cannot be reversed.)** **This function removes a journal entry from the list. (This action cannot be reversed.)**
Line 176: Line 202:
 ---- ----
  
-<code c++>int Journal_GetEntryCount()</​code>​+<code c++> 
 +int Journal_GetEntryCount() 
 +</​code>​
  
 **This function returns the total number of entries in the journal.** **This function returns the total number of entries in the journal.**
Line 184: Line 212:
 ---- ----
  
-<code c++>void Journal_ReadEntry(const tString &in asEntryName)</​code>​+<code c++> 
 +void Journal_ReadEntry(const tString &in asEntryName) 
 +</​code>​
  
 **An entry'​s OnReadCallback function will automatically fire when the entry is read. To manually fire this callback, use this function. (Does nothing if the entry has no assigned OnReadCallback function.)** **An entry'​s OnReadCallback function will automatically fire when the entry is read. To manually fire this callback, use this function. (Does nothing if the entry has no assigned OnReadCallback function.)**
Line 192: Line 222:
 ---- ----
  
-<code c++>​tString Journal_GetLastEntry()</​code>​+<code c++> 
 +tString Journal_GetLastEntry() 
 +</​code>​
  
 **This function will return the unique name of the last entry that was added or updated.** **This function will return the unique name of the last entry that was added or updated.**
Line 200: Line 232:
 ---- ----
  
-<code c++>void Journal_ShowMessage(const tString &in asMessage,​ +<code c++> 
- const tString &in asIcon = ""​)</​code>​+void Journal_ShowMessage(const tString &in asMessage,​ 
 +    const tString &in asIcon = ""​) 
 +</​code>​
  
 **This function will toggle a notification message to appear in the bottom left of the screen, accompanied by an optional image. This notification will automatically disappear after a few seconds.** **This function will toggle a notification message to appear in the bottom left of the screen, accompanied by an optional image. This notification will automatically disappear after a few seconds.**
Line 208: Line 242:
  
 //tString asIcon// - The image path to be displayed. //tString asIcon// - The image path to be displayed.
 +
hpl3/community/scripting/amnesia-style_inventory_doc.1445743485.txt.gz · Last modified: 2015/10/25 03:24 by abion47