Skip to content
Jean-Guy Landriault edited this page Mar 3, 2016 · 3 revisions

Currencies

If you have ACL enabled, you will need the 'lex.acl.index' permission to view this page.

By default pagination is set to 15 items. Lex Configuration will allow you to change that value for the currencies. You can click on the "Name" or "Base Value" table headers to change the sort.

💡 Tip Currency with the slug of "common" will be marked with the leaf. Otherwise, if no currency has a slug of "common", your currency with the highest base_value and available = 1 and convertible = 1 will be your common value. If more than one "common" currency is available with identical base_values, the first one found will be used.

💡 Tip Currency with the slug of "base" defined will be marked with a "money" icon. Otherwise, if no currency has a slug of "base", your currency with the lowest base_value and available = 1 and convertible = 1 will be your base value. If more than one currency is available with identical base_values, the first one found (lowest ID) will be used.


Create currency

If you have ACL enabled, you will need the 'lex.acl.create' permission to access this page.

From the Currencies index page, you will see a large "Add New Currency" button (like the blue one in the image below)

Clicking that button will bring you to a form to input your new role.

Note All of the fields are mandatory except for type and notes.

The name field is a user-friendly name for your personal reference within your application. It is not used for any methods, that is the purpose of the slug field.

For example, you can use the Name "Special Blue Crystals" for user-friendly naming and the slug of "blue". When using Lex methods you would use Lex::value('blue');

The next six fields are added as they are common staples of gaming and are here for convenience. The availability of these fields does not mean that Lex will institute methods for "trading/selling/looting/etc..." within your game itself. These are here to make it easier for you to find associated fields. Lex only provides convert methods.

i.e. Lex::discoverable()->get(); will return all your currencies that are able to be discovered so that your "loot / search" method can reference this to get the discoverable currencies.

convertible Determines whether or not this currency be converted / exchanged into other currencies. If it can not be converted, then it will require exact values for use in trading / selling / etc...

Example : "Gold" is marked as not convertible. You have an item that sells for 11 "gold". Your user will need to have exactly 11 gold to purchase that item. They won't be able to exchange any number of silver or dollars to obtain that item. However if you mark "gold" as convertible, eventually your user will earn enough of your 'other currencies' to eventually have 11 gold to purchase the item.

tradeable Can your users trade this currency between themselves? (if you have some sort of "trade" method in your game)

sellable Can your users sell this currency between themselves? (if you have some sort of "sell currency" method in your game)

rewardable Can your users give this currency away? (if you have some sort of "sell currency" method in your game)

discoverable Can your users "find" this currency in your game? (if you have some sort of "looting / searching" method in your game)

available Is this type of currency still available in your game? Retired means that it was in use, but is no longer in use anymore but it still retains its value. Devalued means that it is no longer available and is now worthless.

type Optional - A convenience field to allow you group / classify your currencies if you wish.

A common staple of currencies in gaming is to have "special" or "temporary" currencies. Or you could have a classification system of "common", "rare", "epic", "legendary" etc....

notes Optional - A convenience field to keep any info/notes on your currencies if you wish.


Show currency

If you have ACL enabled, you will need the 'lex.acl.show' permission to access this page.

You will be able to click on the View button for that currency and be brought to a page that will show you information about that currency, with a link to edit the currency if you wish.

NOTE In the image above, the View button is coloured blue and is the first in the group.


Edit currency

If you have ACL enabled, you will need the 'lex.acl.edit' permission to access this page.

You will be able to click on the Edit button for that currency and be brought to a page that will let you edit the currency if you wish. The same fields as above in the Create currency section will be available.

NOTE In the image above, the Edit button is coloured dark grey and is the second in the group.


Destroy currency

If you have ACL enabled, you will need the 'lex.acl.destroy' permission to access this page.

From the index page you will be able to click on the Delete button for that currency.

NOTE In the image above, the Delete button is coloured red and is the last in the group.

If you click that button, your currency will be deleted.

💡 TIP - You should probably have some method in your master layout that requires confirmation of a delete.

For example, if you are using the SmarchSoftware\Watchtower packaged layouts, you will need to confirm that you want to delete the currency.

NOTE If you confirm and delete the currency, it is gone. There is no going back.


Totals

If you have ACL enabled, you will need the 'lex.cumulative.view' permission to access this page and 'lex.cumulative.edit' to make any changes to the cumulative currency totals.

From the index page you will be able to click on the Totals button for any given currency. (In the following image it is the third available button and it is coloured green)

That will take you to a page where you can see which characters/users of your app that have that currency and the cumulative totals of that currency.

NOTE By default the list of accounts is not visible. You have to click the "View Accounts" button in the upper right hand side to expose them.

You will also be able to add/remove the currency from your characters/users as well on the bottom half of the page.

NOTE By default the "Select All" checkbox is selected. To expose and choose individual accounts, you will need to deselect that checkbox.