The International Simutrans Forum

Development => Extension Requests => Topic started by: Sarlock on October 02, 2012, 06:05:38 AM

Title: Adding item to in-game settings (menuconf.tab) menu
Post by: Sarlock on October 02, 2012, 06:05:38 AM
I am hoping this is a very easy change to do:

I was hoping to be able to add "max_no_of_trees_on_square = x" to the in-game config menu editor (( the one that opens with dialog_tool[27] )) under the landscape section.  You can edit it beforehand for a new game but not once a game is running.

I have an existing game that I've been playing for a month now that I am putting on display in the "stories" forum section and I'd love to be able to increase the maximum number of trees per tile from 3 to 4 or 5.

If this isn't an easy thing to do then don't worry about it :)  I'd do it myself but I haven't coded "C" in 20 years.  Hopefully this is just as simple as adding a field to manipulate that parameter to that section of the menu.

You all do awesome work here, I am very impressed with the team.
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Combuijs on October 02, 2012, 08:30:36 AM
Not sure I understand your question right, but the

max_no_of_trees_on_square

is settable in the settings dialog (under landscape settings tab). Wether it will work in your current game is always a surprise. Some settings do and some settings don't.
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Sarlock on October 02, 2012, 06:29:24 PM
It's in the new game settings menu but not in the settings menu once the game is running.

It shouldn't affect anything in an existing game, it would only affect new forests being made (I think).  You would have to go over existing forests and draw a forest over top to add the additional tree(s).

Whether this would break a game if you went backward from 3 to 2, I don't know.  Not sure if this only affects the forest drawing tools or has a larger impact.

(http://www.elvenorder.com/sar/images/simutrans/settings.png)
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Combuijs on October 02, 2012, 06:40:07 PM
Thanks for that explanation! I have never noticed the difference before  :-[ . Stupid,, I know...

I indeed hope that this can be changed, but there might be reasons why it can't, for instance when you go from 5 to 3 trees per tile.
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Sarlock on October 02, 2012, 06:44:33 PM
It will depend on whether this parameter only affects new forests or whether it affects existing ones as well.
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: An_dz on October 02, 2012, 09:08:35 PM
Quite sure only new ones.
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: prissi on October 02, 2012, 10:35:51 PM
It affects only new forests. Thus those paintes, and during map extension. However I fail to see how diffirent forests could be useful. Rather after start newones should stay the same, to look alike.
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Sarlock on October 02, 2012, 11:42:13 PM
It's only because the game I've been playing for over a month was set at 3 trees per square and I'd like to increase it for appearances but I cannot alter the variable in the settings tab.  If it takes more than 5-10 minutes to fix, don't worry about it :)
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Sarlock on October 06, 2012, 04:17:22 AM
I figured out how to do this on my own... I saved the game as an .XML file (660MB!) and then through trial and error on a small game found where the "max_no_of_trees_on_square" was located and changed the 3 to a 4.  Reloaded the game and voila, I was able to add an additional tree to all of my existing forests (that had 3 trees/tile).

The tricky part was finding an editor capable of handling a 660MB text file, but I used Vim and it seemed to be able to handle it fairly well.

8)
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Dwachs on October 06, 2012, 08:19:54 AM
You could have waited for r5965 to be out :)
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: prissi on October 06, 2012, 08:06:48 PM
How did you added another tree? The forest will not change their number. You would have to draw then again.
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Sarlock on October 06, 2012, 10:54:10 PM
I used the forest tool and laid it over top of the existing forest and it added +1 tree to each tile.  Worked perfectly :)

And thanks Dwachs, it'll still be useful... when I want to lay down a sparse forest of just 1 tree/tile I can lower the setting, lay that type of forest, then raise it back up to the regular number again.
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Sarlock on October 07, 2012, 03:12:19 AM
Just ran the nightly, thanks for adding that item to the menu... unfortunately it seems that when I try to change it, it just defaults back to the original value again.  (Open settings window, change value, close window, re-open and it's back to the same value as before)  Thanks :)
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: TurfIt on October 07, 2012, 03:36:27 AM
Try again with r5968.
Title: Re: Adding item to in-game settings (menuconf.tab) menu
Post by: Sarlock on October 07, 2012, 05:10:26 AM
Thanks :)