Page 2 of 3

Posted: 25 Aug 2005 09:16
by mtlife
i think A LOT of ppl want to use this :) (or am i the only one too lazy to replace 100 trains?)

Posted: 11 Sep 2005 12:33
by MadFrog
Great Patch! I was finally able to get OTTD compiled and add this patch :)
Has anyone made latest nightly compatible of it?

edit: fixed a small bug, trains wouldnt leave depot after track conversion for some reason... Don't know if I messed up with applying the patch first time , but at least now it's working ok with 0.4.0.1 :wink:

Posted: 12 Sep 2005 00:25
by MadFrog
Could someone post some info on using diff (creating .diff patches)?

And are there newer patches tackling the issue of transition from rail to monorail to maglev? I'm interested in making a patch to convert easily all tracks & trains, quite like the one they've made for TTDPatch.

To all the developers of OTTD, I'd like to say big thanks, this is one of my all time favourite games :D

Posted: 12 Sep 2005 06:30
by MadFrog
Ok, got TortoiseSVN up and running. Lets get to work :)

Posted: 13 Sep 2005 12:12
by mtlife
nice 1, cant wait

Posted: 13 Sep 2005 14:00
by Psycho Dude
mtlife wrote:i think A LOT of ppl want to use this :) (or am i the only one too lazy to replace 100 trains?)
100 is still "doable", but indeed, it aint a bad thing to have something like this lol :P. A great thanks for this patch, makes life so much easier :).

Posted: 20 Sep 2005 12:24
by MadFrog
Here's the .diff for (almost) latest nightly. Seems to work ok, at least for me :)

Posted: 20 Sep 2005 16:33
by MeusH
Any chances uploading it to SF or directly to the trunk (with peter's or other kind developer's help)?

Posted: 20 Sep 2005 17:25
by MadFrog
Sure, allthough I dunno if everyone's allowed to upload their changes to trunk. Or how it's done... :lol:

Posted: 21 Sep 2005 07:43
by bobingabout
well, more than likely, you've have to write a patch, then submit it, and maybe if you are lucky, it will get intergrated into the trunk.

Posted: 21 Sep 2005 20:02
by MadFrog
There's at least one bug, so I'll try and fix it first:

I noticed that when all the trains have been replaced, you can't clone them. Game thinks they're still trains, I guess, and so they can't be built in mono/maglev depots :lol:

Posted: 22 Sep 2005 09:05
by MeusH
Is there any "make dirty" function for vehicles? I know there is one for tiles, the one for vehicles could be useful :roll:
Also check if all track-depending values of all wagons have been changed.

Posted: 23 Sep 2005 06:20
by MadFrog
I don't know about dirty-function. I was planning to check all values for wagons and trains, but I've had a lot of stuff going on at work, so haven't had time :( ...

Do you know has anyone done the 'all trains to depot'-button or anything like it? I thought I'd try to make a one button solution to converting to other track types. It could order all trains to depots, change them and convert track... Or just convert trains whereever they are :lol:

Posted: 28 Feb 2006 08:54
by MadFrog
Can someone please make this patch work with the latest nightly? Or give a hint how to make it work? I've tried to fix it, but there seems to be something that prevents it from working. Maybe the game has just changed too much. I've tried changing CmdReplaceVehicle in player.c, so that it doesn't check for engine types etc. but it just doesn't work :(

I just can't play OTTD without autoreplacing my trains to monorail/maglev ;)

Posted: 28 Feb 2006 18:26
by Bjarni
MadFrog wrote:Can someone please make this patch work with the latest nightly? Or give a hint how to make it work? I've tried to fix it, but there seems to be something that prevents it from working. Maybe the game has just changed too much. I've tried changing CmdReplaceVehicle in player.c, so that it doesn't check for engine types etc. but it just doesn't work :(
MaybeReplaceVehicle() and ReplaceVehicle() have been completely redesigned to solve some major issues, so a patch like this one will need some work to apply. Also another reason why you fail is that this patch exploited a bug in the build command and needless to say we fixed that bug. We decided long ago that this patch is not the solution to this problem.
MadFrog wrote:I just can't play OTTD without autoreplacing my trains to monorail/maglev ;)
tough luck. Try to find a solution that will work without exploiting bugs

Posted: 28 Feb 2006 18:36
by MadFrog
Yeah, I was just hoping for a quick and dirty hack solution to do this while there is no other patch yet. Of course with a little effort one could probably come up with a good way of doing the replacement...

Posted: 28 Feb 2006 18:48
by Bjarni
MadFrog wrote:Yeah, I was just hoping for a quick and dirty hack solution to do this while there is no other patch yet. Of course with a little effort one could probably come up with a good way of doing the replacement...
we don't use dirty hacks. It will be easier to actually make a real solution for this and get it added to the trunk so it just works in the future.

Posted: 28 Feb 2006 18:53
by MadFrog
I know that would be the right way to do it. I was just looking for a quick solution for my self. And tinkering with this patch is a good way for me to get to know how the game works :lol:

So Im not trying to get this patch into trunk as we've discussed before. Obviously, it'd have to be done right, if it's to be added to game permanently.

Posted: 28 Feb 2006 19:07
by Born Acorn
I think the easiest (not the easiest, but the simplest logically) way to do it would be "multistop" style train depots, so two depots next to each other are treated as one, even if different types, allowing replacing of trains into monorail/maglev. The train goes into its depot, is sold, and the maglev train next door comes out.

Posted: 28 Feb 2006 19:23
by MadFrog
Well... The thing is, we want to:
1) Save the train info (route, cargo etc.)
2) Sell the train
3) Buy a mono/maglev

So the problem now is, we cannot build the train in the same depot. And also the train info would have to be saved somewhere. This patch just changes one bit of info in the train, and voila, its maglev. This is not good because its hacky and ugly.

Building multistop depots might be the answer, but I'm not sure it would be feasible codewise. And it might not be very usable, either, maybe. Consider making all your depots multistop just for a quick change of all vehicles to the next type.

I think a nice solution might be one, where you could change depots into other types and trains inside would be sold (maybe confirmed first) and then new vehicles of the converted type (selected from a list or whatever) would be bought automatically. This would allow all the rail to be converted at one time (tell trains to go to depots, convert all rail, including depots and automatically sell/buy trains). I have a hunch this has been suggested before, but just my opinion... :roll: