Create a new Item List
A shopping list consists of a group of items, with a defined price and probability of appearing in the store.
A list can be assigned to a store level, which will be reached by collecting a certain amount of experience. Lists can include all types of GameActors, so both Characters and Items can be sold at the same time.
The following type of lists are included in this package:
- individual item list: Each item has its own price and probabilistic weight.
- Group item list: The items are divided into groups that have their own price and probabilistic weight. The item chosen within the group is random.
- Deck list: It behaves like a deck of cards. There is the discard deck, hand and the deck itself. When the deck cards run out, they are shuffled with the discard cards. Ideal for Roguelike-Deckbuilder type games.
The following will show how to create each of the lists described above.
Create an Individual Item List.
1. Right click on the project, click on "Create/Auto-Battle Framework/IShopList/ScriptableIndividualItemList".
Create a new Scriptable Individual Item List.
2. Create a new element in the Individual Shop List.
- Attach the Scriptable Shop Item of the GameActor to be sold.
- Item Cost: Amount of currency it costs to buy the GameActor.
- Item Probability Weight: Probabilistic weight of appearance in the store.
3. Repeat the second step until you consider the list to be complete.
Example of Individual Shop List. Characters have a 10% chance each to appear in the store, while items have a 30% chance each.
Create a Group Item List.
1. Right click on the project, click on "Create/Auto-Battle Framework/IShopList/ScriptableGroupItemList".
Create a new Scriptable Group Item List.
2. Create a new element in the Group Shop List.
- Probability: Probabilistic weight of appearance in the store. An item is chosen at random from the chosen group.
- Cost: Amount of currency that it costs to buy an item belonging to this group.
- Add the Scriptable Shop Items of the GameActors that belong to this group. (Ignore the Item Cost and Item Probability Weight fields, since they are defined within the group).
3. Repeat the second step until you consider the list to be complete.
Example of Group Shop List. Level 1 have a 60% chance each to appear in the store (cost 1), items have a 30% chance (cost 2) and Lv2 characters have a 10% chance (cost 5).
Create a Deck List.
This type of list has a characteristic behavior of a deck of cards. The GameActors to buy will appear in order in the deck. Once the store is refreshed, they will go to the discard list. When there are no more in the deck, the cards from the discard list will be shuffled and go to the main deck.
1. Right click on the project, click on "Create/Auto-Battle Framework/IShopList/ScriptableDeckList".
Create a new Scriptable Deck List.
2. Create a new element in the Deck List list.
- Attach the Scriptable Shop Item of the GameActor to be sold.
- Item Cost: Amount of currency it costs to buy the GameActor.
- Item Probability Weight: Ignore this field, since the list has the behavior of a deck of cards, the items will come out in list order.
3. Repeat the second step until you consider the list to be complete.
*Example of Group Shop List. Characters and items go in the same deck. The cost of the characters is 2, and the cost of the items is 3.
Create a new Shop Level
1. Select the ShopManager in the scene, found under "Auto-Battle/Shop Manager". Add a new element in the Shop Level Manager - Shop Levels list.
2. In the List field of the new item, select a previously created Shop List. Enter the experience required to reach this level from the previous level. *Add a new level to the Shop Level Manager. Set the experience required to reach this level.