Jump to content
Sign in to follow this  
austin_medic

[RELEASE]Zeus Mission Builder

Recommended Posts

Like JShocks idea above! Having a loading message is necessary as i am also having issues where it seems nothing is happening. No scripts errors to show either. I had ammo boxes so trying again.

---------- Post added at 15:43 ---------- Previous post was at 15:22 ----------

the ammobox was the issue! Since i deleted the script took a split second to complete. Bug? I did customize it

Share this post


Link to post
Share on other sites
Like JShocks idea above! Having a loading message is necessary as i am also having issues where it seems nothing is happening. No scripts errors to show either. I had ammo boxes so trying again.

---------- Post added at 15:43 ---------- Previous post was at 15:22 ----------

the ammobox was the issue! Since i deleted the script took a split second to complete. Bug? I did customize it

Something's wrong with it. Don't know what, will sit down today and try to fix it. Also will see what I can do about editing previously made missions, though it seems like a bit of a waste when you could work around it by simply exporting your ammo boxes after creating them, paste em into a text file, then copy the init line of the boxes into your own mission.sqm. Anyhow that can't be done until its fixed, will do that now.

EDIT: Well I'm scratching my head. It's spitting out non-existant errors about lines of code that aren't even in the script.

EDIT EDIT: Nvm. found my problem. It was JShock's loading hint code that was causing the error. Hilariously the debug box wasn't refreshing its copy of my script so it was giving me a line I had deleted previously.

---------- Post added at 16:57 ---------- Previous post was at 16:32 ----------

Like JShocks idea above! Having a loading message is necessary as i am also having issues where it seems nothing is happening. No scripts errors to show either. I had ammo boxes so trying again.

---------- Post added at 15:43 ---------- Previous post was at 15:22 ----------

the ammobox was the issue! Since i deleted the script took a split second to complete. Bug? I did customize it

Since arrays have complicated structures it takes the game an extremely long time to write it out, especially for ammo boxes with lots of items (every single item in the box has a fairly large string thats stored inside an element in the array). It really isn't feasible to use it the way I have tried to get it to work. Anyhow, updated link coming in a few minutes

---------- Post added at 17:00 ---------- Previous post was at 16:57 ----------

Hey Austin, very nice tool you've made. I have a couple bugs I'm running into though. The first one has to do with ammo crates that have been edited through Arsenal. I get "Error Generic error in expression" at addWeaponCargo. The other issue I'm having is I can't find a way to continue editing something you have already saved, even when using the ADV Zeus Script (can't link it cause my needs to be a day old, but it attempts to make all objects editable by zeus) all the things I previously placed are untouchable. The mission also never successfully saves if I try editing a previously saved sqm. (Edit: Looks like it doesn't save if there is an ammo box present. Still no avail in attempting to make the objects editable)

The only other issue I'm running into probably doesn't relate to your script, a vast majority of objects can't be placed through zeus, even though you can view them in the arsenal, etc. If anyone has any advice regarding that I'd appreciate it.

Being able to edit a saved mission would make the editing process a lot less of a hassle and being able to edit the contents of crates is why I picked up this script, so I hope it's possible to work the kinks out. Great work so far, the code is clean and well written.

I'm not sure how your editing the box contents with Arsenal, but your supposed to use the Zeus UI to fill it. I'd assume arsenal uses a special method to fill the crate rather than just the addcargo commands.

edit edit edit:

scripts (1.4)

mission (1.4)

Edited by austin_medic

Share this post


Link to post
Share on other sites
Something's wrong with it. Don't know what, will sit down today and try to fix it. Also will see what I can do about editing previously made missions, though it seems like a bit of a waste when you could work around it by simply exporting your ammo boxes after creating them, paste em into a text file, then copy the init line of the boxes into your own mission.sqm. Anyhow that can't be done until its fixed, will do that now.

I'm not sure how your editing the box contents with Arsenal, but your supposed to use the Zeus UI to fill it. I'd assume arsenal uses a special method to fill the crate rather than just the addcargo commands.

Sorry for not being clear, Arsenal IS the Zeus UI that pops up when you fill an ammo box, and it DOES export the box filling script to the SQM file. However, it doesn't remove previous items, and the code to add new items fails, with the error I mentioned above.

As for editing previously made missions, I found that if I changed the lines in the ADV Zeus Script (here) from

_curator addCuratorEditableObjects [(allMissionObjects "Man"),false];
_curator addCuratorEditableObjects [(allMissionObjects "Air"),true];
_curator addCuratorEditableObjects [(allMissionObjects "Ammo"),false];

to simply

_curator addCuratorEditableObjects [(allMissionObjects "All"),false];

I was able to properly edit all of the mission objects I had placed previously using your script.

Share this post


Link to post
Share on other sites

Maybe I do not understand how this works exactly, but when I drag and drop the PBO into my missions/Mpmissions folder it does nothing and it does not even show up in the games list.

Is there no documentation on what exactly the features are ? and maybe a shove in the right way to utilize this.

Thanks!

Share this post


Link to post
Share on other sites
Maybe I do not understand how this works exactly, but when I drag and drop the PBO into my missions/Mpmissions folder it does nothing and it does not even show up in the games list.

Is there no documentation on what exactly the features are ? and maybe a shove in the right way to utilize this.

Thanks!

put it in the missions folder and then ingame look under scenarios.

Share this post


Link to post
Share on other sites

Hi austin_medic, yours is a great tool for mission building, and is definitely much, much easier to use than GID. However, after building a short mission using your wonderful mission builder, I felt that the feature I needed was not to export everything on the map to a completed "mission.sqm", but to be able to selectively export a few entities into a .sqf file as this will make it easier (for me at least) to make updates to existing missions built using traditional methods.

I am wondering if you have plans to include that feature in the future?

Inspired by your work, I wrote this simple script that allowed me to select any number of objects in Zeus and then hit [Ctrl+C] to export them to sqf code (createVehicle, setPos, setVectorDirAndUp, enableSimulation). [Ctrl+A] exports all Zeus-editable objects, [Ctrl+Shife+E] makes nearby objects editable by Zeus, and [Ctrl+S]/[Ctrl+Shift+S] toggles "enableSimulation" for selected objects. The way I wrote it, the script would only support empty vehicles/objects, their position/orientation and simulation status. It wouldn't work with units/groups/markers/waypoints/modules/containers with stuff inside as I personally felt comfortable with doing those via scripting/2D editor. But if you ever decide to expand your mission builder to include selective-export/sqf-code functionality, feel free to take a peek at the code below.

Whether or not you have plans/time for such features, this is definitely a great tool and I hope you will continue expanding it. Thanks!

//Usage
//Place Zeus module in editor named "ZE_Zeus", then execVM the following code.

//Object Export function
ZE_ExportEntities = {

ZE_ObjectsExport = [];
_mode = toLower (_this select 0);

//Register objects to export
switch (_mode) do {
	case "all": {
		{
			_obj = _x;
			_class = typeOf _obj;
			_pos = getPosATL _obj;
			_vec = [vectorDir _obj, vectorUp _obj];
			_sim = simulationEnabled _obj;
			_pack = [_class,_pos,_vec,_sim];
			ZE_ObjectsExport = ZE_ObjectsExport + [_pack];
		} forEach (curatorEditableObjects ZE_Zeus);
	};

	case "sel": {
		{
			_obj = _x;
			if (typeName _obj == typeName objNull) Then {
				_class = typeOf _obj;
				_pos = getPosATL _obj;
				_vec = [vectorDir _obj, vectorUp _obj];
				_sim = simulationEnabled _obj;
				_pack = [_class,_pos,_vec,_sim];
				ZE_ObjectsExport = ZE_ObjectsExport + [_pack];
			};
		} forEach (curatorSelected select 0);
	};
};

//Compile
_compiledTxt = "//Exported with ZE";

{
	private ["_addTxt"];
	_objArr = _x;
	_class = _objArr select 0;
	_pos = _objArr select 1;
	_vec = _objArr select 2;
	_sim = _objArr select 3;
	if (_sim) Then {
		_addTxt = format ["
_object = createVehicle [""%1"", [0,0,0], [], 0, ""CAN_COLLIDE""];
_object setPosATL %2;
_object setVectorDirAndUp %3;
", _class, _pos, _vec];
	} else {
		_addTxt = format ["
_object = createVehicle [""%1"", [0,0,0], [], 0, ""CAN_COLLIDE""];
_object enableSimulation %4;
_object setPosATL %2;
_object setVectorDirAndUp %3;
", _class, _pos, _vec, _sim];
	};


	_compiledTxt = _compiledTxt + _addTxt;
} forEach ZE_ObjectsExport;

copyToClipboard _compiledTxt;

};

//Enable editing function
ZE_AddCuratorObjects = {
_nearObjs = (getPos curatorCamera) nearObjects 25;
ZE_Zeus addCuratorEditableObjects [_nearObjs,false];
};

//Handle Object simulation
ZE_ObjectSimulation = {
_mode = toLower (_this select 0);
switch (_mode) do {
	case "enable": {
		{_x enableSimulation true} forEach (curatorSelected select 0);
	};
	case "disable": {
		{_x enableSimulation false} forEach (curatorSelected select 0);
	};
};
};


//Key Stroke Handler
key_ctrl = 29;
key_shift = 42;
key_c = 46;
key_a = 30;
key_e = 18;
key_s = 31;

pressed_ctrl = false;
pressed_shift = false;
pressed_c = false;
pressed_a = false;
pressed_e = false;
pressed_s = false;

//Add Keystroke EH
ZE_AddKeyStrokeEH = {
ZE_keyDownEHId = findDisplay 312 displayAddEventHandler ["KeyDown",{
	if (_this select 1 == key_ctrl) then {pressed_ctrl = true;};
	if (_this select 1 == key_shift) then {pressed_shift = true;};
	if (_this select 1 == key_c) then {pressed_c = true;};
	if (_this select 1 == key_a) then {pressed_a = true;};
	if (_this select 1 == key_e) then {pressed_e = true;};
	if (_this select 1 == key_s) then {pressed_s = true;};
}];
ZE_keyUpEHId = findDisplay 312 displayAddEventHandler ["KeyUp",{
	if (_this select 1 == key_ctrl) then {pressed_ctrl = false;};
	if (_this select 1 == key_shift) then {pressed_shift = false;};
	if (_this select 1 == key_c) then {pressed_c = false;};
	if (_this select 1 == key_a) then {pressed_a = false;};
	if (_this select 1 == key_e) then {pressed_e = false;};
	if (_this select 1 == key_s) then {pressed_s = false;};
}];

["ZE_KeyStroke", "onEachFrame", {
	if (pressed_ctrl && pressed_a) ExitWith {
		["ALL"] call ZE_ExportEntities;
		hint "";
		["CuratorAddAddons",["ZEUS objects copied to clipboard."]] calL BIS_fnc_showNotification;
		pressed_a = false;
	};
	if (pressed_ctrl && pressed_c) ExitWith {
		["SEL"] call ZE_ExportEntities;
		["CuratorAddAddons",["SELETED objects copied to clipboard."]] calL BIS_fnc_showNotification;
		pressed_c = false;
	};
	if (pressed_ctrl && pressed_shift && pressed_e) ExitWith {
		[] call ZE_AddCuratorObjects;
		["CuratorAddAddons",["Nearby objects ENABLED for Zeus."]] calL BIS_fnc_showNotification;
		pressed_e = false;
	};
	if (pressed_ctrl && pressed_shift && pressed_s) ExitWith {
		["DISABLE"] call ZE_ObjectSimulation;
		["CuratorAddAddons",["DISABLED simulation for selected objects."]] calL BIS_fnc_showNotification;
		pressed_s = false;
	};
	if (pressed_ctrl && pressed_s) ExitWith {
		["ENABLE"] call ZE_ObjectSimulation;
		["CuratorAddAddons",["ENABLED simulation for selected objects."]] calL BIS_fnc_showNotification;
		pressed_s = false;
	};
}] call BIS_fnc_addStackedEventHandler;

};

//Remove Keystroke EH
ZE_RemoveKeyStrokeEH = {
findDisplay 312 displayRemoveEventHandler ["KeyDown",ZE_keyDownEHId];
findDisplay 312 displayRemoveEventHandler ["KeyUp",ZE_keyUpEHId];

["ZE_KeyStroke", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};



//Enable/disable EH on Zeus start/end
[] spawn {
while {true} do {
	waitUntil {sleep 0.1; !(isNull findDisplay 312)};
	[] spawn ZE_AddKeyStrokeEH;
	waitUntil {sleep 0.1; isNull findDisplay 312};
	[] spawn ZE_RemoveKeyStrokeEH;
};
};



ADD: Also a [Ctrl+Z] undo last change function would work wonders. Although I'm not sure if that's ever possible in Arma. Just a thought.

Edited by ted_hou

Share this post


Link to post
Share on other sites
Hi austin_medic, yours is a great tool for mission building, and is definitely much, much easier to use than GID. However, after building a short mission using your wonderful mission builder, I felt that the feature I needed was not to export everything on the map to a completed "mission.sqm", but to be able to selectively export a few entities into a .sqf file as this will make it easier (for me at least) to make updates to existing missions built using traditional methods.

I am wondering if you have plans to include that feature in the future?

Inspired by your work, I wrote this simple script that allowed me to select any number of objects in Zeus and then hit [Ctrl+C] to export them to sqf code (createVehicle, setPos, setVectorDirAndUp, enableSimulation). [Ctrl+A] exports all Zeus-editable objects, [Ctrl+Shife+E] makes nearby objects editable by Zeus, and [Ctrl+S]/[Ctrl+Shift+S] toggles "enableSimulation" for selected objects. The way I wrote it, the script would only support empty vehicles/objects, their position/orientation and simulation status. It wouldn't work with units/groups/markers/waypoints/modules/containers with stuff inside as I personally felt comfortable with doing those via scripting/2D editor. But if you ever decide to expand your mission builder to include selective-export/sqf-code functionality, feel free to take a peek at the code below.

Whether or not you have plans/time for such features, this is definitely a great tool and I hope you will continue expanding it. Thanks!

//Usage
//Place Zeus module in editor named "ZE_Zeus", then execVM the following code.

//Object Export function
ZE_ExportEntities = {

ZE_ObjectsExport = [];
_mode = toLower (_this select 0);

//Register objects to export
switch (_mode) do {
	case "all": {
		{
			_obj = _x;
			_class = typeOf _obj;
			_pos = getPosATL _obj;
			_vec = [vectorDir _obj, vectorUp _obj];
			_sim = simulationEnabled _obj;
			_pack = [_class,_pos,_vec,_sim];
			ZE_ObjectsExport = ZE_ObjectsExport + [_pack];
		} forEach (curatorEditableObjects ZE_Zeus);
	};

	case "sel": {
		{
			_obj = _x;
			if (typeName _obj == typeName objNull) Then {
				_class = typeOf _obj;
				_pos = getPosATL _obj;
				_vec = [vectorDir _obj, vectorUp _obj];
				_sim = simulationEnabled _obj;
				_pack = [_class,_pos,_vec,_sim];
				ZE_ObjectsExport = ZE_ObjectsExport + [_pack];
			};
		} forEach (curatorSelected select 0);
	};
};

//Compile
_compiledTxt = "//Exported with ZE";

{
	private ["_addTxt"];
	_objArr = _x;
	_class = _objArr select 0;
	_pos = _objArr select 1;
	_vec = _objArr select 2;
	_sim = _objArr select 3;
	if (_sim) Then {
		_addTxt = format ["
_object = createVehicle [""%1"", [0,0,0], [], 0, ""CAN_COLLIDE""];
_object setPosATL %2;
_object setVectorDirAndUp %3;
", _class, _pos, _vec];
	} else {
		_addTxt = format ["
_object = createVehicle [""%1"", [0,0,0], [], 0, ""CAN_COLLIDE""];
_object enableSimulation %4;
_object setPosATL %2;
_object setVectorDirAndUp %3;
", _class, _pos, _vec, _sim];
	};


	_compiledTxt = _compiledTxt + _addTxt;
} forEach ZE_ObjectsExport;

copyToClipboard _compiledTxt;

};

//Enable editing function
ZE_AddCuratorObjects = {
_nearObjs = (getPos curatorCamera) nearObjects 25;
ZE_Zeus addCuratorEditableObjects [_nearObjs,false];
};

//Handle Object simulation
ZE_ObjectSimulation = {
_mode = toLower (_this select 0);
switch (_mode) do {
	case "enable": {
		{_x enableSimulation true} forEach (curatorSelected select 0);
	};
	case "disable": {
		{_x enableSimulation false} forEach (curatorSelected select 0);
	};
};
};


//Key Stroke Handler
key_ctrl = 29;
key_shift = 42;
key_c = 46;
key_a = 30;
key_e = 18;
key_s = 31;

pressed_ctrl = false;
pressed_shift = false;
pressed_c = false;
pressed_a = false;
pressed_e = false;
pressed_s = false;

//Add Keystroke EH
ZE_AddKeyStrokeEH = {
ZE_keyDownEHId = findDisplay 312 displayAddEventHandler ["KeyDown",{
	if (_this select 1 == key_ctrl) then {pressed_ctrl = true;};
	if (_this select 1 == key_shift) then {pressed_shift = true;};
	if (_this select 1 == key_c) then {pressed_c = true;};
	if (_this select 1 == key_a) then {pressed_a = true;};
	if (_this select 1 == key_e) then {pressed_e = true;};
	if (_this select 1 == key_s) then {pressed_s = true;};
}];
ZE_keyUpEHId = findDisplay 312 displayAddEventHandler ["KeyUp",{
	if (_this select 1 == key_ctrl) then {pressed_ctrl = false;};
	if (_this select 1 == key_shift) then {pressed_shift = false;};
	if (_this select 1 == key_c) then {pressed_c = false;};
	if (_this select 1 == key_a) then {pressed_a = false;};
	if (_this select 1 == key_e) then {pressed_e = false;};
	if (_this select 1 == key_s) then {pressed_s = false;};
}];

["ZE_KeyStroke", "onEachFrame", {
	if (pressed_ctrl && pressed_a) ExitWith {
		["ALL"] call ZE_ExportEntities;
		hint "";
		["CuratorAddAddons",["ZEUS objects copied to clipboard."]] calL BIS_fnc_showNotification;
		pressed_a = false;
	};
	if (pressed_ctrl && pressed_c) ExitWith {
		["SEL"] call ZE_ExportEntities;
		["CuratorAddAddons",["SELETED objects copied to clipboard."]] calL BIS_fnc_showNotification;
		pressed_c = false;
	};
	if (pressed_ctrl && pressed_shift && pressed_e) ExitWith {
		[] call ZE_AddCuratorObjects;
		["CuratorAddAddons",["Nearby objects ENABLED for Zeus."]] calL BIS_fnc_showNotification;
		pressed_e = false;
	};
	if (pressed_ctrl && pressed_shift && pressed_s) ExitWith {
		["DISABLE"] call ZE_ObjectSimulation;
		["CuratorAddAddons",["DISABLED simulation for selected objects."]] calL BIS_fnc_showNotification;
		pressed_s = false;
	};
	if (pressed_ctrl && pressed_s) ExitWith {
		["ENABLE"] call ZE_ObjectSimulation;
		["CuratorAddAddons",["ENABLED simulation for selected objects."]] calL BIS_fnc_showNotification;
		pressed_s = false;
	};
}] call BIS_fnc_addStackedEventHandler;

};

//Remove Keystroke EH
ZE_RemoveKeyStrokeEH = {
findDisplay 312 displayRemoveEventHandler ["KeyDown",ZE_keyDownEHId];
findDisplay 312 displayRemoveEventHandler ["KeyUp",ZE_keyUpEHId];

["ZE_KeyStroke", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};



//Enable/disable EH on Zeus start/end
[] spawn {
while {true} do {
	waitUntil {sleep 0.1; !(isNull findDisplay 312)};
	[] spawn ZE_AddKeyStrokeEH;
	waitUntil {sleep 0.1; isNull findDisplay 312};
	[] spawn ZE_RemoveKeyStrokeEH;
};
};



ADD: Also a [Ctrl+Z] undo last change function would work wonders. Although I'm not sure if that's ever possible in Arma. Just a thought.

Interesting Idea. Unfortunately I don't have the time right now to pursue something like what you posted above. Would be nice to come back to it when I have time.

Share this post


Link to post
Share on other sites

Wondering if you are planning on any updates soon, ammo boxes are still broken.

---------- Post added at 23:51 ---------- Previous post was at 22:59 ----------

Also at the very least being able to export only a select number of objects to SQM would help improve the useability of this script dramatically.

Share this post


Link to post
Share on other sites
Wondering if you are planning on any updates soon, ammo boxes are still broken.

---------- Post added at 23:51 ---------- Previous post was at 22:59 ----------

Also at the very least being able to export only a select number of objects to SQM would help improve the useability of this script dramatically.

I have a bit of time to work on it tonight, question is how would it look for objects? out in a set radius around the player?

Share this post


Link to post
Share on other sites
I have a bit of time to work on it tonight, question is how would it look for objects? out in a set radius around the player?

i know it interferes with the add action but being able to export the objects currently highlighted in zeus would be really nice.

Share this post


Link to post
Share on other sites
Unfortunately I don't have the time right now to pursue something like what you posted above. Would be nice to come back to it when I have time.

I understand :(

how would it look for objects? out in a set radius around the player?

I guess if you want to export selected objects only, "curatorSelected" would return an array of arrays containing all entities selected in the Zeus interface. Format: [selectedObjects, Selected Groups, Selected Markers, Selected Waypoints].

Share this post


Link to post
Share on other sites
Guest

Armaholic mirror updated with latest version!

================================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Looks like to be a great alternative to MCC, does'nt it ?

I will try it soon.... :)

Share this post


Link to post
Share on other sites

Hi plz help a fellow noob with some step by step instructions.

How do I use this?

Do I extract the pbo and place it where id be able to access it via editor?

Once objects are placed via Zeus and i go back to the player. Do i then scroll down to save mission, then what? Is it placed on the clipboard?

If so where do i go to paste all the info, do i need to create a new mission, save it and then override all the info it that mission.sqf?

Any help will be much appreciated.:)

Share this post


Link to post
Share on other sites
Hi plz help a fellow noob with some step by step instructions.

How do I use this?

Do I extract the pbo and place it where id be able to access it via editor?

Once objects are placed via Zeus and i go back to the player. Do i then scroll down to save mission, then what? Is it placed on the clipboard?

If so where do i go to paste all the info, do i need to create a new mission, save it and then override all the info it that mission.sqf?

Any help will be much appreciated.:)

before you do the below you need a dummy mission with a single player unit put down and saved.

1. Put the Pbo inside your missions folder in arma 3's root directory. (it will now appear under scenarios)

2. place objects in zeus, go back to player

3. use the export action

4. wait for completion hint

5. alt tab out and find your dummy mission in my documents

6. open the mission.sqm

7. delete all contents

8. copy in content that was copied to clipboard.

Share this post


Link to post
Share on other sites

Thx will give it a go tomorrow. :)

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  

×