Jump to content

_SCAR

Member
  • Content Count

    225
  • Joined

  • Last visited

  • Medals

Everything posted by _SCAR

  1. Ok for anyone curious, I found the *only* one that works: _obj setPosWorld getPosWorld _obj;
  2. All, I'm trying to set the altitude of a pipe (class is Land_IndPipe1_20m_F). The pipe is oriented to terrain normal. The issue is that the pipe's inclination gets completely messed up. This is the pipe in the editor: This is the pipe after setting its altitude from a script: Things I've tried: _currentPipe setPos [getPos _currentPipe select 0, getPos _currentPipe select 1, _altitude]; _currentPipe setPos (_currentPipe modelToWorld [0, 0, _altitude]); _currentPipe setPosATL (_currentPipe modelToWorld [0, 0, _altitude]); _currentPipe setPosATL [getPosATL _currentPipe select 0, getPosATL _currentPipe select 1, (getPosATL _currentPipe select 2) + _altitude]; _currentPipe setPosASL [getPosASL _currentPipe select 0, getPosASL _currentPipe select 1, (getPosASL _currentPipe select 2) - _altitude]; To no avail. ...Any ideas? Thank you, _SCAR
  3. Going further: running this multiple times MOVES THE OBJECT everytime this is called: _obj setVehiclePosition [[9242, 1009, 0], [], 0, "CAN_COLLIDE"];
  4. Thinking this might be a problem of collision, I even tried: _obj setVehiclePosition [getPos _obj, [], 0, "CAN_COLLIDE"]; which also moves (and rotates) the object. WTAF.
  5. Not really, no. Still I don't understand why this moves the object: _obj setPos (getPos _obj); ...anyone cares to explain it to me...? Thank you, _SCAR
  6. Ok answering myself here. I guess this has to do with the fact that this object is primarily oriented at SEA level, hence the issues if you use it with TERRAIN orientation. I don't know, 50% of Arma programming is random guesses. This fixes it (edit: no it doesn't) _currentPipe setPosATL [getPosATL _currentPipe select 0, getPosATL _currentPipe select 1, _altitude]; _currentPipe setVectorUp surfaceNormal position _currentPipe;
  7. I'm trying to add a custom action to a passenger in a truck: As you can see, only the default "Join group" action is available. I would like to add another action, for instance "get out of truck". This is what I have, but it's not working: _actionInfo = [ "ScarPipelineWorkerGetOutOfVehicle", // 0: Action name <STRING> "Get out of truck", // 1: Name of the action shown in the menu <STRING> "", // 2: Icon <STRING> // Statement <CODE> { params ["_target", "_player", "_params"]; [_target] orderGetIn false; unassignVehicle _target; }, // Condition <CODE> { params ["_target", "_player", "_params"]; (vehicle _target == _target) } ]; _action = _actionInfo call ace_interact_menu_fnc_createAction; [_worker, 0, ["ACE_MainActions", "ACE_Passengers"], _action] call ace_interact_menu_fnc_addActionToObject; ....Any ideas? Thank you, _SCAR
  8. For anyone wondering, a couple of things only needed to be changed: this obviously needed to be attached to the vehicle an additional item was needed: the name of the passenger [_vehicle, 0, ["ACE_MainActions", "ACE_Passengers", str _worker], _action] call ace_interact_menu_fnc_addActionToObject;
  9. _SCAR

    Eden Extended Objects

    Thank you :)
  10. _SCAR

    Eden Extended Objects

    Apologies, link added. Thank you.
  11. Hello all, I am using pboProject that I purchased from Mikero's website to create a map. This map has a dependency to CUP. In my config.cpp I define the required addons: requiredAddons[] = { "A3_Data_F", "A3_Roads_F", "A3_Map_Data", "A3_Map_Stratis", "A3_Plants_F", "A3_Structures_F", "A3_Structures_F_Argo", "A3_Structures_F_EPB", "A3_Structures_F_EXP", "A3_Structures_F_Heli", "CUP_Buildings_Data", "CUP_Buildings2_Data", "CUP_CWA_Buildings", "CUP_CWA_Misc", "CUP_Models_DBE1_Data", "CUP_CAMisc", "CUP_Misc_e_Data", "CUP_CAMisc2", "CUP_Misc3_Data", "CUP_CA_Plants_E", "CUP_CASigns2", "CUP_Structures_Data", "CUP_Structures_e_Data" }; However, the map fails to compile with this error: File \ca\misc\config.cpp: config.cpp has externs but no RequiredAddons ERROR: \ca\misc\config.cpp is faulty The addon name for \ca\misc\popelnice.p3d cannot be determined I don't know how I am supposed to fix a config.cpp file which is included with CUP. How can I proceed? Thank you, _SCAR.
  12. Thank you for the fast response! Will check this tomorrow and report if I still see issues.
  13. Here it is: class CfgPatches { class CUP_CAMisc { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {}; }; class CUP_Misc_Data { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {}; }; class CAMisc { units[] = {"Barrel1","Barrel2","Barrel3","Barrel4","Barrel5","Barrel6","BarrelBase","Barrels","BlackhawkWreck","Camera1","ClutterCutter","Computer","Danger","DangerEAST","DangerGUE","DangerWest","Fence","FenceWood","FenceWoodPalet","Fire","FireLit","FlagCarrier","FlagCarrierCore","FlagCarrierEast","FlagCarrierNorth","FlagCarrierSouth","FlagCarrierWest","Heli_H_civil","Heli_H_rescue","HeliH","HeliHEmpty","JeepWreck1","JeepWreck2","JeepWreck3","Land_drevtank_ruin","Land_Fuel_tank_big","Land_fuel_tank_small","Land_Fuel_tank_stairs","Land_HiddenPath_5","Land_HiddenPath_corner","Land_houpacka","Land_jezekbeton","Land_kulata_prolezacka","Land_ladder","Land_ladder_half","Land_maly_kolotoc","Land_obihacka","Land_Piskoviste","Land_podlejzacka","Land_prebehlavka","Land_prolejzacka","Land_sloup_vn","Land_sloup_vn_drat","Land_sloup_vn_drat_d","Land_sloup_vn_dratZ","Land_strelecky_post_new","Land_vez_ropa","Land_water_tank","Land_water_tank2","LODy_test","M113Wreck","misc01","Paleta1","Paleta2","PaletaHelper","snow","snowman","Target","TargetTraining","TVStudio","Vec03","Vysilacka","WallMap","Wire","xxxPhotos"}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAData"}; }; };
  14. Are the models usable? I seem to recall that the ones from the original project never were finished...
  15. Not really sure why but: I originally used arma3p to unpack a3 and setup buldozer. I have now uninstalled that and regenerated my p:\ drive by using the standard arma tools to install buldozer and extract data. All is good now.
  16. I don't know what to say. It's the usual once-a-week frustration that I unfortunately experience. :)
  17. Here: BUT GUESS WHAT?! I thought I was used to this Arma 3 bullshittery but I guess the story never ends.
  18. Ok, I found PART of the culprit. This is strange de strange, so bear with me. The background of my sat image is a uniform dark green color, as you can see in the png. I found out that if, instead of a uniform color, I add a single pixel of a slightly different color within the png, then ImageToPaa succeeds in the conversion. So I did just that: instead of adding a background uniform color, I created a 512x512px pattern that contain all pixels of my desired color except one, which has a slightly darker color (indistinguishable at bare eye). I then used this pattern as background of my satellite image. The tiles are now generated successfully. I suspect there might be some weirdness in the image compression of paa, but who knows. HOWEVER; this doesn't solve it for me. Buldozer is still unable to load the texture.
  19. I am using BMP. PNGs are automatically created by layer generation.
  20. Ok I'm narrowing this down to the fact that the PNG file up here cannot be converted to PAA. Just give it a try, you should have an empty .paa: https://cldup.com/OlGLJYdhkL.png Any ideas why?
  21. Dear all, Those of you who have tried importing roads from real data might have experienced the pain. There are multiple tutorials out there, but most of them give bits and pieces and it's hard to understand the exact workflow that needs to be followed. FYI, reference is mainly from these tutorials: Terrain Processor PMC Editing Software that you'll need: Terrain Builder Global Mapper QGIS SAS Planet Photoshop / Gimp Some of these software are not free, however there are trial versions that you may consider using. Let's get started. SETTING UP TERRAIN BUILDER & EXPORTING THE REFERENCE HEIGHT MAP Fire up Terrain Builder. Click on "Mapframes > Add mapframe": Leave the default Zone 31N selected and click OK: Set the name of the Mapframe, the output root folder (in your P drive), Easting to 200000 and Northing to 0: Click on the "Samplers tab" and choose your map size. I've set everything to have a map size of 10,240Km: Click on the "Processing" tab: Then click on "Rebuild Terrain": Confirm, and you will now have an empty terrain layer in Terrain Builder. We are going to export it so that we will be able to use it as a reference, further down in the tutorial: We're going to save it as reference-terrain.asc. DOWNLOADING ROADS There are multiple ways that you can get the roads shapefiles from Open Street Map. You can go on the https://www.openstreetmap.org/ website and export a specific area if you'd like, but we're going to download the data from http://download.geofabrik.de/ Head there, and select the country of your interest. In our case, we're going to need the data from Afghanistan: Download the .shp.zip format, and unpack it somewhere on your drive. SELECTING A PRECISE AREA Open Global Mapper and start a new project by selecting "Load Default Data": Click on Find address: Enter the name / coordinates of the area you're interested in (in this case Feyzabad, the map I'm currently working on): Click to center map on result: Let's now add some visual reference by clicking on the icon to connect to online data: Select "World Imagery" and click on "Connect": Use the zoom tool to zoom on your area. You can now enable the Control Center from the menu: So you can enable / disable the layers to view either the world imagery or the countries default data. We are now going to select our precise area of interest. Click on the "Create rectangle/Square area" tool: Draw an area (doesn't need to be precise) on the terrain where you want your area to be. In the menu that pops up when you release the mouse button, enter the name of your reference area (I've called it "border"): We can now better move the selection to your area of interest. Click on the Digitizer Tool: Select your area, then on the move tool: This allows you to move your area of interest around: Once you're satisfied with the position, we're going to adjust this area to be a perfect square in terms of meters. Right click on the area and select "Vertex Editing > Edit Feature Vertices": In the menu that pops up, we're going to change all of the vertices distances so that they reflect our map size, i.e. 10,240m. To do so, click on the first vertex, then on the "Edit Length" button, and enter the value 10240 meters: Once you're done, you will have a perfect square of 10,240m x 10,240m (look at the "Length" column): Click on "Copy to clipboard" to be able to access these references later: These are my coordinates: Idx,Longitude,Latitude,Length,Total Length,Heading 1,70° 30' 01.1798" E,37° 09' 41.4202" N,10.24 km,---,90.0° 2,70° 36' 56.2072" E,37° 09' 41.4496" N,10.24 km,10.24 km,180.0° 3,70° 36' 56.2072" E,37° 04' 09.2811" N,10.24 km,20.48 km,270.0° 4,70° 30' 01.6831" E,37° 04' 09.3107" N,10.24 km,30.72 km,0.0° 5,70° 30' 01.6831" E,37° 09' 41.4793" N,---,40.96 km,--- Use a converter tool to convert these coordinates in UTM. I used this online converter tool to do so: http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html The result of my conversion is to have the following 4 points: top left 37.0692447463377,70.5003277260268 UTM: 4103606.716118635,633376.3161381673 top right 37.0692447463377,70.6156131229525 UTM: 4103774.7515539424,643625.6939804782 bottom left 37.1615056060246,70.5003277260268 UTM: 4113842.6755561405,633214.540454661 bottom right 37.1615056060246,70.6156131229525 UTM: 4114010.864559334,643451.4784080114 Note that the UTM zone of my area is 42N. Now it's time to import the roads downloaded from Geofabrik. For the purpose of this tutorial (importing roads) we're only interested in the gis.osm_roads_free_1.* files: Import the gis.osm_roads_free_1.shp file to Global Mapper (a simple drag & drop will do), and you will see the roads surrounding your selection: Now we need to convert the project to use UTM. Click on "Configure": In the resulting popup, set the Projection to UTM (the correct zone should already be set for you, if not just use the one that resulted from your computations here above): You might see your areas tilting a bit. Now, let's crop the roads to our area of interest. With the Digitizer Tool active, and only the roads and your border layer visible, select your border, and right click to select "CROP - Crop Loaded Features to Selected Area(s)": Ensure that you consider only lines and that you create a new layer: Name your layer: Verify that the projection of your new layer is correct: and then click on OK. You can now hide the layer with the full roads, and if you visualize only the newly created "roads_clipped" layer and the border you'll see only the roads you're interested in: We can now export those clipped roads: Export them as "shapefile": Specify your destination file for your lines (in my case, roads_exported.shp) and that "Generate Projection" is selected. PREPARING ROADS FOR IMPORT Open up QGIS. Open the options: Ensure that your projection is set to WGS 84 / UTM zone 31N by default: Click on OK and start a new project. Now import (drag & drop will suffice): The reference height map that you exported here above from terrain builder (reference-terrain.asc). The roads_exported.shp that you exported from Global Mapper. Right click on roads_exported and select "Zoom to Layer": You will see: Ensure that both layers are set to the proper CRS: right click on both layers, select "Set Layer CRS" and select "WGS 84 / UTM Zone 31N": Do this for both layers. If you don't see roads anymore, just right click on the layer, "Zoom to Layer" again. Now it's time that we move the roads to the appropriate place, which is Easting 200000 and Northing 0, as per the data we entered when creating our Mapframe in Terrain Builder. let's compute how much our roads are off, in terms of UTM: Our top left corner UTM coordinates are (see computations above): 4103606.716118635, 633376.3161381673 We need to make them become: 0, 200000 Hence we need to shift the coordinates: X shift: 200000 - 633376.3161381673 = -433376,3161381673 Y shift: 0 - 4103606.716118635 = -4103606,716118635 Bring up the Processing Toolbox with CTRL+ALT+T, and search for the v.transform algorithm. Once it appears, double-click on it, which will bring up the dialog. Enter the shifting values that we just computed: Clic on "Run". This will create a new layer "Transformed". Right-click on this layer, and select "Zoom to Layer". You will see: The black square is our reference-terrain level, so the roads are now in the right position for Terrain Builder. Great! However, you can notice that the roads are slightly rotated in comparison to the reference terrain. We can fix that by applying some rotation. I'm going to choose -1 and apply it with v.tramsform again: This results in roads being rotated but also shifted southwards: Right click on the upper "Transformed" layer and select "Toggle Editing": Now use the Move Tool to move your roads so that they are fully contained in the black area (the reference terrain): Repeat if necessary. When you're done, we can export those roads to be used in Terrain Builder. Right-click in the uppermost "Transformed" layer, and select "Save as:" Export the layer as ESRI Shapefile (ensure that the proper CRS is set, which should be the default): Here I've saved the file as roads_final.shp. We now need to set the appropriates attributes for roads. In the resulting excel-like table, toggle editing mode: Click to create a new field: Create a new numerical field called ID: Now we need to populate this field. Click on "Open field calculator": and fill the data to look like this: The ID field needs to contain the roads reference as specified in your roadslib.cfg file of your terrain project. Basically, we are populating the newly created ID field based on the values contained in the fclass field by using this expression: CASE WHEN fclass is 'primary' THEN 1 WHEN fclass is 'secondary' THEN 2 WHEN fclass is 'tertiary' THEN 3 WHEN fclass is 'residential' THEN 4 WHEN fclass is 'service' THEN 4 ELSE 5 END Click on OK. You ID field will now be properly populated: Now let's remove the unneeded fields. Click on the delete field icon: Select all the fields except the newly created ID: Click OK. Save Edits: Quit the Attributes Table and If prompted, save the layer. PREPARING THE SATELLITE IMAGE Open SAS Planet, and click to enter a selection area by coordinates: Enter the coordinates as exported by Global Mapper: This will bring up the selection manager. Select "Bing Maps - satellite" (or your preferred satellite source) and then click on the first zoom level that has a resolution higher than your terrain size (in this case, you can see that with zoom level of 18 the resulting image size is greater than 10,240 x 10,240): Click on "Start" to download the tiles: Once the process is finished, click to select the last area: Move to the "Stitch" tab: Ensure to select the same Map source (in this case, "Bing Maps - satellite") and level of zoom (here, 18), select where to save your file and click on "Start". This will save your satellite image as a single JPG file. Open up this image in Photoshop (or other editor of choice) and change the size of the satellite image to match the size of your terrain (you will have to un-tick "Constrain Proportions"), in this case 10240: Save your resulting satellite image as a BMP file. Do not save it in other formats, as those might take significantly longer when imported in Terrain Builder (we're talking about hours in comparison to few seconds). IMPORTING EVERYTHING BACK IN TERRAIN BUILDER Back in Terrain Builder, import the newly created satellite image: Now import your roads (roads_final.shp): When prompted, leave unchanged: And there you have it. Enjoy your freshly imported roads: And if you select them and open up the Database Properties: You are going to see the correct road ids: Many thanks to the various tutorial writers that originally helped me, and to W4lly63 for his great support. Best, _SCAR.
×