Jump to content
Sign in to follow this  

How to export terrain information

Recommended Posts

Hello everyone!

I am trying to obtain information of the map and export/save it somewhere, like a .txt file or some thing where check it.


For example, here is the code to have a list with all terrain objects within a given radius

// Define the position
_position = getMarkerPos "position";

// Define radius
_radius = 50;

// SearchForObjects
_terrainObjects = _position nearestTerrainObjects [_radius, "All"];


Now, I want to save this list/information somewhere. IS there any way? I have tried to "create" a .txt file, but unsucessfully.

Thanks a lot!


  • Like 1

Share this post

Link to post
Share on other sites

Hello, you can try something with CopyToClipboard but i'm not sure how it work. I found some exemple in this topic.

You can maybe use debug console with your code then copy/paste results according to this post.


Edit :


I was curious, so i've done a few test, this one seems to work proprely, i call it with a trigger :


Activation : Everyone

Type : Present

Condtion : This

On activation :


_terrainObjects = nearestTerrainObjects [getMarkerPos "position",[], 50];
hint "copy to clipboard";
copyToClipboard str _terrainObjects;


nearestTerrainObjects synthax doesn't work with your code, i just use the synthax exemple on the wiki


Good luck with your script 😀



  • Like 1

Share this post

Link to post
Share on other sites

Thanks for your reply!

I tried it and this is what it returned to me:

[408294: t_picea3f.p3d,408312: t_picea3f.p3d,408289: t_picea3f.p3d,408304: t_picea3f.p3d,408328: t_picea3f.p3d,408320: t_picea3f.p3d,408303: t_picea3f.p3d,408295: t_picea3f.p3d,408313: t_picea3f.p3d,408292: t_picea3f.p3d,408307: t_picea3f.p3d,408297: t_picea3f.p3d,408286: t_picea3f.p3d,408329: t_picea3f.p3d,408305: t_picea3f.p3d,408291: t_picea3f.p3d,408310: t_picea3f.p3d,408327: t_picea3f.p3d,408282: t_picea3f.p3d,408298: t_picea3f.p3d,408325: t_picea3f.p3d,947798: r2_boulder2.p3d,408300: t_picea3f.p3d,408301: t_picea3f.p3d,408316: t_picea3f.p3d,408302: t_picea3f.p3d,408317: t_picea3f.p3d,408406: t_picea3f.p3d,408315: t_picea3f.p3d,408155: t_picea3f.p3d,408141: t_picea3f.p3d,408293: t_picea3f.p3d,408376: t_picea3f.p3d,408296: t_picea3f.p3d,947797: r2_boulder1.p3d,408374: t_picea3f.p3d,408284: t_picea3f.p3d,408160: t_picea3f.p3d,407998: misc_stub1.p3d,408314: t_picea3f.p3d,408116: t_picea3f.p3d,408324: t_picea3f.p3d,408283: t_picea3f.p3d,947772: r2_boulder2.p3d,408407: t_picea3f.p3d,407984: t_picea3f.p3d,408384: t_picea3f.p3d,408117: t_picea3f.p3d,408323: t_picea3f.p3d,407949: t_picea2s.p3d,407954: t_picea1s.p3d,408393: t_picea3f.p3d,408162: t_picea3f.p3d,407987: t_picea3f.p3d,408309: t_picea3f.p3d,408383: t_picea3f.p3d,408322: t_picea3f.p3d,408154: t_picea3f.p3d,947771: r2_boulder2.p3d,408143: t_picea3f.p3d,947769: r2_boulder2.p3d,407976: t_picea3f.p3d,408306: t_picea3f.p3d,408115: t_picea3f.p3d,407990: b_pmugo.p3d,408271: t_picea3f.p3d,408378: t_picea3f.p3d,408118: t_picea3f.p3d,408308: t_picea3f.p3d,408321: t_picea3f.p3d,407966: t_picea3f.p3d,408121: t_picea3f.p3d,408405: t_picea3f.p3d,407950: t_picea2s.p3d,408402: t_picea3f.p3d,408398: t_picea3f.p3d,408243: t_picea3f.p3d,947765: r2_boulder1.p3d,408131: t_picea3f.p3d,408149: t_picea3f.p3d,408396: t_picea3f.p3d,408166: t_picea2s.p3d,408142: t_picea3f.p3d,408287: t_picea3f.p3d,407965: t_picea3f.p3d,408392: t_picea3f.p3d,407959: t_picea3f.p3d,407973: t_picea3f.p3d,407759: t_picea3f.p3d,408389: t_picea3f.p3d,408311: t_picea3f.p3d]


I guess that is the list of different plants within the class "plants", right? But isn't supposed to return me this classes instead of the different components within each class? 


It worked perfectly, but is there any other methos to make it automatically and instead of involving the manual copy-paste method?




Share this post

Link to post
Share on other sites

NearestTerrainObjects use a few class to specify your search, in my exemple i use :



_terrainObjects = nearestTerrainObjects [getMarkerPos "position",[], 50];


With that expression, i use [] as filter (it inclued every type of objects), you can remplace that by a specific one or an array with multiple class. The wiki explain that very weel , check the differents exemples :













































I've found that but you need to manually go searching file, so copy/paste is quicker i think :


On 6/10/2015 at 8:35 PM, Undeceived said:

For the sake of completeness:

There is also a file called clipboard.txt in C:\Users\YourName\AppData\Local\Arma 3

(precisely: The file is only there when something actually was copied to clipboard.)

In some situations much data is copied into the clipboard in quick succession - e.g. while making a camera script. In this example the last saved camera position of course is in the clipboard, ready to be pasted with Ctrl+V, but in the clipboard.txt all previous saved camera positions also are still contained, so you don't need to exit the game to paste every single one...

It's kind of like the RPT dump, if you want (which is in the same folder btw.).


If there is another method, i can't see how doing it 🙂 

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