Jump to content
jandrews

Is this working anymore? call BIS_fnc_ObjectsMapper;

Recommended Posts

I found this in another thread and wanting to try and make some compositions. But does not work this way. Or may be I am looking in the wrong file. another response mentioned a clipboard, not sure there is one for Arma 3, but anyways, can anyone confirm this method works? If not is there another easy way to do this? Thanks.

The below is directions with included example from another thread. I will presume you get this info from the mission.sqm. Anyone?

1. Make your custom composition in the editor, in a flat area.

2. Place the player in the middle of your composition and put this in his init:

Code:

[getPos player, 50] call BIS_fnc_objectsGrabber

3. Create and open a new .sqf file in your mission folder

4. Do CTRL+V to paste code. You should see something similar to this:

Code:

/*Grab data:
Mission: objectgrab_test
World: Stratis
Anchor position: [4210.73, 4857.44]
Area size: 100
Using orientation of objects: yes
*/


[
   ["FlagPole_F",[0,0,-0.00663757],45.5765,1,0,[1.06726e-007,0],"","this setdir random 360",true,false], 
   ["Land_BagFence_Long_F",[-1.20703,1.68018,-6.10352e-005],339.649,1,0,[-1.35292,-1.17876],"","",true,false], 
   ["Land_BagFence_Long_F",[1.57178,1.99365,0.00177002],8.85463,1,0,[-1.8098,6.10209],"","",true,false], 
   ["Land_BagFence_Long_F",[-3.29834,-0.0219727,0.00279236],301.678,1,0,[-6.06735,-2.93077],"","",true,false]
]

5. Save and quit your composition.

6. Now, to spawn the composition:

Code:

0 = [positionWhereYouWantToSpawnYourComposition, azimutOfYourComposition, call (compile (preprocessFileLineNumbers "yourComposition.sqf"))] call BIS_fnc_ObjectsMapper;

Share this post


Link to post
Share on other sites

Its suppose to be about call BIS_fnc_objectsGrabber

Share this post


Link to post
Share on other sites

I've been doing loads (and I mean 50+) compositions using the objectsgrabber/mapper functions, they worked fine despite having issues placing objects on the z axis (and the usual floating point errors which I successfully eliminated using Killzone Kids glorious float to string function).

You need to define your composition as an array,

[
   ["FlagPole_F",[0,0,-0.00663757],45.5765,1,0,[1.06726e-007,0],"","this setdir random 360",true,false], 
   ["Land_BagFence_Long_F",[-1.20703,1.68018,-6.10352e-005],339.649,1,0,[-1.35292,-1.17876],"","",true,false], 
   ["Land_BagFence_Long_F",[1.57178,1.99365,0.00177002],8.85463,1,0,[-1.8098,6.10209],"","",true,false], 
   ["Land_BagFence_Long_F",[-3.29834,-0.0219727,0.00279236],301.678,1,0,[-6.06735,-2.93077],"","",true,false]
]  

won't do it, it needs to look like this:

_mycomp =
[
   ["FlagPole_F",[0,0,-0.00663757],45.5765,1,0,[1.06726e-007,0],"","this setdir random 360",true,false], 
   ["Land_BagFence_Long_F",[-1.20703,1.68018,-6.10352e-005],339.649,1,0,[-1.35292,-1.17876],"","",true,false], 
   ["Land_BagFence_Long_F",[1.57178,1.99365,0.00177002],8.85463,1,0,[-1.8098,6.10209],"","",true,false], 
   ["Land_BagFence_Long_F",[-3.29834,-0.0219727,0.00279236],301.678,1,0,[-6.06735,-2.93077],"","",true,false]
] ;

Also the way you're calling it is a bit clumsy,

a good approach would be:

spawnmyComp.sqf:

_myComp =
[
   ["FlagPole_F",[0,0,-0.00663757],45.5765,1,0,[1.06726e-007,0],"","this setdir random 360",true,false], 
   ["Land_BagFence_Long_F",[-1.20703,1.68018,-6.10352e-005],339.649,1,0,[-1.35292,-1.17876],"","",true,false], 
   ["Land_BagFence_Long_F",[1.57178,1.99365,0.00177002],8.85463,1,0,[-1.8098,6.10209],"","",true,false], 
   ["Land_BagFence_Long_F",[-3.29834,-0.0219727,0.00279236],301.678,1,0,[-6.06735,-2.93077],"","",true,false]
] ;
0 = [positionWhereYouWantToSpawnYourComposition, azimutOfYourComposition, _myComp] call BIS_fnc_ObjectsMapper; 

should be working just fine.

If you're interested I can post my workaround for precise Z axis positioning later today.

Cheers

Share this post


Link to post
Share on other sites

I would appreciate any help I can get. The issue I am having is I do the above steps and cannot find the code to make an array. I look into the mission.sqm and only see the normal stuff. No code like any of the above.

Share this post


Link to post
Share on other sites
I would appreciate any help I can get. The issue I am having is I do the above steps and cannot find the code to make an array. I look into the mission.sqm and only see the normal stuff. No code like any of the above.

excuse me for my

NOOBNESS

but this puzzles me. I am attempting to use this code

[getPos player, 50] call BIS_fnc_objectsGrabber

but once I save my composition I cannot seem to find it as the below example. I can see the items in the mission.sqm just fine. BUT am I suppose to find the code in an array format like below or do I need to modify more lines of code to in order to use BIS_fnc_objectGrabber. If not in mission.sqm and RPT than where would I find this stuff. Thanks and appreciate the assistance.

[
   ["FlagPole_F",[0,0,-0.00663757],45.5765,1,0,[1.06726e-007,0],"","this setdir random 360",true,false], 
   ["Land_BagFence_Long_F",[-1.20703,1.68018,-6.10352e-005],339.649,1,0,[-1.35292,-1.17876],"","",true,false], 
   ["Land_BagFence_Long_F",[1.57178,1.99365,0.00177002],8.85463,1,0,[-1.8098,6.10209],"","",true,false], 
   ["Land_BagFence_Long_F",[-3.29834,-0.0219727,0.00279236],301.678,1,0,[-6.06735,-2.93077],"","",true,false]
]

Share this post


Link to post
Share on other sites

The composition like the one in the example is returned from the function (according to the biki). That means you need to manual save it someway. I would suggest copyToClipboard. Info is automatically saved to clipboard.

This works perfect.

[getPos player, 50] call BIS_fnc_objectsGrabber;

Afterwards, open your .sqf file and hit CTRL+V to paste the information. Then make the proper edits from Grumpy's post.

EDIT: The function saves the info to the clipboard automatically. The instructions you originally posted worked perfectly. You just have to follow them.

Edited by Fight9

Share this post


Link to post
Share on other sites

I have tried both methods using "player" and "object" and its not working for me. Not sure why. I have done the above directions.

1. Make your custom composition in the editor, in a flat area. Done

2. Place the player/object in the middle of your composition and put this in his init: Done

tried both of these and nothing.

[getPos player, 50] call BIS_fnc_objectsGrabber

[getPos this, 50, false] call BIS_fnc_objectsGrabber

3. Create and open a new .sqf file in your mission folder. Done

4. Do CTRL+V to paste code. You should see something similar to this: Done but nothing <----- this is not automatic. This step does not allow me to CTRL +V and save anything to a new blank sqf file. At least for me. Is there a step prior to this I am missing? Once the PHP code is placed does it save auto, do I need to save mission prior to this step? Excuse me for my lack of basic skills here. But it seems I am missing something. may be sleep!

5. Save and quit your composition.

6. Now, to spawn the composition:

Here is the link.

http://forums.bistudio.com/showthread.php?173396-Dynamic-Object-Compositions-%28DoC%29&p=2641626&viewfull=1#post2641626

Edited by JAndrews1

Share this post


Link to post
Share on other sites

Try right clicking with your mouse and selecting paste.

Share this post


Link to post
Share on other sites
Try right clicking with your mouse and selecting paste.

Is there a way to locate this so called "clipboard", it seems like the lost arc. I find it funny that something this basic is not happening for me. I will try this later when I get home.

Share this post


Link to post
Share on other sites

Well, if you are using windows XP then you can use clipboard.exe from the run menu. Not in win7/8 however.

You can also paste via menu bar in your notepad program.

Edit at the top >> Paste

67395-edit-paste.gif

Share this post


Link to post
Share on other sites

Received your PM,

I'm confused as why you're unable to find the code in the clipboard, since your first post already shows the code copied by the BIS_fnc_ObjectsGrabber function.

Or was this merely an example from some webpage?

Maybe you got some stuff running that's constantly clearing your clipboard? (some mod error messages do that when starting A3, very annoying)

Summed up in easy steps:

  1. Build stuff in editor.
  2. Execute the BIS_fnc_ObjectsGrabber.
  3. Open text editor of your choice.
  4. Hit "CTRL+V".

The "clipboard" is the very basic windows clipboard,

by opening a text editor and hitting "CTRL+V" after you have executed the BIS_fnc_ObjectsGrabber in the game you should see the code.

It doesn't show in the mission.sqm nor in the rpt logs (maybe it did in an earlier version of the function).

That's pretty much it.

The only flaw it has is that the copied code is basically an undefined array,

you need to define it by putting a variable name in front of it seen in the post I made earlier in this thread (take a look at the last code field).

Cheers

Share this post


Link to post
Share on other sites

Yes, it was just an example. I will keep at it. this stupid stuff. lol

When you say execute the objectsGrabber, I presume you mean just placing it in either the player or object init. Does saving the mission prior do something to it? And if you do steps (1, 2, save, attempt 3 and 4) or (1, save, 2, save, attempt 3 and 4) screw up the process? it may, I will re attempt in this exact order without saving and see what happens. thanks guys for your patience and help.

Summed up in easy steps:

1.Build stuff in editor.

2.Execute the BIS_fnc_ObjectsGrabber.

3.Open text editor of your choice.

4.Hit "CTRL+V".

Updated! I needed to add a step. You say execute.... what I would say is "preview". After preview it worked.

Summed up in easy steps:

1.Build stuff in editor.

2.Execute the BIS_fnc_ObjectsGrabber. <---- by previewing the mission. Once in preview then move to step 3.

3.Open text editor of your choice.

4.Hit "CTRL+V".

Edited by JAndrews1

Share this post


Link to post
Share on other sites

Can anyone help? Im trying to get a array of markers or objects into the mapping line and create task lines but im banging my head against my monitor for the last hour or so.

 

Edit, cracked it.

 

 

_pos = ["rb1", "rb2", "rb3"];
_startPos = _pos call BIS_fnc_selectRandom;


[west, "task2", ["Destroy the ammo caches", "Destroy Cache", "Destroy Cache"], (getMarkerPos _startPos), true] spawn BIS_fnc_taskCreate; 


_myComp =
[
["Land_WoodenBox_F",[5.31836,8.34668,7.62939e-006],251.002,1,0,[],"","",true,false], 
["Land_d_House_Small_02_V1_F",[-8.42969,7.22559,-0.002882],8.9999,1,0,[],"","",true,false], 
["Land_WoodenCart_F",[13.1436,2.69531,-0.00475502],0.00676493,1,0,[],"","",true,false], 
["Land_Sacks_heap_F",[12.877,4.68848,3.05176e-005],64.0005,1,0,[],"","",true,false]
] ;
0 = [(getMarkerPos _startPos), 190, _myComp] call BIS_fnc_ObjectsMapper;

Share this post


Link to post
Share on other sites

I edited the grabber. It works good. I've not got the mapper working 100% yet. At rate I'm going Bis will fix it. The Bis Mapper works but if you make like a house with Mg's at windows. They all spawn in laying down. But here is a grabber that can get you guys started.

_CompGrab = {
	/*
	File: objectGrabber.sqf
	Author: Joris-Jan van 't Land

	Description:
	Converts a set of placed objects to an object array for the DynO mapper.
	Places this information in the debug output for processing.

	Parameter(s):
	_this select 0: position of the anchor point (Array)
	_this select 1: size of the covered area (Scalar)
	_this select 2: grab object orientation? (Boolean) [default: false]

	Returns:
	Ouput text (String)
	*/

	private ["_anchorPos", "_anchorDim", "_grabOrientation"];
	_anchorPos = _this param [0, [0, 0], [[]]];
	_anchorDim = _this param [1, 50, [-1]];
	_grabOrientation = _this param [2, false, [false]];

	private ["_objs"];
	_objs = nearestObjects [_anchorPos, ["house"], _anchorDim];
	_objsALL = nearestObjects [_anchorPos, ["All"], _anchorDim];
	_objsALL = _objsALL - _objs;
	_objs append _objsALL;
	//Formatting for output
	private ["_br", "_tab", "_outputText"];
	_br = toString [13, 10];
	_tab = toString [9];

	//Adding meta-data
	//_outputText = "/*" + _br + "Grab data:" + _br;
	//_outputText = _outputText + "Mission: " + (if (missionName == "") then {"Unnamed"} else {missionName}) + _br;
	//_outputText = _outputText + "World: " + worldName + _br;
	//_outputText = _outputText + "Anchor position: [" + (str (_anchorPos select 0)) + ", " + (str (_anchorPos select 1)) + "]" + _br;
	//_outputText = _outputText + "Area size: " + (str _anchorDim) + _br;
	//_outputText = _outputText + "Using orientation of objects: " + (if (_grabOrientation) then {"yes"} else {"no"}) + _br + "*/" + _br + _br;//
	_outputText = [];//"[";//_outputText + "[" + _br;
	//hint str _outputText;sleep 5;
	//_outputText = [];
	//First filter illegal objects
	{
		//Exclude non-dynamic objects (world objects)
		private ["_allDynamic"];
		_allDynamic = allMissionObjects "All";

		if (_x in _allDynamic) then
		{
			//Exclude characters
			private ["_sim"];
			_sim = getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation");

			if (_sim in ["soldier"]) then
			{
				_objs set [_forEachIndex, -1];
			};
		}
		else
		{
			_objs set [_forEachIndex, -1];
		};
	} forEach _objs;

	_objs = _objs - [-1];

	//Process remaining objects
	{
		private ["_type", "_ASL", "_objPos", "_dX", "_dY", "_z", "_azimuth", "_fuel", "_damage", "_orientation", "_varName", "_init", "_simulation", "_replaceBy", "_outputArray"];
		_type = typeOf _x;
		_ASL = _x getVariable ["ASL", false];
		if (!_ASL) then {_objPos = position _x;} else {_objPos = getPosASL _x;}; //To cover some situations (inside objects with multiple roadways)_objPos = _x modelToWorld [0,0,0];//
		_anTH = getTerrainHeightASL _anchorPos;
		_mvTH = getTerrainHeightASL _objPos;
		_Th = _mvTH - _anTH;
		_dX = (_objPos select 0) - (_anchorPos select 0);
		_dY = (_objPos select 1) - (_anchorPos select 1);
		//_z = (_objPos select 2) - (_anchorPos select 2);
		_z = (_objPos select 2);//(_Th + ((_anchorPos select 2) - (_objPos select 2)));
		_azimuth = direction _x;
		_fuel = fuel _x;
		_damage = damage _x;
		if (_grabOrientation) then {_orientation = _x call BIS_fnc_getPitchBank;} else {_orientation = [];};
		_varName = vehicleVarName _x;
		_init = _x getVariable ["init", ""];
		//TODO: re-enable once 3D editor simulation is fixed
		//_simulation = simulationEnabled _x;
		_simulation = _x getVariable ["simulation", true];

		_replaceBy = _x getVariable ["replaceBy", ""];
		if (_replaceBy != "") then {_type = _replaceBy;};

		_outputArray = [_type, [_dX, _dY, _z], _azimuth, _fuel, _damage, _orientation, _varName, _init, _simulation, _ASL];
		//_outputText = _outputText + _tab + (str _outputArray);
		//_outputText = if (_forEachIndex < ((count _objs) - 1)) then {_outputText + ", " + _br} else {_outputText + _br};
		_outputText pushBack _outputArray;
		debugLog (format ["Log: objectGrabber: %1", _outputArray]);
	} forEach _objs;

	//_outputText = _outputText + "]";
	//copyToClipboard str _outputText;
	//hint str _outputText;
	_outputText
};

 

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

×