Jump to content
Sign in to follow this  
MILN4R

Custom Base Compositions

Recommended Posts

I've already figured out how to add Custom compositions to Zeus via Addons but... I don't want it to be a addon thing, because in order for it to be used that person would need the addon. I've been trawling through code for the better part of 4 hours now and trying various things to no avail.

The way that the addon method works is simple, it adds to the configfile >> "CfgGroups" >> "Empty", e.g configfile >> "CfgGroups" >> "Empty" >> "Custom" >> "Outposts" >> "OutpostA". Also i found a function that will probably get all the required stuff for base layouts(fn_exportCfgGroups), i haven't tried it, so that's why i say it will probably work. Anyway back to my current problem, if you add the same config with the custom base to the mission and include it. It will be missionconfigfile >> "CfgGroups" >> "Empty" >> "Custom" >> "Outposts" >> "OutpostA" ... which simply wont be read.

So... How would i add it to the list? or get it to be read? I've been trying to find the code which BI uses to get the list read but with no luck as of yet. If anyone knows how please to tell. As it will save me a bunch of time. And before anyone says it can only be done by addon, this is not one of those things that can only be done by being a addon. I just need to figure it out.

Btw the way you do the addon is simple:

@Custom_Compositions>Addons>Custom_Compositions>Config.cpp

Config.cpp =

class CfgPatches
{
class Custom_Compositions
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Modules_F"};
};
};
class CfgGroups 
{
class Empty 
{
	side = 8;
	name = "Compositions";
	class Custom 
	{
		name = "Custom";
		class Outposts 
		{
			name = "Outposts";
			class OutpostA 
			{
				name = "Test";
				class Object0 
				{
					dir = -359.177;
					position[] = {17.293,-14.2617,1.7643e-005};
					rank = "";
					side = 8;
					vehicle = "Land_HBarrierBig_F";
				};
			};
		};
	};
};
};

and obviously .pbo it and prefix it.. and add the mod launch params..

The mission side one is as follows(this is the one which wont work) config.cpp =

class CfgGroups 
{
class Empty 
{
	side = 8;
	name = "Compositions";
	class Custom 
	{
		name = "Custom";
		class Outposts 
		{
			name = "Outposts";
			class OutpostA 
			{
				name = "Test";
				class Object0 
				{
					dir = -359.177;
					position[] = {17.293,-14.2617,1.7643e-005};
					rank = "";
					side = 8;
					vehicle = "Land_HBarrierBig_F";
				};
			};
		};
	};
};
};

And in description.ext

#include "config.cpp"

Edited by MILN4R

Share this post


Link to post
Share on other sites

Hey did you find any solution yet?

Im trying to give my zeus a custom loadout but without giving access to complete classes but only to specific units.

Share this post


Link to post
Share on other sites

From what I gather from this post you need / want to save some pre made stuff from zeus in terms of bases and put them in 2d editor or something?

Basially you want to make a shiny nice looking base and be able to use it on a mission?

Arma reads .sqm, mission.sqm's have all the placement, so if you want to save object locations/positions, you will either use the editor to place them. OR use mcc and then zeus through that to 3d edit it then export and save to sqm in which you can then open in editor and paste it to your main mission.

Try getting the new MCC and exporting to mission sqm, it doesnt need mcc to open, then open the copied sqm over to you my documents arma 3 missions into a new mission folder and C&P what you want over to your main mission in your editor?

I did this for my FOB's as someone wanted to make them, so they sent me the sqm which I then opened in editor and simply copied and pasted.

@Wotyhn

You look into the cost of unit types and / or restriction of units via the set costs section, which will mean you will also need to look into the tickets per second for the zeus.

Share this post


Link to post
Share on other sites

Thx i think i found the part i need but im not able to use it like i want atm :D

I tried to use the "CuratorObjectRegistered" Eventhandler and it works fine with the example given in the wiki.

However i am quite new to scripting and i can't figure out how to change it to my needs.

curator addEventHandler [
"CuratorObjectRegistered",
{_classes = _this select 1;
	_costs = [];
	{
		_cost = if _x {"B_Soldier_F", "B_helicrew_F"} then {[true,0.1], [false,0]};
		_costs = _costs + [_cost];
	} forEach _classes;
	_costs}
];

This is what i came up with. Not working but it should be somewhere close to what i need. A simple if-then funktion for multiple objects where i can define the costs and if they are available or not to the Zeus game-master.

Jan

Share this post


Link to post
Share on other sites

@tmortensen

I dont think that your answer provides the information he needs. I guess he is looking for a fixed set of costum presets enabled in his Zeus, always usable, like the objects you find in the "empty" group tab. I myself been looking for an answer for this problem, finding out how to actually implement costum sets into a config file in a mission or even load them from a folder, without the need of an addon for every user. It should be possible in theory, I guess everyone has the necessary objects if only vanilla content is used, but so far I didn't find any other possibility as to make an addon for it. Hoping for a definite answer.

Share this post


Link to post
Share on other sites

It is not possible to to add/change content in the config per mission, although this have been requested since arma 2, and still is:

http://feedback.arma3.com/view.php?id=15079

http://feedback.arma3.com/view.php?id=16028

http://forums.bistudio.com/showthread.php?168467-Suggestion-Extend-configfile-per-mission

I agree that being forced to apply addons (mods) just to read objects and position arrays (no new content) is just not practically.

So from what i can read from your post, you want to have a MISSION (no mods) where the player(s) can create your own premade compositions in Zeus, using the curator features like placement, rotating, cost calculation ect. There might just be a workaround:

Create your compostion

---------------------------

Create composition in Zeus and capture it with BIS_fnc_objectsGrabber, this will get us an array of objects to Work with:

_myString = [getPos _ancher, 50, true] call BIS_fnc_objectsGrabber;

This grabs all non character objects (pos and rotation) in a radius of 50 meters, with an _anchor object (could be anything, even the player). Calling this function returns a string (and also copyies the string to your clipboard as well) looking like this:

/*
Grab data:
Mission: compositiontest
World: Altis
Anchor position: [23609.9, 18839.3]
Area size: 50
Using orientation of objects: yes
*/

[
["Land_CinderBlocks_F",[5.14648,1.29688,1.90735e-006],0.00052606,1,0,[],"","",true,false], 
["Land_CinderBlocks_F",[1.45508,5.72852,1.43051e-006],0.00105235,1,0,[],"","",true,false], 
["Snake_random_F",[19.8633,26.5313,0.0083878],248.213,1,0,[],"","",true,false], 
["Snake_random_F",[-43.252,12.5938,0.0083878],156.115,1,0,[],"","",true,false]
]

I just placed 2 CinderBlocks, but the grabber also got the snakes, in a larger area a lot of objects could have found its way into the array which has nothing to do with the composition, BUT if we have an array we can sort those out:

_myStrings = [_myString,"*/"] call BIS_fnc_splitString;

_myString = _myStrings select 1;

_myArray = call (compile _myString);//translate the text to array

Now we can manipulate the array and sort out the unwanted objects. We have a valid array of obejcts that we used to create composition:

_curatorObjects = curatorEditableObjects myCurator; (All objects placed in Zeus are curator editable)

So something like:

Convert _curatorObjects to _curatorObjectsTypes:

_curatorObjectsTypes = [];

{

_curatorObjectsTypes set [count _curatorObjectsTypes, typeOf _x];

} forEach _curatorObjects;

Do the validation:

_validObjects = [];

{

if ( (_x select 0) in _curatorObjectsTypes) then {

_validObjects set [count _validObjects ,_x];

};

} forEach _myArray;

Thus we have a valid composition array ready for saving into a file in your MISSION folder:

//translate array back to text

_validObjectsString = format["%1",_validObjects];

//copy To ClipBoard for easy saving to notepad

copytoclipboard _validObjectsString;

Open notepad and paste, then save the file to your mission folder eg. "composition1.sqf"

To create the composition in your mission and let Zeus be able to rotate,move the composition:

//Create the compostion

_createdObjects = [getPos _ancher, getDir _ancher, call (compile (preprocessFileLineNumbers "composition1.sqf"))] call BIS_fnc_ObjectsMapper;

//allow Zeus ro be able to manipulate the composition eg. delete, move, rotate ect

_curatorModule addCuratorEditableObjects [_createdObjects , false];

All done!

I have not tested the code in game yet but it should Work, anyway you get the idea. Might be a typo somewhere but the idea should 100% Work, i will code this also and return with comments if anything comes up.

Oh by the way:

If you want to create a composition in Zeus and be able to use it as an addon (mod):

BIS_fnc_exportCfgGroups Works by you selecting all the objects in Zeus you want in your composition and in console do: [] call BIS_fnc_exportCfgGroups; This will copy

your selected compostion to your clipboard in a class configuration looking like this when pasted to notepad:

class Object0	{side = 8; vehicle = "Land_Amphitheater_F"; rank = ""; position[] = {0,0,-0.00205612}; dir = 11.7205;};
class Object1	{side = 8; vehicle = "Land_TouristShelter_01_F"; rank = ""; position[] = {-0.216797,2.73828,0}; dir = 142.507;};

As posted ealier in this thread this is the configuration to use when adding the composition as a addon (mod) in class structure.

Hope this helps someone,

EDIT:

So i have confirmed this worked like a charm

Edited by Hansen111
Correction

Share this post


Link to post
Share on other sites

Can anyone help? When i want to play zeus showcase or when i make zeus mission in editor i get this error:

No entry config.bin/CfgPatches.a3_missions_f_bootcamp

How to fix this?

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
Sign in to follow this  

×