WrinkleysRule Posted January 2 Posted January 2 Paint Foliage by Spline Panel This script is slightly different to the previous version in that it only paints in one area whereas the previous script painted in two independent area’s, this has been done to increase the stability of the script and also improve the Random Foliage Paint option. The script now automatically reads the map.i3d to list in the UI drop downs, all the Foliage Type’s associated with your map so there is no longer any need to add any extra foliage/crop to the script. However the Foliage State for each Foliage Type still requires a number value (position in the Layer State dropdown in GE) To assist with this the script now reads all the Foliage States of each Foliage Type directly from the maps foliage folder xml’s and prints result to the console log and to a foliage_States.txt file in the same folder as the map.i3d for easy reference, the image below shows the extracts from console log print out and the foliage_States.txt file . The foliage states listed here are from a test map based on the US map so yours may differ depending on your map set up. The script allows for a max no of Foliage/Crop Types = 100 and max no of individual Foliage States = 20 To undo any of the Foliage Layers, Set Foliage State to '0' and ensure Random Foliage Paint is deselected then Select Paint Foliage The script ignores any entry in the Set Foliage State if Random Foliage Paint is selected Unzip the Paint Foliage by Spline.zip (found at the end of the tutorial) and place the script in:- C:/Users/Your Computer Name/AppData/Local/GIANTS Editor 64bit 9.0.6/scripts The script requires the Farming Simulator 2022 installation path , it is set at a default of “C:/Program Files (x86)/Farming Simulator 2022” If your installation path is different then, Open Giants Editor, Select -- Window --Script Editor and navigate to where you have placed the new script and select it. Once opened, in the editor go to line 30 local gInst = “C:/Program Files (x86)/Farming Simulator 2022” and replace the entry (after the 😃 with your installation path including quotes Once done save the script, the Script Editor window can now be closed as the script is now ready to be used. Paint Foliage Open the script in GE Select -Scripts –Paint Foliage by Spline Panel a popup panel will appear on the screen Set Overall Width Width of area to be painted Set Offset Paint Distance Distance either side and away from the spline to be painted e.g A setting of 10 will paint foliage 10m to the left of the spline at the width set Set Foliage Type Select Foliage Type from the dropdown Set Foliage State This number when entered refers to the Foliage State 0,1,2 etc of the selected Foliage, refer to the Foliage State print out in the console log or to the foliage_States.txt file in the map.i3d folder for the associated numbers and foliage state types. Set Second Foliage State This number refers to the second Foliage State value used by the Variable Foliage State option and is only relevant if Variable Foliage State and Random Foliage Paint options are selected Variable Foliage State When selected along with Random Foliage Paint option allows only parts of the Foliage Types States to be randomly painted, see further description below Random Foliage Paint When selected allows random painting of all the foliage States for the selected Foliage along and around the spline To delete foliage after using, Random Foliage Paint must be deselected and ‘0’ entered in the Set Foliage State box Random Foliage Distance When selected paints the selected foliage at a random distance along the Spline, width of paint is controlled by the Overall Width setting Set Distance Between Foliage Paints the foliage at the distance set along the spline, width of paint is controlled by the Overall Width setting. Variable Foliage State Option This option allows the choice of which section of the Foliage Type States are to be randomly painted along/around the spline. It is only used in conjunction with the Random Foliage Paint. For example with Variable Foliage State and Random Foliage Paint selected and the other inputs set as follows Set Overall Width - 10 Set Foliage Type – groundFoliage, Set Foliage State – 7, Set Second Foliage State – 14 It will only randomly paint foliage states 7 (cover foliage) to 14 (stinging nettles) in a path 10m long along/around the spline. To delete foliage, Random Foliage Paint must be deselected and ‘0’ entered in Set Foliage State panel. If any of the random options have been used then there will be some bits of foliage left (due to the random paint). This can easily be deleted by selecting the relevant foliage layer in the Foliage Layer Painting panel in GE and using the subtract brush. When painting foliage using the same densityMap.gdm any existing foliage it will be erased by the new foliage. Normally the ground foliage ,stone and weed use separate density maps all other foliage use the densityMap_fruits.gdm. The following images show the script in basic operations Note: The over painting at either end of the spline is due to the Random Foliage Paint which will paint the selected foliage, foliage states at random along and around the spline This can easily be deleted by selecting the relevant foliage layer in the Foliage Layer Painting panel in GE and using the subtract brush. Bear in mind the wider and longer the painting the longer the script will take to work, the Paint Foliage button will turn blue when activated, when it turns white the script has finished. As always play around with the script on a blank map to see what effects you can obtain before using on a WIP map. The next image shows a short road/lane section created using the Spline Paint Panel and the Paint Foliage by Spline Panel scripts. Paint Foliage by Spline Panel.zip 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now