Jump to content
jarni

[SOLVED] Export Eden-placed groups to script(s)

Recommended Posts

Hello A3 community.

 

Been googling for the answer a lot but none seems to fit the question: how to export groups (with positions, directions, waypoints, loadouts, init-commands, etc...) placed in Eden editor to a script? Why? Well, I've made a half of Stratis-based KillThemAll SP mission and already hit the performance limit and almost hit the group limit(currently having 245 groups). It looks like this now: https://drive.google.com/open?id=1-irJ_BtPPx5FBhH5liodlLf7NrYeiyxS. I don't want to split this to a set of missions in a campaign.

 

So, I'd like to setup groups in Eden editor and then export those to scripts, so that those groups can be spawned on triggers (intel, location, tasks). The Dynamic Objects Composition seems to be working for static objects only, but not for groups. I, basically, can create a parser of mission.sqm file and take all the data from there, then process those into scripts, and become "the game engine" for a brief moment. But there are difficulties, like, for example, setDir doesn't work for units if MOVE AI is not disabled. I still can't overcome this problem even thou the engine has no problem holding the direction when doStop command is issued and\or PATH AI is disabled. Also, I'm not yet sure that all what can be configured for units inside Eden editor have appropriate BIS functions to call.

 

Any help is appreciated.

Share this post


Link to post
Share on other sites

Thank you! Sounds exactly like what I need. Will give it a try and report back.

Share this post


Link to post
Share on other sites

Ok, I ve tried to figure out how to use blacklist in this function. Ask in forum few times but nobody know. Could you write it here as example if you figure it out. This fucntion automaticaly convert to sqf all what you places on map in editor (with some limitations), so it really help to know how to make balcklist objects/layers. 

Share this post


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

(with some limitations)

Any particular to be concerned about?

Share this post


Link to post
Share on other sites

Some kind of waypoints (I had problems with leave vechicle waypoint, as well had problem with synchronization of waypoints with triggers), some kind of modules (show/hide module, delete objects on map module) dont work or get error, but mabye it was fixed. Objects, units, object/unit's init line work ok.

Share this post


Link to post
Share on other sites

So, its extreme suitable for populating area by enemies, camps, fortyfied positions by script command but not solution for easy way hole scenario spawning.

Share this post


Link to post
Share on other sites
1 hour ago, baton1990 said:

for populating area by enemies

Exactly what I need in my case. I'm going to leave all static objects in the scenario and just move group spawn into scripts.

 

Thank you.

Share this post


Link to post
Share on other sites

Ok, it took around 10 minutes to export, and then around 30 minutes of fighting with unresponsive EDEN editor to get that copied. In the end I have 40k lines script file to work through.

 

Thank you, baton1990, for pointing to that function.

 

As of blacklists, I don't see anything related to that in resulting script. Either nothing was blacklisted or it doesn't work.

Share this post


Link to post
Share on other sites

It seems to me you just have to use the 3den menu: scenario > export > export in sqf

This menu will use the BIS_fnc_3DENExportSQF anyway.

You can previously read what will be exported in clipboard.

 

As you can see, the init can be made of:

Spoiler

// Init
params [["_layerWhiteList",[],[[]]],["_layerBlacklist",[],[[]]],["_posCenter",[0,0,0],[[]]],["_dir",0,[0]],["_idBlacklist",[],[[]]]];
private _allWhitelisted = _layerWhiteList isEqualTo [];
private _layerRoot = (_allWhitelisted || {true in _layerWhiteList}) && {!(true in _layerBlackList)};
private _layer82 = (_allWhitelisted || {"roadblock" in _layerWhiteList}) && {!("roadblock" in _layerBlackList)};
private _layer70 = (_allWhitelisted || {"camp courage" in _layerWhiteList}) && {!("camp courage" in _layerBlackList)};

if you are using 3den or custom compositions (group/props or custom) Here camp Courage & roadblock (vanilla).

What layers are made of:

 

Spoiler

///////////////////////////////////////////////////////////////////////////////////////////
// Layers
if (_layer82) then {missionNamespace setVariable ["essai%20export_Roadblock",[[_item71,_item72,_item73,_item74,_item75,_item76,_item77,_item78,_item79,_item80,_item81],[]]];};
if (_layer70) then {missionNamespace setVariable ["essai%20export_Camp Courage",[[_item18,_item19,_item20,_item21,_item22,_item23,_item24,_item25,_item26,_item27,_item28,_item29,_item30,_item31,_item32,_item33,_item34,_item35,_item36,_item37,_item38,_item39,_item40,_item41,_item42,_item43,_item44,_item45,_item46,_item47,_item48,_item49,_item50,_item51,_item52,_item53,_item54,_item55,_item56,_item57,_item58,_item59,_item60,_item61,_item62,_item63,_item64,_item65,_item66,_item67,_item68,_item69],[]]];};

 

So layers (you can create several of them sorting units+ waypoints in a layer, objects in another one), can be white or blacklisted in init.

Blacklisting a layer:
 

Spoiler

 

params [["_layerWhiteList",[],[[]]],["_layerBlacklist",[],[[]]],["_posCenter",[0,0,0],[[]]],["_dir",0,[0]],["_idBlacklist",[],[[]]]];


_layerBlacklist pushBack "layer 7";

 

private _allWhitelisted = _layerWhiteList isEqualTo [];
private _layerRoot = (_allWhitelisted || {true in _layerWhiteList}) && {!(true in _layerBlackList)};
private _layer101 = (_allWhitelisted || {"layer 7" in _layerWhiteList}) && {!("layer 7" in _layerBlackList)};
private _layer82 = (_allWhitelisted || {"roadblock" in _layerWhiteList}) && {!("roadblock" in _layerBlackList)};
private _layer70 = (_allWhitelisted || {"camp courage" in _layerWhiteList}) && {!("camp courage" in _layerBlackList)};

 

 

I didn't find what is the use of _idBlackList (in exported script). Perhaps some future functionality.

Some for pushing back a number (id) for each object in _objectIds.

 

You can customize the loadout of your units. Example:

Spoiler

private _item2 = objNull;
if (_layerRoot) then {
  _item2 = _item0 createUnit ["B_soldier_AR_F",[1719.89,5438.72,0],[],0,"CAN_COLLIDE"];
  _this = _item2;
  _objects pushback _this;
  _objectIDs pushback 2;
  _this setPosWorld [1719.89,5438.77,5.50144];
  _this setVectorDirAndUp [[0,1,0],[0,0,1]];
  _this setUnitLoadout [["arifle_MSBS65_F","","acc_pointer_IR","",["30Rnd_65x39_caseless_msbs_mag",30],[],""],[],["hgun_esd_01_F","","","",[],[],""],["U_B_CombatUniform_tshirt_mcam_wdL_f",[["FirstAidKit",1],["HandGrenade",1,1],["SmokeShell",1,1],["SmokeShellGreen",1,1],["Chemlight_green",1,1],["30Rnd_65x39_caseless_msbs_mag",1,30]]],["V_PlateCarrier2_wdl",[["Chemlight_green",1,1],["30Rnd_65x39_caseless_msbs_mag",2,30]]],["B_AssaultPack_mcamo",[["30Rnd_65x39_caseless_msbs_mag",7,30],["MiniGrenade",6,1]]],"H_Cap_blu","G_Tactical_Clear",["Rangefinder","","","",[],[],""],["ItemMap","B_UavTerminal","ItemRadio","ItemCompass","ChemicalDetector_01_watch_F","O_NVGoggles_grn_F"]];
  addSwitchableUnit _this;
  _this setSkill 0.4;
  _this setname "Callum Thompson";;
  _this setface "WhiteHead_17";;
  _this setspeaker "male12eng";;
  _this setpitch 1.01593;;
};

I duno why there is a double ;; at the end of setName, setFace... but that shouldn't be a problem.
You can see how things work for creating units,groups, waypoints, crew, vehicles,modules.... btw.

As little example, if you set the presence to false (or 0%) you will see an added conditions (if (false) then {...} (or if (random 1 < 0) then {...}).

 

There is no menu/function to "import" this stuff. You just have to create and execVm this sqf.

- after saving + exporting to sqf, just create a new mission;

- save this empty mission (no player, nothing). You'll create a folder with a short mission.sqm inside (very basic with the position of camera in fact). Say your mission name is:  emptyMission;

- In the file explorer create two new files (it's a working example): one named init.sqf, one named whatYouWant.sqf, in the folder of emptyMission (where the mission.sqm is);

- in whatYouWant.sqf, paste the code you exported to clipboard;

- in init.sqf , just:  [] execVM "whatYouWant.sqf";

Just Try this emptyMission. All the stuff comes from the whatYouWant.sqf. The mission.sqm stays light.

 

More than this, you can spawn some layers during the mission. It's a way to spawn exactly what you did in editor, when you want. Play with the layers, avoid double, i.e. just one root layer. So, all spawned layers but the first must have :

private _layerRoot = false;

instead of;

private _layerRoot = (_allWhitelisted || {true in _layerWhiteList}) && {!(true in _layerBlackList)};

 

 

 

 

 

  • Like 3

Share this post


Link to post
Share on other sites

2pierremgi: Man, you made my day. For some reason, I've missed the scenario->export menu option. Thank you very much for extensive explanation how this works, especially the layers. It's a bit unfortunate that there is no option to import that, this makes editing the existing layers difficult.

  • Like 1

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

×