Difference between revisions of "Extensions:Character Items"

From Lorekeeper Wiki
Jump to navigation Jump to search
Tag: 2017 source edit
Tag: 2017 source edit
Line 6: Line 6:
 
* Character inventory pages
 
* Character inventory pages
 
* Character inventory logs
 
* Character inventory logs
 +
* Granting of items directly to characters
 
* Attachment of items to characters (via the inv select widget)
 
* Attachment of items to characters (via the inv select widget)
 
* A separate inventory stack modal for characters, which handles:
 
* A separate inventory stack modal for characters, which handles:
Line 11: Line 12:
 
* Deletion of items direct from character inventory
 
* Deletion of items direct from character inventory
  
It also changes item logging to handle this by making it akin to currency logging. That is, the existing user_items_log table is renamed to items_log, and has sender and recipient type columns added. Existing log entries are updated in-place.
+
It also changes item logging to handle this by making it akin to currency logging. That is, the existing user_items_log table is renamed to items_log, and has sender and recipient type columns added. Existing log entries are updated in-place and treated as user <-> user.
  
Character items are also held in their own table. Transferring items between user and character maintains source and notes-- which makes for some strange logs, as the source is re-logged (though the log type is clearly labeled as user <-> character depending on the nature of the transfer.)
+
Character items are also held in their own table. Transferring items between user and character maintains source and notes-- which makes for some slightly strange logs, as the source is re-logged (though the log type is clearly labeled as user <-> character depending on the nature of the transfer).
 +
 
 +
Items are not automatically available to be held by characters. Doing so is done via item categories; these now have a toggle on their admin panel interface for the purpose. Additionally, limits may be set per category for the number of items a character may hold. By default/if left empty, it is set to 0/infinite. This is also done via the admin panel interface.
 
== Installation ==
 
== Installation ==
 
<!-- Describe installation. Include any requirements (such as packages), necessary commands, etc. -->
 
<!-- Describe installation. Include any requirements (such as packages), necessary commands, etc. -->
 +
Pull the branch, then run <code>php artisan migrate</code>.
 +
 +
Additionally, in phpMyAdmin, navigate to the items_log table, and then to the "Structure" panel. Under "Indexes", drop:
 +
* items_log_sender_id_foreign
 +
* items_log_recipient_id_foreign
 +
* items_log_item_id_foreign
 +
* items_log_stack_id_foreign
 +
 
== Configuration ==
 
== Configuration ==
 
<!-- Is any configuration necessary? Describe it here! -->
 
<!-- Is any configuration necessary? Describe it here! -->
 +
Set availability for any categorie(s) you want characters to be able to own, as well as any item limits for those categorie(s), in the item category admin panel.
 
== Usage ==
 
== Usage ==
 
<!-- Is there anything users should know about using your extension? -->
 
<!-- Is there anything users should know about using your extension? -->
 +
Granting items to characters is done via an admin modal located on the character's inventory page, similarly to character banks. Managing character items is also done on this page, similar to user inventories.
 
== Troubleshooting ==
 
== Troubleshooting ==
 
<!-- Are there known issues or errors that require user action? Who should they contact, and where, for support? -->
 
<!-- Are there known issues or errors that require user action? Who should they contact, and where, for support? -->
 +
If you encounter errors, please find me in the Lorekeeper discord!
 
== See Also ==
 
== See Also ==
 
<!-- Any relevant other pages. You may consider linking to related extensions, for instance. -->
 
<!-- Any relevant other pages. You may consider linking to related extensions, for instance. -->
 +
* [[Extensions:Submission Addons]] - Another extension I made for providing more utility to items.

Revision as of 12:11, 17 June 2020

Character Items
Description Enables item attachment, display, and management for characters.
Author(s) Mercury
Status Testing
Github character-items
LK Version Unspecified
Contains a Migration



This builds upon draginraptor/lorekeeper/inventory_stacks !

This adds item inventories to characters, as well as management of character items. This includes:

  • Character inventory pages
  • Character inventory logs
  • Granting of items directly to characters
  • Attachment of items to characters (via the inv select widget)
  • A separate inventory stack modal for characters, which handles:
  • Transferal of items back to the owning user
  • Deletion of items direct from character inventory

It also changes item logging to handle this by making it akin to currency logging. That is, the existing user_items_log table is renamed to items_log, and has sender and recipient type columns added. Existing log entries are updated in-place and treated as user <-> user.

Character items are also held in their own table. Transferring items between user and character maintains source and notes-- which makes for some slightly strange logs, as the source is re-logged (though the log type is clearly labeled as user <-> character depending on the nature of the transfer).

Items are not automatically available to be held by characters. Doing so is done via item categories; these now have a toggle on their admin panel interface for the purpose. Additionally, limits may be set per category for the number of items a character may hold. By default/if left empty, it is set to 0/infinite. This is also done via the admin panel interface.

Installation

Pull the branch, then run php artisan migrate.

Additionally, in phpMyAdmin, navigate to the items_log table, and then to the "Structure" panel. Under "Indexes", drop:

  • items_log_sender_id_foreign
  • items_log_recipient_id_foreign
  • items_log_item_id_foreign
  • items_log_stack_id_foreign

Configuration

Set availability for any categorie(s) you want characters to be able to own, as well as any item limits for those categorie(s), in the item category admin panel.

Usage

Granting items to characters is done via an admin modal located on the character's inventory page, similarly to character banks. Managing character items is also done on this page, similar to user inventories.

Troubleshooting

If you encounter errors, please find me in the Lorekeeper discord!

See Also