The International Simutrans Forum

 

Author Topic: Adding item to in-game settings (menuconf.tab) menu  (Read 3096 times)

0 Members and 1 Guest are viewing this topic.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Adding item to in-game settings (menuconf.tab) menu
« 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.

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1392
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #1 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.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #2 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.


Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1392
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #3 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.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #4 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.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2893
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #5 on: October 02, 2012, 09:08:35 PM »
Quite sure only new ones.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9514
  • Languages: De,EN,JP
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #6 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.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #7 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 :)

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #8 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)

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4587
  • Languages: EN, DE, AT
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #9 on: October 06, 2012, 08:19:54 AM »
You could have waited for r5965 to be out :)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9514
  • Languages: De,EN,JP
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #10 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.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #11 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.
« Last Edit: October 06, 2012, 11:12:47 PM by Sarlock »

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #12 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 :)

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1325
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #13 on: October 07, 2012, 03:36:27 AM »
Try again with r5968.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Adding item to in-game settings (menuconf.tab) menu
« Reply #14 on: October 07, 2012, 05:10:26 AM »
Thanks :)