Coder Social home page Coder Social logo

tree_controller_bepinex's Introduction

Tree Controller

Deprecated. No Longer supported please see https://github.com/yenyang/Tree_Controller.

Tools and systems for changing ages, types, colors, growth and seasonal behaviors for trees and wild bushes.

Improvements to plopping and brushing trees and wild bushes including: age choices (Plop fully grown trees), random rotation, and forest brushes.

Video Demo available on YouTube

Dependencies

Unified Icon Library

BepInExPack

Change Log

Available on Github

Donations

If you want to say thank you with a donation you can do so on Buy Me A Coffee.

Translations

I am looking for volunteers to help translate the mod into the official languages. For those interested please go to CrowdIn. Sorry the link says water features, I accidently uploaded the wrong file to one of the projects so the URLs are swapped. Current Localization Support: Spanish by Nyoko, German by Hendrix, Italian by Mazi, Brazilian Portuguese by Luiz Fernando de Paula, Partial Chinese Simplified by RilkeXS.

Detailed Description:

Includes a tree controller tool that lets you change the age or types of existing trees and/or bushes on the following selections:

  • Single Tree
  • Whole Building or Net
  • Radius
  • Whole Map

Please note that changing types of trees for networks is not persistant and revert as soon as anything touches the network. You cannot change types of trees using 'Single Tree' nor 'Whole Building or Net'. Eventually I may remove the ability to alter types of trees with 'Radius' and 'Whole Map'.

For plopping trees and wild bushes this mod adds choice of age(s) and the option to enable random rotation.

For brushing vegetation this mod adds choice of age(s) for trees and wild bushes and sets of vegetation for forest brushes. Some pre-made sets are:

  • Deciduous (Exluding Apple and Poplar)
  • Evergreen (Pine and Spruce)
  • Wild bushes

Custom sets

Hold Ctrl to select or unselect multiple types of trees using the toolbar menu. Then hold Ctrl and click the custom set button to save a custom set. Once a set has been saved, click the custom set button to select that set. Hold Ctrl while switching themes to maintain the custom set.

Tree Growth

Includes the option to disable tree growth over the whole map but it excludes any trees within specialized lumber industry areas.

To set all trees to Adult and/or Elderly, Select: Landscaping -> Vegetation -> Change Age Tool -> Whole Map -> Select Age(s) -> Right click on the map.

This mod doesn't automatically set street trees or trees in buildings to a specified age, but you can change them with the tool. This feature may be included later.

Seasonal Effects

Includes the option to make deciduous trees use dead model during winter. The dead model is not scaled based on the actual age of the tree. Deciduous tree growth is paused during winter. Specialized lumber industry areas are excluded from this feature.

Please note, you must either disable this option or press the 'Safely Remove Button' to remove the mod safely during winter. During any other season the mod can be readily removed. If you do not enable this option the mod can be readily removed.

Includes the option to use and create custom seasonal foliage colors. You can assign RGB values in CSV files that will be created in a folder the first time you run the mod. The folder is located at %AppData%...\LocalLow\Colossal Order\Cities Skylines II\ModsData\Mods_Yenyang_Tree_Controller\FoliageColorData\ . Don't bother altering with the Alpha value at this time. Cultivated city bushes are not included in seasonal foliage colors, but I am interested in modding this aspect.

Collaboration

Algernon and I have collaborated to allow for age selection using Line Tool Lite.

Support

I will respond on the code modding channels on Cities: Skylines Modding Discord.

Credits

  • yenyang - Mod Author
  • Chameleon TBN - Testing, Feedback, Icons, and Logo
  • Algernon - Help with UI, Cooperative Development and Code Sharing, Collaboration regarding line tool.
  • T.D.W., Klyte45, krzychu124, and Quboid - Cooperative Development and Code Sharing
  • Localization: Hendrix (German), Nyoko (Spanish), Mazi (Italian), Luiz Fernando de Paula (Brazilian Portuguese), RilkeXS (Chinese Simplified)
  • Tigon Ologdring, code:witch - Testing, Feedback

tree_controller_bepinex's People

Contributors

yenyang avatar

Stargazers

Saksham Khurana avatar  avatar Denilson Silva avatar  avatar

Watchers

 avatar

tree_controller_bepinex's Issues

Suggestion: random rotation for cultivated plants and props, brush presets

It would be really nice to have random rotation for all of the cultivated plants just like the wild plants and trees. It would also come in really handy for props but especially for boulders and rocks.

Another nice thing would be if we could make a custom mixed brush to make our own mix of plants and trees.

Anyways I don't know if any of this is possible but just thought I'd throw it out there.

Error Code

Hi,

When trying to use Tree Controller 1.1.0, I get the following error message:

[ERROR] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.Application' threw an exception. ---> System.Globalization.CultureNotFoundException: Culture ID 1034 (0x040A) is not a supported culture.
Parameter name: culture
at System.Globalization.CultureInfo..ctor (System.Int32 culture, System.Boolean useUserOverride, System.Boolean read_only) [0x0007d] in :0
at System.Globalization.CultureInfo.GetCultureInfo (System.Int32 culture) [0x0003e] in :0
at System.Windows.Forms.InputLanguage.get_InstalledInputLanguages () [0x00040] in <8ce253beec59426e9ec61d65e4cb0f6d>:0
at System.Windows.Forms.InputLanguage.FromCulture (System.Globalization.CultureInfo culture) [0x00000] in <8ce253beec59426e9ec61d65e4cb0f6d>:0
at System.Windows.Forms.InputLanguage.get_CurrentInputLanguage () [0x0000c] in <8ce253beec59426e9ec61d65e4cb0f6d>:0
at System.Windows.Forms.Application..cctor () [0x00000] in <8ce253beec59426e9ec61d65e4cb0f6d>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.XplatUI..cctor () [0x000ee] in <8ce253beec59426e9ec61d65e4cb0f6d>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
at System.Windows.Forms.XplatUI+State.get_ModifierKeys () [0x00000] in <8ce253beec59426e9ec61d65e4cb0f6d>:0
at System.Windows.Forms.Control.get_ModifierKeys () [0x00000] in <8ce253beec59426e9ec61d65e4cb0f6d>:0
at Tree_Controller.Tools.TreeControllerUISystem.OnPrefabChanged (Game.Prefabs.PrefabBase prefab) [0x0025f] in <7ee210e6b85c4f148392ea97cb2a3078>:0
at (wrapper delegate-invoke) System.Action`1[Game.Prefabs.PrefabBase].invoke_void_T(Game.Prefabs.PrefabBase)
at Tree_Controller.Tools.TreeControllerTool.SelectTreePrefab (Game.Prefabs.PrefabBase prefab) [0x000cd] in <7ee210e6b85c4f148392ea97cb2a3078>:0
at Tree_Controller.Tools.TreeControllerUISystem.ChangePrefabSet (System.String prefabSetID) [0x0021d] in <7ee210e6b85c4f148392ea97cb2a3078>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in :0
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in :0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0
at cohtml.Net.Invoker.ExecuteAndSendResult (cohtml.Net.Binder binder, System.Delegate callback, System.Object[] arguments, System.Boolean execute) [0x00027] in <34a70e0068754567b86b66a15ff313c5>:0
Colossal.Logging.CustomLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:LogFormat(LogType, String, Object[])
Colossal.Logging.UnityLogger:Log(Level, String, Exception)
Colossal.Logging.UnityLogger:Error(Object)
Colossal.UI.LogHandler:WriteLog(Severity, String, UInt32)
cohtml.Net.ILogHandler:SwigDirectorWriteLog(Int32, String, UInt32)
cohtml.Net.cohtmlNativePINVOKE:ILogHandler_WriteLog(HandleRef, Int32, String, UInt32)
cohtml.Net.ILogHandler:WriteLog(Severity, String, UInt32)
cohtml.Net.Binder:LogException(Exception)
cohtml.Net.Invoker:ExecuteAndSendResult(Binder, Delegate, Object[], Boolean)
cohtml.Net.Invoker:Invoke(Int32)
cohtml.Net.cohtmlNativePINVOKE:View_MouseEvent(HandleRef, HandleRef)
cohtml.Net.View:MouseEvent(IMouseEventData)
Colossal.UI.UIInputSystem:DispatchInputEvents(UIView, Boolean, InputEventType)
Colossal.UI.UIInputSystem:DispatchInputEvents()
Game.SceneFlow.GameManager:Update()

Tree Controller 1.0.0 works without problem. I suspect that the problem is related to the fact that I am running Cities Skylines 2 on Linux (Debian Bookworm) via Proton, but that is just a guess. I have also attached the error window from the game.
20240212141035_1

Thanks in advance for your help.

Error, not sure if this is because of tree controller but it is mentioned in the log

This happened when clicking on the log prop in the devmode home menu. It mentions tree controller in the bepinex log:

[Error : Unity Log] [UI] [ERROR] Error in trigger binding callback 'editorPanel.setItemSelected' 'editorPanel' 'setItemSelected' System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary2[TKey,TValue].FindEntry (TKey key) [0x00008] in <b89873cb176e44a995a4781c7487d410>:0 at System.Collections.Generic.Dictionary2[TKey,TValue].get_Item (TKey key) [0x00000] in :0
at Game.Prefabs.PrefabSystem.GetEntity (Game.Prefabs.PrefabBase prefab) [0x00000] in <1612d666569f4a8aaf5062d9fcaab733>:0
at Tree_Controller.Tools.TreeControllerUISystem.OnToolChanged (Game.Tools.ToolBaseSystem tool) [0x0016d] in <72492fb10be248919c320f9d8629971a>:0
at (wrapper delegate-invoke) System.Action1[Game.Tools.ToolBaseSystem].invoke_void_T(Game.Tools.ToolBaseSystem) at Game.Tools.ToolSystem.set_activeTool (Game.Tools.ToolBaseSystem value) [0x00020] in <1612d666569f4a8aaf5062d9fcaab733>:0 at Game.Tools.ToolSystem.ActivatePrefabTool (Game.Prefabs.PrefabBase prefab) [0x00028] in <1612d666569f4a8aaf5062d9fcaab733>:0 at Game.UI.Editor.PrefabToolPanelSystem.OnPrefabSelected (Game.Prefabs.PrefabBase prefab) [0x00011] in <1612d666569f4a8aaf5062d9fcaab733>:0 at Game.UI.Editor.PrefabPickerAdapter.Game.UI.Editor.ItemPicker<Game.UI.Editor.PrefabItem>.IAdapter.set_selectedItem (Game.UI.Editor.PrefabItem value) [0x00023] in <1612d666569f4a8aaf5062d9fcaab733>:0 at Game.UI.Editor.ItemPicker1[T].set_selectedIndex (System.Int32 value) [0x00020] in <1612d666569f4a8aaf5062d9fcaab733>:0
at Game.UI.Editor.IItemPicker+Bindings+<>c__DisplayClass0_0.b__1 (Game.UI.Widgets.IWidget widget, System.Int32 index) [0x0000a] in <1612d666569f4a8aaf5062d9fcaab733>:0
at Colossal.UI.Binding.TriggerBinding`2[T1,T2].Callback () [0x00026] in <23b4c88d5e2d4cef98ab4023bceff82d>:0
[Info : Unity Log] Game terminated due to timeout

Mod seems to break the abililty to remove trees with the tree brush

I noticed that the vanilla game's tree tools allow you to remove trees en-masse using the tree brush: https://youtu.be/LaSriZ6MKZM?si=Zp8usODPHUOzRegd&t=1518
steps to reproduce in vanilla:

  1. Landscaping menu
  2. Vegetation tab
  3. Set tool mode to select multiple
  4. Set the theme to the desired theme
  5. Set brush strength to 100% and size to anything (the higher, the better)
  6. Deselect Remove only matching type as the Snapping option.
  7. Click and drag the mouse over trees; you will see they are removed (see the YT video above).

I tried this with the Tree Controller mod installed, but it just placed the trees I selected instead. Steps to reproduce:

  1. Landscaping menu
  2. Vegetation tab
  3. Set the tool mode to select multiple
  4. Set the theme to the desired theme
  5. Set brush strength to 100% and size to anything (the higher, the better)
  6. Deselect Remove only matching type as the Snapping option. (note: the * snapping option is not available
  7. Click and drag the mouse over trees; you will see they are ADDED (see the attached video).
    https://github.com/yenyang/Tree_Controller_BepInEx/assets/4601813/0a440b93-10b9-4e82-85f0-41f5f567e39a

Is this a bug, or am I selecting the wrong settings to delete trees using this tool?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.