This is a PowerShell script I created to generate vegetation resize presets for my tree mod, see "Short Trees and improved Density" (https://flightsim.to/file/62961/shorter-trees-and-improved-density).
If you wish to experiment with different tree heights and densities for either my mod (Package Name : yankeemike-world-shortertrees) or any other mod that has a "vegetation" folder, this script is for you !
Installation :
- Open the .zip and drag the TreeResizer folder to the folder of your choice (no need to put it in the Community Folder)
How to run the script ?
- Open Powershell console in Admin mode
- At Powershell invite :
- Enable unsigned scripts with "Set-ExecutionPolicy ByPass" => Select "Y" in the menu offered to only enable unsigned scripts for this Powershell session
- Change to the script directory "cd DRIVELETTER:\Path\To\TreeResizerFolder"
- Call the script with ".\TreeResizer.ps1 -Help" to get started or read below !
Script's help :
/*
.SYNOPSIS
Resizes MicroSoft Flight Simulator vegetation.
.DESCRIPTION
Allows mainly for the resizing of tree Heights and vegetation Density.
Main Parameter
-Scale : Percent, which size to scale the tree height (default=100)
Optional Vegetation Parameters
-Density : Percent, which size to scale the vegetation density (default=100)
-CityDensity : Percent, which size to scale the vegetation density in cities (default=100)
-SnapToGround : Try to prevent trees and bushes from slightly floating above ground
Other Optional Parameters
-Silent : Run unattended (assumes answer YES to all questions)
-CommunityFolder : Specify a custom Community Folder if the script cannot detect the correct one
-PackageName : Specify a custom Package Name if you want the script to update vegetation
for another package than default value 'yankeemike-world-shortertrees'
-ModelFolder : Specify a custom Model Folder if you want the script to create presets
from a vegetation folder other than 'vegetation.DEFAULTS'
Note: 'vegetation.DEFAULTS' is automatically created on first run
within the package folder
-NoBackup : Don't create a backup of the current vegetation folder before applying new preset
-BackupKeep : If performing backup operation, how many backups to keep in rotation (default=5)
Hidden (in plain sight) Parameters, use at your own risk !
-MaxLimit : When tree max height is at or above, shred tree (default=10)
-MinLimit : When shredding, if minimum tree size falls below this limit,
regrow tree to this min size (default=8)
Note: if the new minimum tree size ends up being higher than the new max height,
then max height will become min tree size + MaxLimit-MinLimit
.EXAMPLE
PS> .\TreeResizer.ps1 -Scale 50 -Silent
- Resize tree height to 50% (vegetation density and vegetation density in cities will remain at 100%)
- Don't ask for user confirmations
.EXAMPLE
PS> .\TreeResizer.ps1 -Scale 60 -Density 200 -CityDensity 25 -SnapToGround -NoBackup
- Resize tree height to 60%, vegetation density to 200%, vegetation density in cities to 25%
- Try to snap the vegetation to the ground
- Don't create a backup before updating the 'vegetation' folder
.EXAMPLE
PS> .\TreeResizer.ps1 -Scale 66 -CommunityFolder "D:\MSFS\Community" -PackageName "mytreemod" -ModelFolder "vegetation"
- Using custom Community Folder "D:\MSFS\Community"
- In Package "mytreemod"
- With "vegetation" as Model Folder (instead of default 'vegetation.DEFAULTS')
- Resize tree height to 66%
*/
Note: Can also be used to enable potat-mode by setting tree density = 0
I like to fly over cities very low and always struggled with the asthethics of the default MSFS2020 setting of "overtree'd" cities.
After some tinkering i found my perfect balance for city flying 😊
-Scale: 15%
-Density: 35%
-City Density: 0% (might be currently without function (awaiting response of mod creator))
All i want more from this is a graphical interface with sliders so save myself the typing - other than that it does it's job very well!
1 months ago
1 months ago
YankeeMike01
DaniBot
Tested above Halle (south-west-ish of Oppin airport)
1 months ago
DaniBot
2. Error: "PS is not recognized"
Someone pls enlighten me as i am not very experienced in this. I mostly do trial and error and stare into stackexchange threads with empty eyes.. plzzzz!!! 😀
#I enter:
PS D:\GAMES\MS_Flightsimulator_Packages\TreeResizer> PS> .\TreeResizer.ps1 -Scale 35 -Density 100 CityDensity 10 -SnapToGround
#It returns:
PS> : The term 'PS>' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ PS> .\TreeResizer.ps1 -Scale 35 -Density 100 CityDensity 10 -SnapToGr ...
+ ~~~
+ CategoryInfo : ObjectNotFound: (PS>😣tring) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
1 months ago
1 months ago
YankeeMike01
DaniBot
4 months ago
4 months ago
YankeeMike01
skandalsky
6 months ago
6 months ago
YankeeMike01
Socorrista22198
Thanks!
6 months ago
6 months ago
YankeeMike01
Socorrista22198
6 months ago
6 months ago
YankeeMike01
Hans1593