- Slots
- Item (type) json
- Item Specs
- Item naming + description
- ammo
Slots
Slots are like the "filtered" containers of items, only those item can fit that are set to be able to in that slot.
Slots also can have a background image (like a gryed weapon shape)
- you need to make all new slots an image to gfx/items/
- in this name: z_default_<slotname>.png
Item type json
This holds the "type" information of an item.
If you modify an item or add a new item,
1. you need to execute a new Python sctipt:
Code: Select all
gen_json_to_flatbuffer.pyCode: Select all
pip install flatbuffersAttributes:
Code: Select all
public String typeName; //type/sprite code-name [! MUST be lowercase and instead of commas use _ to separate words: eg: "gun_dragunov" or "sword_claymore"]
public ItemVisual visualInInventory; // the texture to use in inventory
-> public String imgName; //eg: techs/upg_turtleship_upg1.png or units/turtleship_upg1.png
-> public int imgColumns; //defining how many animation stages are there
-> public Integer animFrameDuration; //unit animation how long a frame to show in millisecs, in case of NULL it will be the default 200ms.
public ArrayList<String> itemGroups; //item group(s) (what item group it is in - arbitrary naming), use to reference one or more items ! Read below the SPECIAL group positions in this array!
public ArrayList<EItemSpec> itemSpecs = null; //the enum values of specs
public ArrayList<String> trnItemSpecs; //this needs to be tranlated to be itemSpecs
public ArrayList<String> slotsFitIn; //list of slot types it can be placed into - can be "backpack" also listed meaning will give effect in backpack too.
public ArrayList<String> slotsActivates; //list of slot types when placed it will activate its effect (subset of slotsFitIn)
public String trnEffectDefID = null; //effect (what effect it will add to the unit if placed in a usable slot)
transient public int effectDefID = 0;
public int stackableMax = 0; //max stack size (0 and 1 means non stackable)
public float shopBasePrice; //basic price in "PRG currency", shops can alter it though, the "change" can be the fractional part?
public ArrayList<String> fixCondOnGroups; //items groups it fixes condition on
public float fixCondBy; //canfix condition by percent
public float wearBy; //all usage of the item will make it wear this percent
public String soundOnUse; // like a packName: "SOUND_PACK_UNIT_ATTACK_SWING", will sound on use.
public ArrayList<String> craftableFrom; // all string is a group name or item name and a number. eg. "weapon:2"
public String setID; //if item is part of a set, than this set.
public ArrayList<String> setCompleteWith; //list of group/item names
public String trnSetEffectDefID = null; //effect (what effect it will add to the unit if the set is complete)
transient public int setEffectDefID = 0;
public String skinsUnitWhenUsed; //can be skin seq (the seq nr of the skins of the unit) eg. "2" or the skinPackID of the skins of the unit eg. "LEATHER_PACK".
Item Specs
Code: Select all
IS_CONSUMABLE, //the item is consumable to "character" so it will take effect and vanish on usage
IS_AMMO, //is works like ammo, reduced by one on attack if in proper ammo slot, can only attack if have this
IS_NEED_AMMO, //set it on a weapon that needs and ammo to shoot
IS_MONEY, //this is set the the money items it can have decimals too
IS_MENDING, //it will fix condition drop of items of given group
IS_USED_FOR_ATTACK, //is it the weapon the unit uses to attack
IS_WEARING_ON_ATTACK, //if this set the item will get wear on it on each attacking
IS_WEARING_ON_USE, //if item used (eg. for mending) it loses condition
IS_WEARING_ON_DAMAGED, //if this set the item will get wear on it on each damage the unit takes (number of damage, not amount)
IS_WEARING_ON_MOVE, //if this set the item will get wear on it on each move action by the unit
SKIN_IF_SET_IS_FULL // the skin will only work if it is in a set and set is complete
SKIN_AS_A_TRANSFORM, // the skin is a transform instead, go transform the unit to the desired (Kinda hardcoded version as mapdesigner can not handle!)
SKIN_AS_A_TRANSFORM_GROUP, // the skin is a transform instead by trnTransformToGroups, eg. TRANSFORM_TO_SMG (so if that unit have SMG transform it will do that)
IS_WEAR_SHOWS_CAPACITY, //in case of ammo magazine, multi heal potions and so on case the "wear" is a capacity. Using such item will reduce condition according to this value.
GFX_NEED_NO_PADDING //if the png have no space around the art, than the default gives a (now 6dp) padding around it, if this set, there is not paadding
Group(ing) SPECIAL group settings
1. FIRST group in the group list = ITEM GENRE: meaning a shop/merchant will buy your stuff IF this group matches to ANY of the items it sells (will buy it on a very low price though)
2. LAST group in the list = REFILL relation: meaning a "IS_WEAR_SHOWS_CAPACITY" item can be refilled by this item IF the LAST group names are matching.
Ammo
To match which ammo is good for which weapon the item group should fit (ammo should have a group that exists among groups of the weapon)
example:
- pistol groups: gun, lightammo
- ammo groups: lightammo
this way that ammo can be used with that gun.
Magazines for ammo refill mag (or just a potion)
There is option to use an item having multiple ammos/apotiondrinks/usages of it
The logic uses the "condition" internally as "capacity" (if IS_WEAR_SHOWS_CAPACITY is set)
this case the wearBy field have the "number of cartidges" in a magazine (and similarly to any othte item the "capacity")
these magazines can fill each other if that is proven their cartidges are the same: they are the same if the LAST groupname of each is fitting.
eg:
"itemGroups": ["ammo","ammo_small","mag","ammo_5_45x39mm"],
is set to a magazine, so it will let load from other magazines IF the LAST (this case "ammo_5_45x39mm") groupname is the same!
Item name + Description
Name:
The item name can come from the strings file it is looked in strings like "ITEM"+<itemtypename> so eg: ITEM_sword_claymore
can also be overwritten by player in mapeditor in itemNiceName
Where the designer can use the "MSGID:" to reference also a string name. ("MSGID:<string id>" eg: "MSGID:ITEM_sword_claymore")
Description
Can be set by player in mapeditor in itemDesc
Where the designer can use the "MSGID:" to reference also a string name. ("MSGID:<string id>" eg: "MSGID:ITEM_sword_claymore")