Jump to content
Sign in to follow this  
mons00n

need help adding DAC Logic via script for HC config

Recommended Posts

Hi everyone,

I'm working on getting DAC to work correctly in a headless client configuration and I think the trouble I'm having is a missing Logic. Is there any way to add one via script? In my mission.sqm it looks like this:

		class Item1
	{
		side="LOGIC";
		class Vehicles
		{
			items=1;
			class Item0
			{
				position[]={721.40936,34.948109,1458.551};
				id=1;
				side="LOGIC";
				vehicle="DAC_Source_Extern";
				leader=1;
				skill=0.60000002;
			};
		};
	};

I've seen how to add logic via script, but I'm not sure how I would assign it as vehicle="DAC_Source_Extern". Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites

Is there any reason you're using the logics instead of the scripted version (without needing logics)? I'm unfamiliar with exactly how the headless client works or why you would need to do it that way.

Share this post


Link to post
Share on other sites
Is there any reason you're using the logics instead of the scripted version (without needing logics)? I'm unfamiliar with exactly how the headless client works or why you would need to do it that way.

I'm not 100% sure this will fix my issue, but it's how I classically enable DAC. I can get the fully scripted version to work, but that adds an additional ~900kb to the already large mission file.

I'm trying to make the headless version handles all of the initialization of DAC - which is usually done via spawning DAC_Zone, which simply requires the DAC logic. I believe the headless client isn't seeing the logic so it's not spawning the zones.

Share this post


Link to post
Share on other sites

_center = createCenter sideLogic;
_grp = createGroup _center;
if ((isNil ("DAC_Extern"))) then {
DAC_Extern = _grp createUnit ["DAC_Source_Extern", [721.40936,1458.551, 0], [], 0, "NONE"];
publicVariable "DAC_Extern";
};
// Setup for West & East group reduction points (change coordinates for your mission)
if ((isNil ("DAC_Pos_W"))) then {
DAC_Pos_W = _grp createUnit ["Logic", [7083.2246,5390.5181,0], [], 0, "NONE"];
publicVariable "DAC_Pos_W";
};
if ((isNil ("DAC_Pos_E"))) then {
DAC_Pos_E = _grp createUnit ["Logic", [-2799.2734,5066.0713,0], [], 0, "NONE"];
publicVariable "DAC_Pos_E";
};

I've just started trying to do the exact same thing, but so far haven't got around to testing it in anything other than the standard mission editor preview, so all I can say is that this does work without a headless client.

Note: the positions in mission.sqm are Above Sea Level [x,z,y] but in createUnit they're Above Ground Level [x,y,z] so you should switch the positions around and set z to 0. Otherwise stuff will spawn about 30m above ground, which is not too good for the troops!

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  

×