Jump to content
socs

Buying Recruits In Ravage

Recommended Posts

Hey all... Is there a way I can set up a system at the safe zone (using ravage mod) and allow a player to essentially "buy" units to be a part of their squad? So this way when they have enough of some sort of currency or some amount of kills they can got to an object and buy like a set of units and those units spawn in and become part of that persons squad? This would be really cool and make the ravage mod a lot more interesting in singleplayer. Also if someone wouldn't mind telling me how I would go about setting up the "currency" system or the kill system that would be great! Thanks!

Share this post


Link to post
Share on other sites
1 minute ago, HazJ said:

You might be better asking in the official related thread. Also, did you check here?

http://ravage.wikia.com/wiki/Ravage_Wikia

>>> http://ravage.wikia.com/wiki/Creating_a_safe_zone

This isn't about the safe zone at all... I know how to create the safe zone.. I'm asking about a currency system that's used to buy a specific set of units... Sorry about the confusion.

Share this post


Link to post
Share on other sites

No worries, my bad anyway. I assume Ravage doesn't offer anything close to this feature then and that you wish to create it yourself? What is your scripting knowledge like?

  • Like 1

Share this post


Link to post
Share on other sites
10 minutes ago, HazJ said:

No worries, my bad anyway. I assume Ravage doesn't offer anything close to this feature then and that you wish to create it yourself? What is your scripting knowledge like?

No worries here as well. Ravage doesn't necessarily offer any sort of currency system whatsoever, and about my scripting knowledge, if there was a category below not knowing anything, I'd fit right in lol. I can script like very little to none.. I do know how to place files in the arma 3 folder etc and know what you'd be talking about if you named a specific file for example "init.sqf" and such but as far as doing my own scripting, we have a better chance at the world ending tomorrow then I do making my own stuff lol... I just need a form of currency/shop system that I can use to buy guns and vehicles (which I have found plenty of these) but nothing that pertains to being able to buy a set of units meaning lets say, If i get 10 dollars for every zombie kill, then once I get x amount of money i'd be able to buy a "rifle squad" and have that same rifle squad under he command of the player that bought them... Also be able to buy fuel for a vehicle.. For example, I give the players one helicopter/tank at the HQ that they must buy gas for before they can attempt at using it... What would be cool is if I could set the max amount of gas that they could buy at once, again, for example like, 10% fuel for 10k or something... If any of this really makes sense to you at all im not sure.. But this is the kind of miscellaneous stuff im looking for in a shop.. 

  • Like 1

Share this post


Link to post
Share on other sites

Hehe. You actually motivated me to update a very old system for AI Recruitment I did. If you can wait a little. I'll make a separate version for Ravage as well.

  • Like 1

Share this post


Link to post
Share on other sites
Just now, HazJ said:

Hehe. You actually motivated me to update a very old system for AI Recruitment I did. If you can wait a little. I'll make a separate version for Ravage as well.

Mind if i take a look at the old one you had if possible? Just to see what kind of stuff it offers?

Share this post


Link to post
Share on other sites

No. It is too embarrassing, lol. You can probably find it "somewhere" if you look. :rofl:

New one should be ready in an hour or so.

  • Thanks 1

Share this post


Link to post
Share on other sites
Just now, HazJ said:

No. It is too embarrassing, lol. You can probably find it "somewhere" if you look. :rofl:

New one should be ready in an hour or so.

Ahhh alright man, I really appreciate that... Thank you a ton!

Share this post


Link to post
Share on other sites

Screenshots below!

I got distracted but I'll share current 'working' build v0.1 - very early WIP version. You should be able to get some idea from it.

https://drive.google.com/open?id=1tUg1XFvuCRY5GG8ils-5Rtv_ryRcQ0G0

I'll finish full version + Ravage version this week. Tomorrow and Friday evening I am out. Hopefully Thursday, should have time. It works as far as my tests go. Not very configurable for new users though. Some features such as AI loadout customisation is not done either, etc... Notes:

fn_createAI.sqf

#define MAX_AI 5
#define CHUTE_ALTITUDE 50

config_master.hpp

	unitTypesWEST[] =
	{
		"B_Soldier_SL_F",
		"B_Soldier_A_F",
		"B_Soldier_AR_F",
		"B_Soldier_GL_F",
		"B_Soldier_exp_F",
		"B_Soldier_LAT_F",
		"B_Soldier_AT_F",
		"B_Soldier_AA_F",
		"B_Medic_F",
		"B_Engineer_F"
	};
	unitTypesEAST[] =
	{
		"O_Soldier_SL_F",
		"O_Soldier_A_F",
		"O_Soldier_AR_F",
		"O_Soldier_GL_F",
		"O_Soldier_exp_F",
		"O_Soldier_LAT_F",
		"O_Soldier_AT_F",
		"O_Soldier_AA_F",
		"O_Medic_F",
		"O_Engineer_F"
	};
	unitTypesGUER[] =
	{
		"I_Soldier_SL_F",
		"I_Soldier_A_F",
		"I_Soldier_AR_F",
		"I_Soldier_GL_F",
		"I_Soldier_exp_F",
		"I_Soldier_LAT_F",
		"I_Soldier_AT_F",
		"I_Soldier_AA_F",
		"I_Medic_F",
		"I_Engineer_F"
	};
	unitTypesCIV[] =
	{
		"C_man_1"
	};

To use:

Add an action, key press or whatever.

[] spawn Haz_fnc_initAIRecruitment;

NFuh0GI.jpg
R4vfd4C.jpg
j2YZYYa.jpg
qWKkhJJ.jpg

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
5 minutes ago, HazJ said:

Screenshots below!

I got distracted but I'll share current 'working' build v0.1 - very early WIP version. You should be able to get some idea from it.

https://drive.google.com/open?id=1tUg1XFvuCRY5GG8ils-5Rtv_ryRcQ0G0

I'll finish full version + Ravage version this week. Tomorrow and Friday evening I am out. Hopefully Thursday, should have time. It works as far as my tests go. Not very configurable for new users though. Some features such as AI loadout customisation is not done either, etc... Notes:

fn_createAI.sqf


#define MAX_AI 5
#define CHUTE_ALTITUDE 50

config_master.hpp


	unitTypesWEST[] =
	{
		"B_Soldier_SL_F",
		"B_Soldier_A_F",
		"B_Soldier_AR_F",
		"B_Soldier_GL_F",
		"B_Soldier_exp_F",
		"B_Soldier_LAT_F",
		"B_Soldier_AT_F",
		"B_Soldier_AA_F",
		"B_Medic_F",
		"B_Engineer_F"
	};
	unitTypesEAST[] =
	{
		"O_Soldier_SL_F",
		"O_Soldier_A_F",
		"O_Soldier_AR_F",
		"O_Soldier_GL_F",
		"O_Soldier_exp_F",
		"O_Soldier_LAT_F",
		"O_Soldier_AT_F",
		"O_Soldier_AA_F",
		"O_Medic_F",
		"O_Engineer_F"
	};
	unitTypesGUER[] =
	{
		"I_Soldier_SL_F",
		"I_Soldier_A_F",
		"I_Soldier_AR_F",
		"I_Soldier_GL_F",
		"I_Soldier_exp_F",
		"I_Soldier_LAT_F",
		"I_Soldier_AT_F",
		"I_Soldier_AA_F",
		"I_Medic_F",
		"I_Engineer_F"
	};
	unitTypesCIV[] =
	{
		"C_man_1"
	};

To use:

Add an action, key press or whatever.


[] spawn Haz_fnc_initAIRecruitment;

NFuh0GI.jpg
R4vfd4C.jpg
j2YZYYa.jpg
qWKkhJJ.jpg

I kind of have an idea of how this works, I can modify the troops and enter the unit type manually for UNSUNG troops instead and add some sort of cost when recruiting then it would basically be perfect as I don't expect you to do everything for me.. I did find another script that was completed recently may 8th which ill look over and see if I can incorporate it somehow into this... Ill watch some videos and work on it myself and share with you as well if you'd like... I appreciate this, thanks a bunch! 

Share this post


Link to post
Share on other sites

You can edit the config.cpp to add UNSUNG or whichever classnames. You can also easily change this to add price. Changes below. Download and screenshot at bottom. You will need to implement your own money system if there isn't one setup in Ravage already.

	unitTypesWEST[] =
	{
		{"B_Soldier_SL_F", 125},
		{"B_Soldier_A_F", 100},
		{"B_Soldier_AR_F", 75},
		{"B_Soldier_GL_F", 50},
		{"B_Soldier_exp_F", 45},
		{"B_Soldier_LAT_F", 35},
		{"B_Soldier_AT_F", 25},
		{"B_Soldier_AA_F", 15},
		{"B_Medic_F", 10},
		{"B_Engineer_F", 5}
	};
	unitTypesEAST[] =
	{
		{"O_Soldier_SL_F", 125},
		{"O_Soldier_A_F", 100},
		{"O_Soldier_AR_F", 75},
		{"O_Soldier_GL_F", 50},
		{"O_Soldier_exp_F", 45},
		{"O_Soldier_LAT_F", 35},
		{"O_Soldier_AT_F", 25},
		{"O_Soldier_AA_F", 15},
		{"O_Medic_F", 10},
		{"O_Engineer_F", 5}
	};
	unitTypesGUER[] =
	{
		{"I_Soldier_SL_F", 125},
		{"I_Soldier_A_F", 100},
		{"I_Soldier_AR_F", 75},
		{"I_Soldier_GL_F", 50},
		{"I_Soldier_exp_F", 45},
		{"I_Soldier_LAT_F", 35},
		{"I_Soldier_AT_F", 25},
		{"I_Soldier_AA_F", 15},
		{"I_Medic_F", 10},
		{"I_Engineer_F", 5}
	};
	unitTypesCIV[] =
	{
		{"C_man_1", 1},
	};
{
	private _unitType = _x select 0;
	private _unitPrice = _x select 1;
	private _displayName = getText (configFile >> "CfgVehicles" >> _unitType >> "displayName");
	private _picture = getText (configFile >> "CfgVehicles" >> _unitType >> "picture");
	if (count _unitTypes > 0) then
	{
		private _item = lbAdd [700, format ["%1", _displayName]];
		(_display displayCtrl 700) lbSetTextRight [_item, format ["$%1", _unitPrice]];
		// lbSetPicture [700, _item, _picture];
		(_display displayCtrl 700) lbSetData [_forEachIndex, _unitType];
		(_display displayCtrl 700) lbSetValue [_forEachIndex, _unitPrice];
		lbSetCurSel [700, 0];
	};
} forEach _unitTypes;
private _unitType = lbData [700, (lbCurSel 700)];
private _unitPrice = lbValue [700, (lbCurSel 700)];
private _spawnType = uiNamespace getVariable ["spawnType", 0];

if (_currentAI > MAX_AI) exitWith
{
	hintSilent "You have reached the maximum AI count.";
};

if (1000 < _unitPrice) exitWith
{
	hintSilent "Insufficient funds. Purchase cancelled.";
}:

vSFEfo2.jpg

https://drive.google.com/open?id=1K2F24jrciWvG0orYGNvKw7CEVcN7GdCl

  • Like 1

Share this post


Link to post
Share on other sites
11 minutes ago, HazJ said:

You can edit the config.cpp to add UNSUNG or whichever classnames. You can also easily change this to add price. Changes below. Download and screenshot at bottom. You will need to implement your own money system if there isn't one setup in Ravage already.


	unitTypesWEST[] =
	{
		{"B_Soldier_SL_F", 125},
		{"B_Soldier_A_F", 100},
		{"B_Soldier_AR_F", 75},
		{"B_Soldier_GL_F", 50},
		{"B_Soldier_exp_F", 45},
		{"B_Soldier_LAT_F", 35},
		{"B_Soldier_AT_F", 25},
		{"B_Soldier_AA_F", 15},
		{"B_Medic_F", 10},
		{"B_Engineer_F", 5}
	};

{
	private _unitType = _x select 0;
	private _unitPrice = _x select 1;
	private _displayName = getText (configFile >> "CfgVehicles" >> _unitType >> "displayName");
	private _picture = getText (configFile >> "CfgVehicles" >> _unitType >> "picture");
	if (count _unitTypes > 0) then
	{
		private _item = lbAdd [700, format ["%1", _displayName]];
		(_display displayCtrl 700) lbSetTextRight [_item, format ["$%1", _unitPrice]];
		// lbSetPicture [700, _item, _picture];
		(_display displayCtrl 700) lbSetData [_forEachIndex, _unitType];
		(_display displayCtrl 700) lbSetValue [_forEachIndex, _unitPrice];
		lbSetCurSel [700, 0];
	};
} forEach _unitTypes;

private _unitType = lbData [700, (lbCurSel 700)];
private _unitPrice = lbValue [700, (lbCurSel 700)];
private _spawnType = uiNamespace getVariable ["spawnType", 0];

if (_currentAI > MAX_AI) exitWith
{
	hintSilent "You have reached the maximum AI count.";
};

if (1000 < _unitPrice) exitWith
{
	hintSilent "Insufficient funds. Purchase cancelled.";
}:

vSFEfo2.jpg

https://drive.google.com/open?id=1K2F24jrciWvG0orYGNvKw7CEVcN7GdCl

If you get a chance... I might use this as a money system if I can't find a decent one... http://www.armaholic.com/page.php?id=32600

Its seems pretty cool from when I was in game looking and playing with it... If you do get a chance to see through it, maybe I could find a way to maybe combine the two? Although this has no killreward type of system which i do need...

 

  • Like 1

Share this post


Link to post
Share on other sites

You asked for "buying recruitment". I did that. I even added pricing support, etc. All you need to do is add in it.

// this part...
// will most likely use setVariable / getVariable
// whatever that is just change the 1000 to player getVariable ["variableWhatever", 0]
if (1000 < _unitPrice) exitWith
{
	hintSilent "Insufficient funds. Purchase cancelled.";
}:

You also need to subtract the price from the total amount you had.

private _unitPrice = lbValue [700, (lbCurSel 700)];

// use the variable above to get the price

The kill reward can be added on top anyway. It is just a simple Killed EH with a few simple checks then finally setVariable. Current amount + kill reward price.

  • Like 1

Share this post


Link to post
Share on other sites

ravage has a currency and shop system.

 

@HazJ That looks really good. Well done

Share this post


Link to post
Share on other sites
On 5/23/2018 at 8:19 AM, socs said:

If you get a chance... I might use this as a money system if I can't find a decent one... http://www.armaholic.com/page.php?id=32600

Its seems pretty cool from when I was in game looking and playing with it... If you do get a chance to see through it, maybe I could find a way to maybe combine the two? Although this has no killreward type of system which i do need...

 

 

I got this to give you kill rewards when you kill a ravage zombie for the HG shops system

Spoiler

/// Ambient Zombie HG Rewards
["zombie", "init", {(_this select 0) call HG_fnc_aiUnitSetup}, true, [], true] call CBA_fnc_addClassEventHandler;

 

Also one for AI but i never used it

Spoiler

/// Any Ai that spawns into game HG Rewards
//["man", "init", {(_this select 0) call HG_fnc_aiUnitSetup}, true, [], true] call CBA_fnc_addClassEventHandler;

 

You just set up how much cash you want inside the HG_Config.h file where it had kill reward. You can also set it up per lvl as well, so the higher your lvl the more cash you get

  • Like 1

Share this post


Link to post
Share on other sites
11 hours ago, Chuc said:

 

I got this to give you kill rewards when you kill a ravage zombie for the HG shops system

  Reveal hidden contents

/// Ambient Zombie HG Rewards
["zombie", "init", {(_this select 0) call HG_fnc_aiUnitSetup}, true, [], true] call CBA_fnc_addClassEventHandler;

 

Also one for AI but i never used it

  Reveal hidden contents

/// Any Ai that spawns into game HG Rewards
//["man", "init", {(_this select 0) call HG_fnc_aiUnitSetup}, true, [], true] call CBA_fnc_addClassEventHandler;

 

You just set up how much cash you want inside the HG_Config.h file where it had kill reward. You can also set it up per lvl as well, so the higher your lvl the more cash you get

I appreciate this, also, I was looking but didnt see a currency or shop system? Where can I use the shop at... I pick up banknotes all the time and it was annoying as shit not knowing what they were for lol... Also, i kinda found an issue and dont know if its just me but, ever since ravage updated last, I see rice and water and banknotes all over the ground... No clue as to why theyre there but I didnt know if maybe you used ravage and mightve known... Thanks !

Share this post


Link to post
Share on other sites

@Chuc - I don't need it. Also, I don't tend to use any third party stuff. I make everything myself. I also don't play Ravage mod. :grinning:

 

Share this post


Link to post
Share on other sites
11 hours ago, HazJ said:

@Chuc - I don't need it. Also, I don't tend to use any third party stuff. I make everything myself. I also don't play Ravage mod. :grinning:

 

 

yeah fair enough. As i said good job on that script you made. I havnt tested it yet was to tied to play last night.

 

That other stuff was for the OP because he was going to use the HG shops and since i have used them alot i thought i would post what i have picked up along the way.

Share this post


Link to post
Share on other sites
12 hours ago, socs said:

I appreciate this, also, I was looking but didnt see a currency or shop system? Where can I use the shop at... I pick up banknotes all the time and it was annoying as shit not knowing what they were for lol... Also, i kinda found an issue and dont know if its just me but, ever since ravage updated last, I see rice and water and banknotes all over the ground... No clue as to why theyre there but I didnt know if maybe you used ravage and mightve known... Thanks !

 

There was a drop loot script made to drop loot on the ground once a man or zombie had died, maybe @haleks add it into the new version. There are roaming traders that walk around in groups, there should be 3 types gear, weapons and items. If you make your own mission you can add your own traders into it with a comand into there init

Spoiler

Supply Trader

this setVariable ["isTrader", "rvg_supplies_s", true];

 

Gear Trader

this setVariable ["isTrader", "rvg_gear_s", true];

 

Arms trader

this setVariable ["isTrader", "rvg_arms_s", true];

 

Share this post


Link to post
Share on other sites
15 hours ago, Chuc said:

 

There was a drop loot script made to drop loot on the ground once a man or zombie had died, maybe @haleks add it into the new version. There are roaming traders that walk around in groups, there should be 3 types gear, weapons and items. If you make your own mission you can add your own traders into it with a comand into there init

  Hide contents

Supply Trader

this setVariable ["isTrader", "rvg_supplies_s", true];

 

Gear Trader

this setVariable ["isTrader", "rvg_gear_s", true];

 

Arms trader

this setVariable ["isTrader", "rvg_arms_s", true];

 

Ahhhhh, appreciate this... However all I wa looking for was just a simple currency system that I could add an ammo/gun/vehicle shop too, and of course buying recruits and put it at a base... Could I somehow use ravages currency system to make a shop? Or would i have to find my own?

Share this post


Link to post
Share on other sites

You should be able to. I was thinking about the same thing myself. I decided to drop HG shops and use ravage because i liked the idea of having cash on me and not just virtual. I found this code inside a script but havnt looked into it any further atm. Going to the ravage thread and asking there you will probably get more\better help.

 

ravage page

 

this is a snippet out of a different script that looks for how much rvg money you have on you

 

_money = {_x isEqualTo "rvg_money"} count magazines player;

 

i guess you could use this to get a your recruitment started and maybe a shop. As i said i havnt looked into it yet was going to today but i have a screaming baby atm so i may not get time

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×