The point is that I don't know from where to start. I've programming skills but I wouldn't like to do something very complicate, mainly because I don't have time enough.
For that article, I was thinking on something easy like increase the max number of wagons a convoy can transport (as far as I know, you only have to change one line of code) or perhaps search in the forum archive for a reasonable, and easy-to-implement, extension request. Things like those, you know. I would like to show to people that Simutrans code is not as hard to hack as it seems.... ::)
Regardless which project, the first attempt is hard because you do not know where is what. I would say it's sink or swim - try and see if you can find any place where to begin.
As to depot, maybe you could start from files that have depot in name and look at the include headers and cl****es and so on. That's what I would do. Alternatively you could search for the number you know is maximum...
Well, In this case I think I know where I must do the hack (prissi's comment from the
old forum >>
Extension Request >>
Only 24 Wagons per train?) but thanks for the advices.
I've tried to increase the max. number of wagons per convoy, modifying
simudepot.h - line 245 , but seems it does not work. I mean, the game allows you to buy that amount of wagons, let's say 26, but the depot window shows 24 as maximun.
I've changed this (line 245):
unsigned get_max_convoi_length() const { return convoi_t::max_rail_vehicle;]
by this:
unsigned get_max_convoi_length() const { return 26;}
Indeed, when the convoy starts running, it has got not more than 24 wagons (1+23). The strange thing is that If put a lower limit, let's say 10, there's no problem. I can't buy a convoy with more than 10 wagons and when the convoy is out of the depot, it has 10 wagons max. I guess there's some kind of constraint somewhere in the code that do not allow to show such an amount of wagons. Any idea?
P.S: you can read the blog's article about it
here (http://simutrans-escala-real.blogspot.com/2008/10/zambullndose-en-simutrans-iv-una-pequea.html)
So, you would like to make a sort of tutorial, wouldn't you? Perhaps another easy one could be putting colors of players to line names in public stations, so that one can know to which player they belong. Another one: to show numbers (in schedule order) in line preview in the map...
I would follow up asking Window's search dog to find *.cc or *.h files with
max_rail_vehicle. Grep gives me these two lines in
simconvoi.cc:
fahr.resize(max_rail_vehicle, NULL);
fahr.resize(max_rail_vehicle, NULL);These lines don't use the getter method and access the variable directly. Moreover, it appears this line in
simconvoi.h:
enum { max_vehicle=4, max_rail_vehicle = 24 };Perhaps it is a better idea then to change that 24 for 26. You can first revert files with svn to the version stored in the repository:
svn revert simudepot.h
Good ones, I'll include them in the future article's list
Ahh! was that... I suspected that
max_rail_vehicle has a fixed value specified in somewhere. That's why it lets you buy more wagons than the limit but it does not show them when the convoi is out of the window. Thanks again for the explanation, Isidore. I'll correct the article.
Just so that you know - it's a GUI for a reason. Right click max_rail_vehicle, select Go To Definition and see for yourself ;)
I was using gvim, which is not really the best programming IDE, as MsVC or others. It's just a good text editor with some extra features..... ::)
Ok. I thought you used msvc since you started posting here so enthusiastically.
Well, In fact I use both in windows, but I usually program in Linux. Anyway, the point is that I didn't know from where was the program taking that value, because in that file (simudepot.h) max_rail_vehicle is also defined as a constant with zero value.
It works.... ;D
(http://2.bp.blogspot.com/_dgV8cATuuJA/SQICCDmFfbI/AAAAAAAAA10/i4g7EU0U7ik/s800/30_wag_2.jpg)
(http://lh3.ggpht.com/XdXavier/SQIBUL4sFlI/AAAAAAAAA1s/XZY7G6ydzqI/s400/30wag_pre.jpg)
Great, now you could add a scrollbar and set it to 1024. And display little numbers under consists so that you don't get lost in your depot ;D
A newly recruited developer!! You have no scape now, Vilvoh! ;D ;D ;D
Oh nooo!!.....(http://www.greensmilies.com/smile/smiley_emoticons_dinosaurier02.gif)
Listen to the call of the Ring, Vilvooooh...
:) :) :D
WOW! Seems Prissi will have a new trainee in devteam.
(sorry, I couldn't resist ::) )
I didn't noticed this feature implemented in any release. Is any chance it will be included?
It is already part of Simutrans-Experimental: see here (http://forum.simutrans.com/index.php?topic=1894.0) on how to get it.