News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Adding item to in-game settings (menuconf.tab) menu

Started by Sarlock, October 02, 2012, 06:05:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sarlock

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.
Current projects: Pak128 Trees, blender graphics

Combuijs

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.
Bob Marley: No woman, no cry

Programmer: No user, no bugs



Sarlock

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.

Current projects: Pak128 Trees, blender graphics

Combuijs

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.
Bob Marley: No woman, no cry

Programmer: No user, no bugs



Sarlock

It will depend on whether this parameter only affects new forests or whether it affects existing ones as well.
Current projects: Pak128 Trees, blender graphics

An_dz


prissi

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.

Sarlock

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 :)
Current projects: Pak128 Trees, blender graphics

Sarlock

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)
Current projects: Pak128 Trees, blender graphics

Dwachs

Parsley, sage, rosemary, and maggikraut.

prissi

How did you added another tree? The forest will not change their number. You would have to draw then again.

Sarlock

#11
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.
Current projects: Pak128 Trees, blender graphics

Sarlock

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 :)
Current projects: Pak128 Trees, blender graphics

TurfIt


Sarlock

Current projects: Pak128 Trees, blender graphics