Jump to content

WrinkleysRule

Wrinkley
  • Posts

    244
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by WrinkleysRule

  1. SNOW MASK This is just a follow on from a previous post regarding the Scripts -Generate Mask script that automatically creates an indoor snow mask (infoLayer_indoorMask.grle) by mapping the collision footprint of objects in the map roads, buildings etc (placeables should have their own mask already created in the i3d). The Generate Mask script originally worked by using the water plane height (inputted manually into the script)as a base for calculations as this was normally the lowest point on the map, however this is sometimes no longer the case. The problem highlighted by Dickieboy in his post (https://farmerboysmodding.com/index.php?/topic/2446-indoor-mask/) was that the script had a preset height of 47.5m which when executed without any change caused unwanted blocks to appear in the finished grle image. I have now edited the original script and renamed it (to avoid confusion with the original) so that it now allows the mask height to be set. The updated script is available at the end of this post, to install download the Create Snow Mask.zip and unzip, copy/paste the Create Snow Mask folder into C:\Users\Your Computer Name\AppData\Local\GIANTS Editor 64bit 9.0.4\scripts To use In Giants Editor Select Scripts – Snow Mask – Create Snow Mask the following pop up panel will appear Height Setting The height needs to set at the terrains lowest point, if you are unsure of the lowest point then a simple method to find this out is to Create -_Primitives – Plane and adjust the X and Z scales so the plane fits the size of your map (2048 for a normal size map) and just lower the plane until it is no longer visible in the map. Once happy with your height settings enter the figure into the Set Mask Height panel and select Generate Snow Mask the button will turn blue to show the script is working. WARNING – The script can take a couple of minutes to work (depending on how many collisions are in the map) during this time DO NOT try and do anything else in Giants Editor as it will freeze/crash. When the script has finished the Generate Snow Mask button will turn white and the following information will be printed in the console log, in this case, Saving mask map to C:/Users/Your Computer Name/Documents/My FS 22 Mods/Mod_Map_Alpine/maps/mapAlpine/map.i3d.indoorMask.grle Snow Height Set to: 5.0 You can of course leave the height setting at 0 (zero) but, although this will work it will take a bit longer for the script to finish. The new map.i3d.indoorMask.grle will probably need to be edited as items like rocks/boulders meshes will be clear of snow. This can be done in an image editor or in Giants Editor, I prefer doing any editing in Giants Editor as I then have a reference for adjusting the edit (such as lanes and by roads which if created with a mesh will not have any snow cover) and will not have to reconvert from png to grle. To edit in GE first you will need to rename/delete the original infoLayer_indoorMask.grle in the data folder and rename the map.i3d.indoorMask.grle to infoLayer_indoorMask.grle and copy/paste into the data folder . Open your map in GE and Select the Terrain info layer paint mode then in the Terrain Editing panel –Info Layer Painting –info layer dropdown select indoorMask the State Panel will change to Outdoor and the map area will turn white (snow) with pink areas (no snow). Select Info Channel 0 map will then change to white (no snow) and partially transparent black (snow) Right click paints a no snow area Left click deletes a no snow area When finished editing save the map the new snow mask will be saved in the infoLayer_indoorMask.grle Below are some examples of the new snow masks compared with existing in game versions ALPINE Map - height set at 5 -- original in game image on the right USA Map - height set at 65 -- original ingame image on the right Another thing to note is if you have both a infoLayer_indoorMask.grle and infoLayer_indoorMask.png in your data folder at the same time Giants Editor may crash on loading. Create Snow Mask.zip
  2. I have seen something similar to this way back in FS13 and it was pointed out then that it was quicker and easier to fill in the details directly into the xml given that you could easily copy/paste complete animation sections, plus notepad++ has a built in xml checker to check syntax etc All you are doing is adding another input layer to do the same job, you will still need to edit and test any xml's created as any manual input is still prone to errors whether accidental or not. Given the latest Blender i3d exporters are now creating xml's and adding some data directly into them on export, maybe in the not to distant future they will be able to export xml's with all the details required. As this is a topic for "Terrain Height, Paint Terrain and Spline Placement Scripts" and not for general scripting matters I suggest you create a topic in the Scripting section should you wish further discussion/input on the subject
  3. Would you mind giving an example of this " Xml via GUI" for say, a simple placeable house with an animated door.
  4. From the script it looks like the water height is the controlling factor (base water plane height) --- Usage -- Update water height: below this level all snow will be disallowed caster.castSingle = function (self, x, z) local y = self:getTerrainHeight(x, z) if y < self.waterHeight then return -1 -- always hit the water surface end self.castResult = 0 raycastAll(x, y + 0.0025, z, 0.0, 1.0, 0.0, "castCallback", 100.0, self, collisionMask) return self.castResult end As normal with Giants there never is any information on setup and in this case no way of changing water height value without going into C:/Program Files /GIANTS Software/GIANTS_EDitor_9.0.4_64bit/scripts. It would be quite simple to add a pop up panel to the script to allow for the water Height setting to be entered.
  5. The following is from another qurery I had on Microdem and may help Microdem File-Open - Open DEM/grid (Note when first opened the DEM is in aspect mod) Modify - Map shading options Advanced map colors and shading - Dem color merge - Elevation - Select Merge colors and set all sliders to the Left - Select Elevation tab Elevation Range for coloring - First select Map Area range (this will give a more accurate Max/min reading) Specified - change Max and Min values accordingly (use formula at the end of the tutorial for ratio if required) Stretching -None In Example Max 812.369385 Min 593.513916 Diff only 219 so changed values to min 30 max 249 Elevation Range for coloring - Select Ok Advanced map colors and shading -Select Ok File - Save map as image - As GEOTIFF, screen scale (greyscale) the following images show the various settings and results Note: Image from file in above picture moved to one side for clarity
  6. Your blocky problem om 4x map may by caused by the incorrect size of the indoor mask as all giants scripts are created for default map size.
  7. From the tutorial - - https://farmerboysmodding.com/index.php?/topic/2414-terrain-height-paint-terrain-and-spline-placement-scripts-tutorials/ With this script objects can be placed at various fixed, preset distances, random distances and locations away from or along the spline depending on settings in the script. The objects will be placed at terrain height along the spline (using their individual point of origin location) from the 'S' cv to the ‘E’ cv and aligned to the to the spline along their "Z" axis (unless random location selected). e.g. if you have a hedge that is 4m long and 1m wide ensure the longest section (4m)is aligned to the 'Z' axis otherwise rotate it in GE until is aligned along the 'Z' axis and freeze transform rotation also ensure that the point of origin (where the gizmo shows when object is selected) is at the correct point For best results, open any objects you intend to place in GE and adjust axis and origin accordingly, when done , freeze transform all scale/rotation settings (DO NOT freeze transform translations unless point of origin is relocated) on all the relevant objects. This also applies to any transform groups containing objects that required to be placed using the transform group itself, select the transform group and Edit—Freeze Transformation—Transformation, Rotation and scale
  8. It does help if you read the tutorial properly "In the Shape panel of the Curve Tools, select 3D, Fill Mode 'Half', Curve Deform 'Radius Selected', all other settings can be left as is. " operative section Fill Mode 'Half' Regarding alignment to terrain, if you change your CSV distance then it is wise to redo the terrain height as it will not be the same as any previous CSV settings. If you are refering to the centre of the road texture appearing blocky there will always be a certain amount of that as the same texture is used, the way to allieviate this is to add white lines and randomly add road decals such as potholes,cracks etc.
  9. With regard to creating TJunctions what I do is use one blender file for all the road network that way I can easily add/create TJunctions, roundabouts etc and have the option of exporting the whole road mesh as one item or each road mesh spline seperately As all my tutorials require a working knowledge of the software used in them I suggest you folow some online tutorials on how to do things in Blender here are a couple of youtube links to tutorials. https://www.youtube.com/@grabbitt https://www.youtube.com/user/AndrewPPrice Please post an image of the "steep hills look abit sharp edged" problem I will dig out the Old Tutorial and pm it to you later today
  10. @jobjobplayrough The method you are using is the method that was described in an earlier version of this tutorial and I think I still have it in my archives as a docx (word) file should Cmodz want to try it.
  11. From the look of your picture you have too many points in your spline, from the tutorial - "generally a value of 5 for roads and 10 or more for train tracks (gives a smoother incline) should be sufficient, but bear in mind that this distance will be the size of your individual road/rail sections in Blender. " When texturing you should cover the entire texture image otherwise the texture edges will not match up causing your blocky problem. Redo your spline with a csv setting of 5 and import into blender, create your road and then when unwrapping select UV-reset this will place all the seperate road sections in one lump and fill the image area, you may have some sections that are rotated but this is easily rectified by selecting just that section and rotating the UV to the correct orientation.
  12. I have no problems with UK or any other counties roads using the spline tutorial, the roadway section in the tutorial is a real life road in Cornwall If your dem and spline are set up correctly then you shouldn't have any problems as the spline is aligned to the terrain in GE so once road mesh is exported from Blender it will be the same shape as the terrain. PM me with the method you are using and I wil see what is going wrong for you
  13. It may be possible, you could always follow the tutorial you linked and see.
  14. The spline_csv-importer zip does not go into the giants editor scripts folder it is installed in Blender as per the instructions in the tutorial above. The script that should be installed in Giants Editor is the Spline Csv Creator Panel available here https://farmerboysmodding.com/index.php?/topic/2439-new-spline-paint-height-csv-field-creationdimension-panel-scripts/ download the zip, extract the files then add them to C:\Users\Your Computer name\AppData\Local\GIANTS Editor 64bit 9.0.4\scripts
  15. I did mention at the start of this topic that the newer versions of the scripts seem to be a bit slower However, the script appears to freeze when the area to be painted is quite large and in your case this appears to be so with a centre width of 8m and two edge widths of 8m giving an overall 24 m painting area along what looks like a full map width of 2k The script is still working if the Paint button is still Blue (which your image shows), you can also check by left clicking the viewport, the red X on the top right of the panel will appear along with an hour glass in the viewport and disappear when the script has finished (along with the Blue colour on the Paint button). You can speed the process up by setting the Set Texture Distance to 1 which shouldn't have too much effect on the final paint (some edges may appaear a bit more jagged) Edit; 14.26 10/06/23 The GE Paint Terrain By Spline script (Scripts -Terrain--Paint Terrain By Spline ) has a maximum width (single width no edges) of 10m, whereas I have set the width of both Centre and edge Width to a max of 255, perhaps I in a future update I should reduce both down to a maximum of 10m including edges for the script to work the same as the base script.
  16. It would still have been nice to see where you were going wrong and correcting it, if only to help other people who may have the same problem
  17. Then describe in separate steps (1,2 etc) exactly what you are doing.
  18. Just tried the method detailed previously works perfectly.
  19. Starting from the beginning Download the Spline Panels zip and unzip and install into C:/Users/Your Computer Name/AppData/Local/GIANTS Editor 64bit 9.0.4/scripts Download the Blender plugin for SplineCsv data and install into BLender in the normal manner (Tutorial will show operation if unsure) Open GE and create a spline, adjust to the roadway shape you want, then select Scripts --Panel Scripts --Spline CSV Creator Panel with the spline selected Set Csv Distance to 5 and select Create CSV, a splineCSVdata.txt file and a new splineCSV.i3d will be created in a CSVData folder in the same folder as your map.i3d Open Blender 3.2 (or above) Select File Import-- Import Spline data (txt) In the pop up File Browser navigate to where the splineCSV.Data.txt file is located with the file selected, select Import CSV After importing the splineCSV data into Blender, Is there a splineCsv mesh in Blender (bear in mind the spline mesh will be at the world location it is in GE so it is imperative the view setting clipEnd is set to 10000m)
  20. One of the other ways is to use Spline Street Constructor for which it is best to look on youTube for tutorials etc. You say you can't create the road mesh using any of the tutorials, as the road mesh in 2.79 is based on the spline and in later versions uses the spline does this mean you are having problems with creating the spline itstself
  21. Some images would have helped, but it would appear you have a texture problem, ensure that your border texture files (diffuse/spec/normal) are saved as DXT1 dds files
  22. I have updated these scripts to use the new pop up panel format currently in GE 9.0.4. The original scripts will still be available should you prefer to use them as sometimes the operation of these new versions may seem a little slower. Refer to the relevant tutorials on ways of using these new scripts Terrain Height,Paint Terrain and Spline Placement scripts (Tutorials) Create Field Dimensions and Farmlands Tutorial Spline Panels.zip available at the end of this topic Installation, copy paste the Spline Panel folder into the C:/Users/Your Computer Name/AppData/Local/GIANTS Editor 64bit 9.0.4/scripts Folder. Spline Paint Panel This is the updated version of the Spline Paint script and no longer needs a separate Set Up script to create User Attributes or a separate Terrain Layers script to print the terrain Layer no as a reference. The script itself works roughly the same way as the previous version so parts of the tutorial are still relevant regarding operation. Texture’s are now automatically read from the map.i3d and selected by using the relevant drop down arrows, any additional textures created and added to the map.i3d will also be automatically added to the drop down selections. The script only needs to be activated once further execution is done via the Paint Button. To activate the Paint Terrain by Spline pop up, in GE -- Scripts—Spline Paint Panel the following panel will it appear. Measurements can be inputted manually (recommended) or by using the sliders <> next to the relevant boxes. Example image showing texture drop down with DIRT Selected Once you have made your selections ensure the spline is selected (if no spline selected a warning will appear in the console log) and select the Paint button at the bottom. Other splines can be used simply by selecting them adding any new settings and selecting Paint. Random Paint is carried out the same as before, this time by selecting Selected in the drop down then add your settings and select the Paint Button. Individual sides of random paint(left or right) can also be selected by selecting -1 (at the bottom of the drop down list) in the non painting edge texture drop down. Spline Height Panel This updated script no longer requires a separate Set Up script or use User Attributes to work. Activate the Set Terrain Height by Spline pop up in GE by selecting Script—Spline Height Panel this only needs to be done once in each session as the Panel can be used with other splines without further activation, execution of any new settings being carried out by selecting the Set Height button The settings can be set either manually or by using the slider <>. A spline can be selected before or after filling in the various settings, if a spline is not selected a warning will appear in the console log prompting you to select a spline When happy with values and with a spline selected, select the Set Height button at the bottom of the panel to activate the script. There are some restrictions on minimum/maximum values, Set Centre Width – 0 to 255m Set Spline Height -- -50 to 255m (-50 to allow for spline transformations on higher terrain) Set Edge Width -- 0 to 50m Set Edge Height Left/right -- -20 to 20 Set Edge Smooth Left/Right – 1 to 20 Set Distance Between Points – 0.5 to 100 The existing tutorial on Spline Height can still be used for reference. An updated version of the Spline CSV Creator Panels script is available here https://farmerboysmodding.com/index.php?/topic/2471-spline-csv-creator-panel-updated/ This new version creates a spline.obj file from the newly created spline for direct import into Blender without the need to convert from a .csv file This spline.obj will still need converting to a curve in Blender to create roads etc. Spline CSV Creator Panel This updated script again no longer needs a Set Up script to initialise User Attributes to work. It now does not need a map name inputted as the script automatically puts the CSVdata folder created by the script and containing the new spline.i3d and splineCsvData.txt files in the same folder as the map.i3d Activate the CSV Creator pop up by selecting Scripts – Spline CSV Creator Panel in Select a spline, enter the distance required between CSV points and select the Create CSV button. Other splines can also be used by repeating the above ensuring that any new splines have a different name. Used in conjunction with the Blender Plugin for CSV Data Field Creation(Dimension) Scripts These are in a separate folder called Field Creation Scripts and consist of three separate scripts that are needed to perform a complete field creation. Create_FieldDimensions Panel The pop up Create Field Dimensions is activated in GE by selecting Scripts—Field Creation Scripts - Create Field Dimensions Panel No further activation is required as further script execution is now done by the Create Field Dimension button The FieldDimension_SetUp script is no longer required as the Create Field Dimensions Panel script when activated now automatically creates a new transform Group in the scenegraph 'Field_Creation_Transform' with all the required transform groups. Create_Field_Dimension pop up The Main Fields transform to create the fieldDimensions will be the fieldsNew –fields transform group and Markers transform newFieldMarkers – Markers. Field dimensions created for the Paint Farmland Field xml Panel will use the farmlandDimensions –fields transform group and the same Markers TG (once the markers have been reset to suit) Once the markers are created select the relevant fields transform enter the field no and select the Create Field Dimension button to execute the script. Any duplicate field numbers will activate a warning text in the console log. Paint Farmland Field xml Panel This panel is activated in GE by selecting Scripts—Field Creation Scripts – Paint Farmland Field xml Panels Panel. As is the case with the other scripts no further activation is required as all execution is done by the Create Farmlands button Set Path to XML – gives two choices farmlands.xml, if your farmlands.xml is in the same folder as your map.i3d or xml/farmlands.xml if you farmland.xml is in a separate xml folder in your map.i3d folder. These two paths are the most commonly used by map makers if you have the farmlands.xml elsewhere then I suggest moving it temporarily to the map.i3d folder. Set Total Fields – this is adjustable either by manual entry (recommended) or by the slider <> between 1 and 255 the 130 is an arbitrary figure farmlands.xml entries will still only show your actual field numbers. Set Land Price – is the multiplier applied to any land prices adjustable either by manual entry (recommended) or by the slider <> between 0 and 10 Set NPC Area – Allows choosing of an NPC area "ALPINE","US","FR" from the drop down selection can be different for each field if required. Number of Different NPC’s -- This is the number of different NPC’s available in the base scripts a number between 1 and 15 is randomly chosen by the script or can be selected manually for each field ownership created. Number can be increased if map maker has added extra NPC’s. Show on Farmlands Screen – If Yes then the field is shown on the games Farmlands screen, No the field will not be shown, used in cases where the farmland is bought with a placeable i.e. BGA Default Farm Property – Yes assigns that field to the ownership of the default (player) farm, No field is then buyable in the normal manner. Once all the relevant details have been entered select the farmlandDimensions –fields –field01 for example and select the Create Farmlands button. The infoLayer_farmlands.grle will have been painted (can be checked in GE by selecting the Terrain Info Layer Paint Mode together with the Info Layer –farmland and the Lands Farmlands number) and an entry for that field created in the farmlands.xml the field number being obtained from the field name i.e field01 will be Field01 in the farmlands.xml Warnings will appear in the log if a field number already exists in the farmlands.xml Subsequent fields can be created by selecting the next field number in the farmlandDimensions –fields transform and selecting Create Farmlands I have included the Paint Field Ground Foliage script (although not yet updated, WIP) together with its reference image, in this folder to keep all the scripts for Field Creation together. A little tip for speedily resetting the markers to create the new field dimensions for the Paint Farmland Farmlands xml script is to scale the X and Z axis by a factor of 0.1/2 depending on size required, (marker size has no effect on actual position) but bear in mind the scaling will be done with reference to the Markers TG (fieldmapIndicator position) so could appear distorted depending on position Spline Place and Spline Foliage scripts will also be updated to use the new pop up panel system in due course. Further information and guidance can be currently found in the Create Field Dimensions and Farmlands Tutorial, though this will also be updated in due course to reflect the changes. Spline Panels.zip
  23. This plugin is for Blender version 3.0.0 and above. It allows the SplineCSV data created in the Spline CSV Creator script to be directly imported into Blender instead of having to use an earlier version of Blender and exporting/importing as an obj. Installation Download the spline_csv_importer.zip file at the bottom of this topic. Open Blender (3.0.0 and above) Select –Edit—Preferences –Install and in the file browser navigate to where you saved the spline_csv_importer.zip file, Select and Install the Add-on. Once installed Activate it by selecting the check box (a single Left click usually brings up the Activation and Information panel) The Add-on can also be found in the Blender Preferences panel under Import-Export: Spline CSV Importer. To use the spline_csv_importer add on; Select File –Import – Import_Spline Data (*txt) A file Browser Panel will pop up, (an undocumented operator panel appear but this can be ignored it just means I haven’t documented it with Blender), Navigate to where your CSVdata folder has been created in your map root directory, double click to open the folder and select the required spline_Csvdata.txt file and select Import CSV . on the file browser. The spline_CSVdata will have been placed in a separate Collection named SplineCSV , retaining the original name,converted to an edge mesh and placed at the same location the spline in your map was, see image below for reference. All subsequent spline_CSVdata when added will be placed in this new Collection. Note: This Add-on will only create an single edge mesh (no other type of mesh) from a txt file created in the same format as the spline_CSVdata.txt file (i.e. no header), coordinates in the spline_CSVdata.tx have already been converted to the Blender format in the CSV Creator script and can be exported as an i3d or Nurbs curves (spline)directly back into Giants Editor. This new method will be placed in the relevant tutorial (along with a second copy of the spline_csv_importer.zip) https://farmerboysmodding.com/index.php?/topic/2413-export-a-spline-from-giants-editor-into-blender-to-create-roadsrailways-updated/ replacing the old method spline_csv_importer.zip
  24. There is another problem with the 9.0.4 version of Giants Editor that occurs when exporting terrain as an obj file. Previously when exporting you could limit what section of terrain you wanted to export by just using the viewport window a sort of what you see is what you get. Unfortunately wth this current version when you export the terrain you export the WHOLE terrain regardless of the viewport settings./position which can lead to problems with low spec computers.
  25. With thanks to OldIronAddicts for raising a query which resulted in me finding this error. The error is in the current Spline Placement script and it creates an extra rotation on objects placed along the spline. I will update the main scripts in due course but in the meantime here is a quick fix that can be easily carried out Open SplinePLacement lua in giants editor Script Editor insert the following lines at line 180 setTranslation(myId, x, y, z); setRotation(myId, rx, ry, rz); so the section looks like this 177 if placeId then -- place object 178 local myId = clone(getChildAt(objectsToPlace,iObject), false, true) 179 link(placedObjects,myId) 180 setTranslation(myId, x, y, z); 181 setRotation(myId, rx, ry, rz); 190 local mDirX, mDirY, mDirZ = worldDirectionToLocal( mySpline, getSplineDirection (mySpline, splinePos) ); 191 local mVecDx, mVecDy, mVecDz = crossProduct( mDirX, mDirY, mDirZ, 0, 1, 0); scroll down to line 205 205 setRotation(myId, rx, ry, rz); comment it out by putting two minus signs in front of it 205 --setRotation(myId, rx, ry, rz); it will turn green when deactivated. Save the script