Jump to content
Mr H.

Zeus editing costs with RHS + limit factions in zeus.

Recommended Posts

Hi so I'm trying do do a mission where players will face a zeus with limited powers.
The set units and vehicles costs module works fine with vanilla assets but not with units from RHS AFRF.
On the wiki I've found this solution:
 

myCurator addEventHandler [
	"CuratorObjectRegistered",
	{
		_classes = _this select 1;
		_costs = [];
		{
			_cost = if (_x isKindOf "Man") then {[true,0.1]} else {[false,0]}; // Show only objects of type "Man", hide everything else
			_costs = _costs + [_cost];
		} forEach _classes; // Go through all classes and assign cost for each of them
		_costs
	}
];

it works but only sets the cost of infantry units.
I have changed it to:
 

ZeusMaster addEventHandler [
	"CuratorObjectRegistered",
	{
		_classes = _this select 1;
		_costs = [];
		
		{    
			_cost = if (_x isKindOf "Man") then {[true,0.01]} else {[true,0.05]}; // CHANGED the else part
			
			_costs = _costs + [_cost];
			
		} forEach _classes; // Go through all classes and assign cost for each of them
		_costs
		
	}
];

which sets the cost of all infantry units to 0.01 and all other objects to 0.05
but i can't change the cost further (i'd like to have cars < helicopters < tanks costs) for example.
I've tried adding lines like _cost = if (_x isKindOf "Air") then {[true,0.01]}
I've tried removing the  " else {[true,0.05]};" part when doing that but it doesn't work...
What am I doing wrong?
Also I've already limited the access to addons for the zeus player but I'd also like to limit available factions and I don't know if it's possible...

Share this post


Link to post
Share on other sites

found a solution on my own, I put it here for anyone who needs it :


ZeusMaster addEventHandler [
	"CuratorObjectRegistered",
	{
		_classes = _this select 1;
		_costs = [];
		
		{    
_cost = if (_x isKindOf "Man" or _x isKindOf "tank" or _x isKindOf "Air" or _x isKindOf "Car") then {
switch (true) do {
case (_x isKindOf "tank"): {[true,0.5]};
case (_x isKindOf "Man"): {[true,0.01]};
case (_x isKindOf "Air"): {[true,0.3]};
case (_x isKindOf "Car"): {[true,0.05]};

};
} else {[true,0.01]};
			_costs = _costs + [_cost];
			
		} forEach _classes; // Go through all classes and assign cost for each of them
		_costs
		
	}
];

just change the values as you need

Share this post


Link to post
Share on other sites

I know i'm late to the party but can anyone tell me where to put this? I've been trying to figure out since almost 2 hours now and accepted that I'm simply to stupid for this :l

Share this post


Link to post
Share on other sites

Hey so ill give you a few tips of what I've tried to do with faction specific missions.

 

If you work with configs, it can make your life a lot easier.

I was trying to pull load outs for the re spawn inventory screen, and i manage to pull it off. 

 

configs = [
	(configFile >> "CfgGroups" >> "Indep" >> "LIB_US_ARMY" >> "Infantry"),
	1,
	false
] call BIS_fnc_returnChildren select {inheritsFrom _x isEqualTo (configFile >> "Man")};


loadouts = [];
{loadouts pushBack getText (_x >> 'vehicle')} forEach configs; 
publicVariable "loadouts";

{ 
[resistance,[_x]] call BIS_fnc_addRespawnInventory;
} forEach loadouts;

 

So you have your config entry, how deep the function is going to dig to pull things, and then that boolean is to make sure you only get the very last entry.

Then you have it grabbing the actual cfgvehicle name.

And then i used a foreach to apply to the loadouts.

 

Anyway you could use this same method to pull all sorts of things, and organize em. Perhaps even sort out the "MAN" array by rank, and have the rank define the costs, so corporals would cost more. On vehicles you can look at number seats, so a quad bike would be cheap, but a truck would be expensive.

 

Sorry that I'm not proficient enough to actually work all this out, but i hope this helps.

 

If you want, you can also do all your costs by hand. 

 

[ getAssignedCuratorLogic player, ["ModuleFlareWhite_F",0.02,"ModuleFlareYellow_F",0.02,"ModuleFlareGreen_F",0.02]] call BIS_fnc_curatorObjectRegisteredTable;

 

To individually set costs. Just keep adding to that array with CFG Vehicle, then the price. Cya around!

 

btw if u do the last suggestion, if u add all the vehicle names of the same group, the groups should appear. You need all the vehicle names priced in the group, and for Iron front u need to include the winter units to get access to spawning the grouped units... for what ever reason. IIRC , they might of fixed it.

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

×