Hi all,
I'm trying to make a SP RPG mission for ARMA 2. I'd like it to be similar to Sahrani/Chernarus Life's shops/fishing/hunting/licenses/banking/jobs, but SP (and minus the cops). I've tested out both SPON Money and RUG inventory, and have found that both contain parts that would be useful to my project, yet neither is a complete solution.
What I'm trying to accomplish is:
- Create a custom group of items.
- Have the items in a separate inventory (not gear).
- Be able to collect the items in different ways (some are purchased, some collected, some awarded for completing tasks, etc).
- Be able to use the items in different ways (sell some, use some to enable purchase/use of vehicles (like licenses), etc).
My immediate goal is to have a separate inventory that will store everything that can't be placed into a player's gear, and populate it with an item that I can buy/sell in shops. I'd like to start with a fish, and go from there. Eventually I'd like to learn how to set up a fishing script so I can gather fish to sell, but first things first.
I'll use the fish item to give you an idea of where I'm at (I need a lot of help):
I like SPON Money's interface and how easy it is to buy/sell things compared to RUG Inventory's trade, but SPON Money's demo only uses items built into the game as examples, and I haven't been able to figure out how to add a fish and set it up so that it has the proper information for the way the SPON Money demo is set up. I've found this code in initMoney.sqf, which is where I believe I should start:
SPON_weaponsShoppingInfo = [];
SPON_magazinesShoppingInfo = [];
SPON_vehiclesShoppingInfo = [];
{
_prices = call compile preprocessFileLineNumbers _x;
SPON_weaponsShoppingInfo = SPON_weaponsShoppingInfo + (_prices select 0);
SPON_magazinesShoppingInfo = SPON_magazinesShoppingInfo + (_prices select 1);
SPON_vehiclesShoppingInfo = SPON_vehiclesShoppingInfo + (_prices select 2);
} forEach _prices;
...which I assume is where I would add my new group:
SPON_weaponsShoppingInfo = [];
SPON_magazinesShoppingInfo = [];
SPON_vehiclesShoppingInfo = [];
SPON_itemsShoppingInfo = [];
{
_prices = call compile preprocessFileLineNumbers _x;
SPON_weaponsShoppingInfo = SPON_weaponsShoppingInfo + (_prices select 0);
SPON_magazinesShoppingInfo = SPON_magazinesShoppingInfo + (_prices select 1);
SPON_vehiclesShoppingInfo = SPON_vehiclesShoppingInfo + (_prices select 2);
SPON_itemsShoppingInfo = SPON_itemsShoppingInfo + (_prices select 3);
} forEach _prices;
...as well as set up the config info for my new group similar to this:
SPON_getWeaponConfig =
{
SPON_GET_PARAMS_1(_name);
private ["_config", "_description"];
_config = (configFile >> "CfgWeapons" >> _name);
_description = getText (_config >> "displayName");
_libDesc = getText (_config >> "Library" >> "libTextDesc");
[_description, _libDesc]; // Return.
};
...and this is where I am stuck. I want to create a file called Items.sqf, populate it with my custom items, but I'm not sure how to set up the items config so that initMoney.sqf knows where to look to find the item names, descriptions, etc.
Also, I don't know how to create a separate inventory which will store all of the items I buy/collect and keep track of their amounts.
I've figured out where to put the prices for my custom items (examplePrices.sqf), so I think I've found all the easy stuff.
And, yes, my familiarity with the scripting language and syntax is almost nill. I've been playing around in the editor, but want to start doing more!
So, if anyone is bored and is willing to point me in the right direction, I'd appreciate it!