RPG maps, hero with inventory
Posted: Mon Jun 02, 2025 9:26 pm
contents:
- Inventory
- Items
- Ammo/arrows
- shops
- special features of items
- How to make a "hero" to have inventory and add items
Inventory,
You can have inventory
a) on a fixed unit type (so by default it has eg. a hero unit)
b) or you add inventory to ANY unit on your map (mapeditor) (by longpressing the unit and seelct "create inventory")
The inventory have 2 parts
- storage (like a backpack / store-storage),
- slots (named slots like weapon/ring/armor/Shield)
on each itemtype it is defined what slots they can go in,
,
Items,
- you can add items by entering a unit/building/chest that already have inventory (double tap),
- press the magnifier button on top,
- select items (and amounts) to add to "storage",
- you can set item name, description, condition, prices (if you want different than itemtype based prices.),
Ammo/arrows
Some items can be set to be ammo type, so they are required to attack, and will be reduced by one on each attack.
If the item is placed in a named slot (eg. "ammo") than that item will be reduced on attack.
so ammo slot (that can hold an ammo item) must only be for a unit having such weapon.
[not implemented]Multiweapon units
If you unit have multiple attacks eg. base attack melee, but have a ranged ability (eg. archer-bow)
this case you can define
- a slot for the melee attack (sword)
- and another slot for the ranged attack (bow)
but this case you need to tell on each slot that they are related to which ability/attack.
ATTACK or the ability name. the default is ATTACK
so whne unit attacks/uses ability the item in the corresponding slot will get the "wear" and if ammo is assigned - the ammo is reduced.
shops,
You can set a unit (building/merchant) to be a shop, by
a) longpress on unit and in "spec flags" button you can select the "Is shop" option
b) adding IS_INV_SHOP spec, use the trigger exec command with ADDSPEC:IS_INV_SHOP
If you need new items ask stratego to add them to game.
Waltkru: To make a shop in mapeditor:
- be sure you have "money" set in items, money needs to have: IS_MONEY spec
- make a neutral structure
- give it "storage" eg. default 8 (do not give named slots)
- set it be ADDSPEC:IS_INV_SHOP
- put there the items THAT shop can sell/buy
(at this point items have their "stock price" meaning the predefined price on sell + 0.9% on buy it is - 0.9% or so)
- but you can override its price by setting sell/buy prices on the item in the storage.
(this way you can make that on EAST end of map same item is much costier than on the WEST end of the map.)
Future ideas (not yet ready):
1. SELLING SIMILAR ITEMS to shop: shops can buy also items not in shop but only similar same "groups" as items you have in shop
- so u can make a "Gun-shop",
- and place only 2 type of guns to sell to player,
- but all type of guns will be able to buy from player based on their "group similarities"
(so as mapdesigner you dont need to put in all shops all items you want to be able to sell.
2. CHANGING BASE PRICE: there is an option to enter a "mean" (base) price to items (not used currently) but the plan was on ANY map you can change the general mean(base) price of an item type (that will be used for the auto +0.9%/-0.9% calculations.
shop - pricing
The item price has different levels, also mapdesigner can override them.
1. Initially we have
- base price (set on item "type" in attribute shopBasePrice)
- buy price (to buy from shop) - calculated from base price by multiplaying by 1.1
- sell price (to sell to shop) - calculated from base price by multiplaying by 0.9
2. if mapdesigner want to override this price in a specific shop than he can set its price directy in that shop
- buy price (to buy from shop) - this setting overrides the #1 calculation
- sell price (to sell to shop) - this setting overrides the #1 calculation
3. Condition: item conditions influence the price, so you can sell and buy items on lower prices if the condition is low.
3. [not implemented] If player sets on the unit the "Mean" price value than that means to "override" the "base price" of the item Type.
So if ANYWHERE on map it is set, the logic finds it and this price will be used instead of the one on the Itemtype.
This will be the base for the 0.9 and 1.1 multiplications written in #1.
4.a: Items not listed in shop still sellable to shop: this case the item is checked by its FIRST group name, and if with same group there are itam in shop than its becomes SELLABLE! But! the shop will get these in very low price like 30% of base price.
4. [not implemented] Shops basically can purchase only the items from players they also sell. BUT! if player tryies to sell an item not sold by the shop, the shops will check the item "categories" and any other item with SAME catogories are in shop than it will apply similar pricing to this new item (comparing their base prizes naturally)
example:
- shop sells sword1 and sword2
- so basically it can purchase from unit the sword1 sword2
- BUT! if the unit tries to sell sword3 that has same categories than sword1 and sword2
- than shop reads
-- the sword3 itemtype-level (or if were set the game-level "base" price)
-- gets the base price for eg. sword1 (type or game level)
-- gets the % values of buy/sell prizes of sword1 (compared to base price) - buy sell prizes can be the overwritten values of that item in this shop.
-- applyies the same % on the sword3 base price determining its buy/sell costs
special features of items
(ask stratego to set them)
- item can lose condition on use (weapons, armor, items) - needs to be set to this or that item
- item can be part of a "set" if th full set is worn by the unit eg. sword+armor+shield than unit can have an enchantment or a new skin.
- item can result in changing to a skin of the unit
- different shops can sell same item on different prices, the base price is set on item type, but you override it in the shop, making is costier or cheapter there.
- there is "crafting" option combining 2 items to have a 3rd item.
- we have consumable items to have temporary/permanent boosts
- and we have normal items increasing stats or adding enchantment to unit.
- ...
How to make a "hero" to have inventory and add items
- make a random new skirmish map
- put down any unit
- longpress on unit and seelct "create inventory" button to add inventory to it (give some slot names too)
- and after double click unit to see its ionventory and press
button to add items to unit.
- longpress on unit to set other flags (eg. "Is shop" if you want it to be a merchant type of unit selling items, or if you want a unit be "inattackable" eg. neutral units will not get attacked by ai this case and many other flags you can set)
- Inventory
- Items
- Ammo/arrows
- shops
- special features of items
- How to make a "hero" to have inventory and add items
Inventory,
You can have inventory
a) on a fixed unit type (so by default it has eg. a hero unit)
b) or you add inventory to ANY unit on your map (mapeditor) (by longpressing the unit and seelct "create inventory")
The inventory have 2 parts
- storage (like a backpack / store-storage),
- slots (named slots like weapon/ring/armor/Shield)
on each itemtype it is defined what slots they can go in,
,
Items,
- you can add items by entering a unit/building/chest that already have inventory (double tap),
- press the magnifier button on top,
- select items (and amounts) to add to "storage",
- you can set item name, description, condition, prices (if you want different than itemtype based prices.),
Ammo/arrows
Some items can be set to be ammo type, so they are required to attack, and will be reduced by one on each attack.
If the item is placed in a named slot (eg. "ammo") than that item will be reduced on attack.
so ammo slot (that can hold an ammo item) must only be for a unit having such weapon.
[not implemented]Multiweapon units
If you unit have multiple attacks eg. base attack melee, but have a ranged ability (eg. archer-bow)
this case you can define
- a slot for the melee attack (sword)
- and another slot for the ranged attack (bow)
but this case you need to tell on each slot that they are related to which ability/attack.
ATTACK or the ability name. the default is ATTACK
so whne unit attacks/uses ability the item in the corresponding slot will get the "wear" and if ammo is assigned - the ammo is reduced.
shops,
You can set a unit (building/merchant) to be a shop, by
a) longpress on unit and in "spec flags" button you can select the "Is shop" option
b) adding IS_INV_SHOP spec, use the trigger exec command with ADDSPEC:IS_INV_SHOP
If you need new items ask stratego to add them to game.
Waltkru: To make a shop in mapeditor:
- be sure you have "money" set in items, money needs to have: IS_MONEY spec
- make a neutral structure
- give it "storage" eg. default 8 (do not give named slots)
- set it be ADDSPEC:IS_INV_SHOP
- put there the items THAT shop can sell/buy
(at this point items have their "stock price" meaning the predefined price on sell + 0.9% on buy it is - 0.9% or so)
- but you can override its price by setting sell/buy prices on the item in the storage.
(this way you can make that on EAST end of map same item is much costier than on the WEST end of the map.)
Future ideas (not yet ready):
1. SELLING SIMILAR ITEMS to shop: shops can buy also items not in shop but only similar same "groups" as items you have in shop
- so u can make a "Gun-shop",
- and place only 2 type of guns to sell to player,
- but all type of guns will be able to buy from player based on their "group similarities"
(so as mapdesigner you dont need to put in all shops all items you want to be able to sell.
2. CHANGING BASE PRICE: there is an option to enter a "mean" (base) price to items (not used currently) but the plan was on ANY map you can change the general mean(base) price of an item type (that will be used for the auto +0.9%/-0.9% calculations.
shop - pricing
The item price has different levels, also mapdesigner can override them.
1. Initially we have
- base price (set on item "type" in attribute shopBasePrice)
- buy price (to buy from shop) - calculated from base price by multiplaying by 1.1
- sell price (to sell to shop) - calculated from base price by multiplaying by 0.9
2. if mapdesigner want to override this price in a specific shop than he can set its price directy in that shop
- buy price (to buy from shop) - this setting overrides the #1 calculation
- sell price (to sell to shop) - this setting overrides the #1 calculation
3. Condition: item conditions influence the price, so you can sell and buy items on lower prices if the condition is low.
3. [not implemented] If player sets on the unit the "Mean" price value than that means to "override" the "base price" of the item Type.
So if ANYWHERE on map it is set, the logic finds it and this price will be used instead of the one on the Itemtype.
This will be the base for the 0.9 and 1.1 multiplications written in #1.
4.a: Items not listed in shop still sellable to shop: this case the item is checked by its FIRST group name, and if with same group there are itam in shop than its becomes SELLABLE! But! the shop will get these in very low price like 30% of base price.
4. [not implemented] Shops basically can purchase only the items from players they also sell. BUT! if player tryies to sell an item not sold by the shop, the shops will check the item "categories" and any other item with SAME catogories are in shop than it will apply similar pricing to this new item (comparing their base prizes naturally)
example:
- shop sells sword1 and sword2
- so basically it can purchase from unit the sword1 sword2
- BUT! if the unit tries to sell sword3 that has same categories than sword1 and sword2
- than shop reads
-- the sword3 itemtype-level (or if were set the game-level "base" price)
-- gets the base price for eg. sword1 (type or game level)
-- gets the % values of buy/sell prizes of sword1 (compared to base price) - buy sell prizes can be the overwritten values of that item in this shop.
-- applyies the same % on the sword3 base price determining its buy/sell costs
special features of items
(ask stratego to set them)
- item can lose condition on use (weapons, armor, items) - needs to be set to this or that item
- item can be part of a "set" if th full set is worn by the unit eg. sword+armor+shield than unit can have an enchantment or a new skin.
- item can result in changing to a skin of the unit
- different shops can sell same item on different prices, the base price is set on item type, but you override it in the shop, making is costier or cheapter there.
- there is "crafting" option combining 2 items to have a 3rd item.
- we have consumable items to have temporary/permanent boosts
- and we have normal items increasing stats or adding enchantment to unit.
- ...
How to make a "hero" to have inventory and add items
- make a random new skirmish map
- put down any unit
- longpress on unit and seelct "create inventory" button to add inventory to it (give some slot names too)
- and after double click unit to see its ionventory and press
- longpress on unit to set other flags (eg. "Is shop" if you want it to be a merchant type of unit selling items, or if you want a unit be "inattackable" eg. neutral units will not get attacked by ai this case and many other flags you can set)