Requested hacks
Moderator: OpenTTD Developers
Requested hacks
I've made a few rough patches (i.e. hacks, they're not intended to be permanent changes to code, I don't promise they'll work, but should be okay) to do things that have been requested. I'll do some more if I have the time to spare.
I'm rather limited on what software I can run on this computer, so the patch files have been assembled by hand somewhat. Apologies if the patch software you use doesn't understand them, they work fine with Cygwin's patch - so I'm guessing (hopeing) they'll be okay.
-----
Hack: Allow mail trucks to use truck stops and bus stops.
I'm rather limited on what software I can run on this computer, so the patch files have been assembled by hand somewhat. Apologies if the patch software you use doesn't understand them, they work fine with Cygwin's patch - so I'm guessing (hopeing) they'll be okay.
-----
Hack: Allow mail trucks to use truck stops and bus stops.
- Attachments
-
- mail_trucks(r4943).diff
- Allow mail trucks to use truck AND bus stops (r4943).
- (5.11 KiB) Downloaded 296 times
Hack: Allow more than 40 orders for each vehicle.
Problems: Saving of orders when deleteing a vehicle so that the next vehicle built has the same orders as the old one has been disabled. To get around this problem you'll have to built new vehicle first, copy the orders, then delete old vehicle.
Problems: Saving of orders when deleteing a vehicle so that the next vehicle built has the same orders as the old one has been disabled. To get around this problem you'll have to built new vehicle first, copy the orders, then delete old vehicle.
- Attachments
-
- more_orders(r4943).diff
- Allow more than 40 orders for each vehicle (r4943).
- (2.18 KiB) Downloaded 250 times
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
And also, use coding style as much as possible :
un-needed change. It should stay the same
Wrong coding style
Should have been
un-needed change. It should stay the same
Code: Select all
- if (v->cargo_type == CT_PASSENGERS) {
+ if (v->cargo_type == CT_PASSENGERS)
+ {
Code: Select all
- } else {
+ }
+ else if (v->cargo_type == CT_MAIL)
+ {
Code: Select all
- } else {
+ } else if (v->cargo_type == CT_MAIL) {
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
to me, thats like, woah!!! Braces should have their own lines
but then i've never programmed anything in ottd.

but then i've never programmed anything in ottd.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
Well I agree, but ottd has an official coding style and we should stick to it, regardless of how far against our own personal tastes it is.bobingabout wrote:to me, thats like, woah!!! Braces should have their own lines![]()
but then i've never programmed anything in ottd.
Melt with the Shadows,
Embrace your destiny...
Embrace your destiny...
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Indeed 
I would rather go as this :
but... well... won't compile in C and would be rejected quite fast 

I would rather go as this :
Code: Select all
Function GetMeSomethingToDo( Value : integer) : Integer;
Begin
Result := 0;
While Result <> Value Do
Begin
Result := GetSomeCode;
SaveLog(Result, Value);
End;
End;

If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Finally, a real programmer!LKRaider wrote:That's Delphi (Object Pascal) !
I am not alone anymore!!!

If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
No it's not, nothing in there screams Delphi to me... it's just Pascal. And that's not a real language either.
Code: Select all
int getMeSomethingToDo(int value) {
int result = 0;
while (result != value) {
result = getSomeCode();
saveLog(result, value);
}
return result;
}
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
This line will tell you it is Object Pascal.MattW wrote:No it's not, nothing in there screams Delphi to me... it's just Pascal.
Assigning the return value of a function by the key word "Result" is typical.
Code: Select all
Result := GetSomeCode;
Code: Select all
i := GetSomeCode;
...
GetMeSomethingToDo := i;
And since (to my knowledge) Delphi is the only Pascal compiler to use Object Pascal...
Another one frustrated of not able to use (and recognize) a TRUE beautiful languageMattW wrote:And that's not a real language either.

Although I have to admit I begin to like C more and more.
But I keep my day job in Delphi

If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
i just love CAOS, unfortunatly, its only a scripting language for the CAOS engine, which is kinda crap...
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
I used to think that, and then I realized... you know, if it's consistant coding style it takes about 5 minutes to learn the rules and everythings good! The real problem comes in when somebody thinks their way is the only way and goes against the rules.Moriarty wrote:...brackets on their own lines where they belong.
-Hazelrah
I don't think the placement of brackets really falls under coding style, it's too trivial. If your editor is advanced enough, it will automatically handle bracket stuff.
I think coding style has more to do with code content, things like optimization, use of (x?y:z) statements, use of increments etc. Those can really determine whether code is readable or not, while brackets are always brackets (readability ofcourse being an entirely subjective matter)
I think coding style has more to do with code content, things like optimization, use of (x?y:z) statements, use of increments etc. Those can really determine whether code is readable or not, while brackets are always brackets (readability ofcourse being an entirely subjective matter)
Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
like a variable in a pascal program for an assignment i wrote called "somepeiceofcrapicantbearsedtoname"
it was 3 in the morning when i was writing it, and it was a last minute addition to get the function to work properly.
it was 3 in the morning when i was writing it, and it was a last minute addition to get the function to work properly.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
No, actually the name of a variable has also become a trivial thing, but that has happened only recently. Up to date editors can change the name of a variable in the blink of an eye, correctly and only in the right places. (so it knows that "x" in one place might not be the same "x" in another).
Code obfuscators are actually becoming common place, and are becoming workarounds around open source demands. (You can release your code, but if it's unreadable to humans, it's not going to help the competition at all).
I think code style is becoming more abstract, having to do with design issues, how you tackle a problem. You could e.g. code a routine using object oriented techniques, assembler, basic-like stuff or something altogether different. With a modern and efficient compiler, it might very well all amount to the same executable machine code.
Code obfuscators are actually becoming common place, and are becoming workarounds around open source demands. (You can release your code, but if it's unreadable to humans, it's not going to help the competition at all).
I think code style is becoming more abstract, having to do with design issues, how you tackle a problem. You could e.g. code a routine using object oriented techniques, assembler, basic-like stuff or something altogether different. With a modern and efficient compiler, it might very well all amount to the same executable machine code.
Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
Who is online
Users browsing this forum: Google [Bot] and 11 guests