IRC logs for #openttd on OFTC at 2012-01-10
⏴ go to previous day
01:20:19 *** mahmoud has joined #openttd
04:15:31 *** Eddi|zuHause has joined #openttd
05:09:38 *** Adambean has joined #openttd
05:56:18 *** Eddi|zuHause has joined #openttd
06:07:53 *** kkb110_ has joined #openttd
06:44:19 *** JVassie has joined #openttd
07:06:24 <Elukka> i got some brawa wagons
07:06:35 <Elukka> the spare parts list of the humble G10 covered goods wagon has 32 items
07:26:29 *** TGYoshi has joined #openttd
07:36:18 *** fjb|tab has joined #openttd
07:40:47 *** Twofish has joined #openttd
07:45:09 *** sla_ro|master has joined #openttd
07:56:11 *** sla_ro|master has joined #openttd
08:13:20 *** Progman has joined #openttd
08:18:59 *** Progman_ has joined #openttd
08:21:21 *** DayDreamer has joined #openttd
08:22:07 *** DayDreamer has left #openttd
08:24:28 *** Progman_ is now known as Progman
08:27:28 *** andythenorth has joined #openttd
08:39:02 <andythenorth> the two code fragments are in two different files in my build
08:39:09 <andythenorth> (I am unifying them)
08:42:02 <Noldo> switch the macro into const global
08:50:59 *** kkb110_ has joined #openttd
08:59:25 <andythenorth> how do I switch CPP to const global?
08:59:30 <andythenorth> I have googled for it, but no dice
09:09:53 <peter1138> cpp to const global? huh?
09:11:02 <andythenorth> probably very useful - for a different problem :P
09:11:31 <andythenorth> I solved the wtf problem (failed to save a file) :P
09:11:49 * andythenorth is concluding nml beats nfo
09:17:27 <andythenorth> can nml go faster?
09:22:18 <andythenorth> shame there's no flashing green in the colour cycle
09:22:25 <andythenorth> (port + starboard lights on ships...)
09:22:35 <andythenorth> ship lights don't flash irl, but meh
09:29:03 <peter1138> you can animate that yourself
09:29:07 <peter1138> if you want to waste sprites :)
09:31:23 <andythenorth> for a small number of ticks :P
09:31:33 * andythenorth is trying to learn CPP meanwhile
09:32:19 <andythenorth> I need to concatenate a string from: 1 sub-string, 2 macros (also happen to be strings)
09:32:23 <andythenorth> e.g. switch_cb_cargo_subtype_text_drawbar_truck_1_trailer
09:32:56 <andythenorth> from switch_cb_cargo_subtype_text_[TRUCKTYPE]_[THIS_NUM_TRAILERS]_trailer
09:34:23 <andythenorth> otherwise I am condemned to endless #ifdef :P
09:42:16 <andythenorth> probably I need ##
11:18:48 *** Eddi|zuHause has joined #openttd
11:24:32 *** andythenorth has joined #openttd
11:26:10 <andythenorth> so I have this which works fine: #define THIS_VEH_ID(...) __VA_ARGS__ ## veh_hackler_BB
11:26:24 <andythenorth> is __VA_ARGS__ a CPP keyword, or just a convention?
11:29:08 *** Markavian` has joined #openttd
11:49:36 * andythenorth lmgtfy andythenorth
11:53:18 *** tokai|mdlx has joined #openttd
11:59:46 <__ln__> anyone need a job? (C++)
12:03:36 <TrueBrain> depends what it pays :P
13:10:55 *** TomyLobo2 has joined #openttd
13:12:07 *** fjb|tab is now known as Guest23570
13:12:08 *** fjb|tab has joined #openttd
13:14:37 <Eddi|zuHause> the C-Preprocessor
13:14:58 <TrueBrain> never heard that being cut off to CPP before
13:16:04 <andythenorth> this would explain why I keep confusing people with my questions
13:16:10 <andythenorth> I don't know it as anything except CPP :P
13:16:22 <andythenorth> also...I can't figure out how to expand then concatenate
13:16:22 <TrueBrain> and I know nobody who uses CPP for that :P
13:16:44 *** TomyLobo2 is now known as TomyLobo
13:17:24 <TrueBrain> also makes me wonder why on earth you want to use it ..
13:17:28 <TrueBrain> use sed or somethng :P
13:17:56 <andythenorth> I'm trying to replace working code that other people don't like the look of
13:18:02 <andythenorth> my code works just fine
13:18:12 <andythenorth> but it seems it's not a sensible way to do it
13:18:39 <TrueBrain> so you are seriously using a compiler to only preprocess a file, and use the output for something totally different, or?
13:18:54 <andythenorth> using sed would mean extending the makefile format
13:18:58 <TrueBrain> what a solution ... lolz
13:19:05 <TrueBrain> for OpenTTD we just use awk for that :P
13:19:36 <TrueBrain> hell, even Python I could understand
13:19:40 <TrueBrain> but a preprocessor .... :P
13:19:53 <TrueBrain> that is using something for something, it is not build to be used on :P
13:20:14 <andythenorth> does it work though? :P
13:20:37 <TrueBrain> it is like using a garbage truck to open your beer ...
13:20:59 <andythenorth> feel free to provide a new makefile framework :)
13:21:15 <TrueBrain> that would require me to know what the fuck you are using in the first place :P
13:21:35 <TrueBrain> but I give you this: an original solution :P
13:21:39 <Eddi|zuHause> TrueBrain: i don't think that was part of "1001 ways to open a beer"
13:21:54 <blathijs> 14:16:22 < andythenorth> also...I can't figure out how to expand then concatenate <-- You mean like DEFINE1 ## DEFINE2 ?
13:21:57 <TrueBrain> it is totally unique for me :)
13:22:05 <TrueBrain> Eddi|zuHause: my point
13:22:10 <TrueBrain> Eddi|zuHause: even they wouldn't consider it :P
13:22:47 <andythenorth> blathijs: like that yes
13:23:22 <TrueBrain> I guess it is also the reason I couldn't place your CPP term, as nobody uses it like that :P :P :D
13:23:47 <TrueBrain> who came up with this solution, if I can ask? (seriously just curious)
13:23:59 <Eddi|zuHause> TrueBrain: it was actually used for NFO preprocessing for years now
13:24:16 <andythenorth> I guess we got bored of writing 'The C pre-processor' every time :P
13:24:24 <TrueBrain> bringing a tank to a cock-fight, is how it feels to me :P
13:24:43 <blathijs> it's actually a fine way to do stuff, if you need exactly what CPP provides
13:24:47 <andythenorth> actual lol at TrueBrain
13:25:05 <TrueBrain> blathijs: overkill comes to mind
13:25:15 <TrueBrain> overcomplicated solution to things we have much nicer and cleaner solutions to :P
13:25:26 <TrueBrain> abusing systems for what they are not intended :)
13:25:31 <TrueBrain> but, as with everything: if it works, it works :)
13:25:37 <andythenorth> well it somewhat works
13:25:52 <andythenorth> I can no longer work on FIRS code
13:26:01 <andythenorth> as the CPP is too complex for me to read
13:26:22 <andythenorth> but limiting use to object macros works genius
13:26:24 <blathijs> TrueBrain: Actually, if you need conditional inclusion and defines, CPP is not overkill but a perfect fit. And even though it's not really meant for non-C files, it's probably better than reinventing the tool and/or format :-)
13:26:42 <TrueBrain> blathijs: "a perfect fit"? really?
13:27:08 <blathijs> I might be overlooking complexities of CPP, of course ;-)
13:27:22 <TrueBrain> and the fact you depend on a compiler for something that doesn't compile :P
13:27:38 <TrueBrain> like writing a book with CPP :P
13:27:39 * andythenorth has spent 3 hours trying to write equivalent of: "foo_string_" + bar_var "_more_foo"
13:27:46 <andythenorth> to get a concatenation with a couple of vars
13:27:56 <andythenorth> so maybe it's not the best shaped tool
13:28:20 <blathijs> TrueBrain: Isn't cpp really just a separate executable? It used to be in the old days, I think
13:28:30 <TrueBrain> I have a (big) meeting in 15; when I come back I will look at that url andythenorth, I am curious how it is used :)
13:28:40 <TrueBrain> blathijs: how would that executable be called?
13:28:58 <Eddi|zuHause> andythenorth: how about you show us your code-snippet?
13:31:17 <blathijs> Seems it isn't, though
13:31:25 <TrueBrain> exists on my system; just unclear what it is :P
13:31:34 <TrueBrain> ah, the preprocessor indeed
13:31:58 <blathijs> it is? It does have a "Only preprocess, don't compile or link"-option according to cpp --help
13:32:23 <TrueBrain> cpp (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5
13:32:28 <TrueBrain> help says it is the C Preprocessor
13:32:59 <TrueBrain> I am seriously surprised someone would want to use it for non-C :P
13:33:05 <TrueBrain> one creative solution :)
13:33:10 <TrueBrain> overkill, but creative :)
13:33:27 <andythenorth> it certainly made nfo a lot easier when I first switched
13:33:39 <TrueBrain> doesn't nml solve it btw?
13:34:20 <TrueBrain> andythenorth: sure, I can see it improves such code; to me only, it is far from the right tool :P It doesn't mean it doesn't help/work :)
13:34:38 <TrueBrain> every tool has its domain; and every tool can be used outside that domain
13:34:47 <TrueBrain> and, I guess, there is a first for everything :)
13:35:21 <Eddi|zuHause> TrueBrain: the original goal was to provide #include and #define functionality for grfcodec
13:35:43 <TrueBrain> Eddi|zuHause: the lazy solution I guess; effective thou
13:36:10 <andythenorth> the original goal worked really well
13:36:56 <TrueBrain> I just wonder .. doesn't NML supply means for this?
13:37:20 <TrueBrain> mind you: I never looked in any NML / GRF / NFO code what-so-ever :P
13:37:30 <Eddi|zuHause> no... they were too lazy to impleement, because this method was well established by then
13:39:15 <blathijs> TrueBrain: One can wonder: Why should NML provide it if C doesn't even provide it itself? ;-p
13:39:50 <TrueBrain> blathijs: and we all know that C Preprocessor is so limited, it often causes issues in what you want to do :P
13:39:56 <TrueBrain> even more when we talk about string manipulation
13:40:06 <TrueBrain> with a language like NML, easier solutions are available
13:40:20 <andythenorth> it also litters the code with stuff that looks like function calls
13:40:27 <andythenorth> ...because they're cpp function calls :P
13:40:34 <andythenorth> confuses my brain
13:40:47 <andythenorth> replacing constants is trivial
13:40:53 <andythenorth> using includes - most sane languages do that
13:41:07 <andythenorth> two kinds of function call in your language - that's a headache
13:41:31 <andythenorth> language / source code /s
13:41:53 <Eddi|zuHause> andythenorth: you need the (...) in the #define only if you use __VA_ARGS__
13:41:54 <TrueBrain> reading the last URL, I understand perfectly what line by line means, and yet I have no clue what the fuck it does :D:D :)
13:42:24 <andythenorth> you'd have to expand a lot of macros to make any sense of it
13:42:39 <TrueBrain> CHECK_INCOMPATIBLE (aluminium_plant, 56, CB_RESULT_LOCATION_DISALLOW, return CB_RESULT_LOCATION_ALLOW)
13:42:40 <andythenorth> Eddi|zuHause: do I need the parentheses
13:42:41 <Eddi|zuHause> that, of course, has nothing to do with your problem
13:42:42 <TrueBrain> CHECK_INCOMPATIBLE (bauxite_mine, 16, CB_RESULT_LOCATION_DISALLOW, THIS_ID(aluminium_plant))
13:42:43 <TrueBrain> why does the first 'return', the second not :P
13:43:01 <blathijs> TrueBrain: I guess that using a preprocessor is actually a sign of insufficient abstraction capabilities in the language, though ;-p
13:43:05 <andythenorth> TrueBrain: I have no idea
13:43:11 <andythenorth> this is why I can no longer work on FIRS code :)
13:43:20 <andythenorth> however others work on it for me ;)
13:43:33 <TrueBrain> blathijs: I guess that is a good guess :)
13:43:43 <TrueBrain> I wonder if NML doesn't support temporary variables, like consts
13:43:52 <andythenorth> NML also provides some magic builtins
13:44:19 <andythenorth> so you have to grep your source for "is it a define?", and have NML docs open all the time
13:44:38 <TrueBrain> I totally understand your point andythenorth :)
13:44:51 <andythenorth> NML *is* better than nfo
13:44:55 <andythenorth> but I vastly prefer nfo
13:45:09 <andythenorth> because it's just bytes
13:45:11 <Eddi|zuHause> "the devil you know"
13:45:18 <andythenorth> there's no magic
13:45:36 <TrueBrain> right, meeting time; back in a few hours :(
13:45:43 <andythenorth> it's probably about 4x faster to write code in nml
13:45:48 <andythenorth> but I don't trust it at all
13:46:52 <andythenorth> I wouldn't leave my kids alone with it for definite :P
13:47:51 <Eddi|zuHause> andythenorth: you need () only if the macro definition contains (...)
13:48:30 <Eddi|zuHause> so if you #define FOO(...), then you need to do FOO(), if you #define FOO, then you only need FOO
13:49:33 <andythenorth> but it's not going to expand THIS_NUM_TRAILERS whatever I do, is it?
13:49:48 <andythenorth> it treats that as a literal string
13:50:49 <andythenorth> (I don't mean a string literal) :P
13:50:54 <Eddi|zuHause> andythenorth: what i think is you need to do #define FOO(num) xxx_ ## num ## _yyy, and then do FOO(NUM)
13:51:15 <andythenorth> I think I tried that already
13:51:18 <andythenorth> but I'll try again
13:52:21 <andythenorth> yep, still treats THIS_NUM_TRAILERS as a string
13:53:19 <Eddi|zuHause> hm... arguments should be expanded first...
13:55:11 * andythenorth wonders when to give up and keep using #if blocks :)
13:56:12 <DorpsGek> andythenorth: someone was last seen in #openttd 1 year, 12 weeks, 1 day, 20 hours, 15 minutes, and 49 seconds ago: <Someone> indeed
13:56:42 <DorpsGek> Andrei: seen [<channel>] <nick>
13:56:56 <DorpsGek> Andrei: seen [<channel>] <nick>
13:59:48 <andythenorth> I could create a lot of branching switches with nml, using CPP to insert a value via advanced varact 2 constant
13:59:57 <andythenorth> but I don't see any gain there
14:00:34 <Eddi|zuHause> well... i can't help you ther, at this point i use python to generate such constants
14:01:37 <Eddi|zuHause> file.write('#define VEH_ID(...) %s_%s_%s ## __VA_ARGS__\n'%(comp, ident, sl_index))
14:03:07 <andythenorth> that's um...readable ;)
14:03:26 <andythenorth> you can't ditch the cpp at that point, and use python directly?
14:03:40 <Eddi|zuHause> i still need include functionality
14:03:56 <Eddi|zuHause> and i can pass this value to "custom.pnml" files
14:04:39 <Eddi|zuHause> it still has its uses
14:09:53 *** supermop has joined #openttd
14:31:39 *** Adambean has joined #openttd
14:45:20 *** Devroush has joined #openttd
14:53:05 *** fjb|tab is now known as Guest23582
14:53:05 *** fjb|tab has joined #openttd
15:06:18 <lugo> is it possible to display server settings to clients when they connect?
15:07:18 <lugo> something along the lines: say "Min active players:'$min_active_players'"
15:07:39 <Eddi|zuHause> use the admin port?
15:08:14 <Eddi|zuHause> finally port autopilot to connect to the admin port? :)
15:13:26 <lugo> so there's no quick and easy way i guess..
15:14:37 <Eddi|zuHause> well, there will be a quick and easy way, if you do the hard work first :)
15:20:41 <michi_cc> andythenorth: Can you paste a complete stand-alone example of your CPP problem? One thing I noticed in your first paste is that CPP will not replace "1..THIS_NUM_TRAILERS", because of C tokenozation rules, "1 .. THIS_NUM_TRAILERS" on the other hand will be replaced (and NML hopefully accepts it as well)
15:57:23 *** HerzogDeXtEr has joined #openttd
16:01:37 *** supermop has joined #openttd
16:07:35 *** mouseym has joined #openttd
16:26:02 *** Prof_Frink has joined #openttd
17:15:47 <andythenorth> michi_cc: how complete? It might be easier to just look at BANDIT source? :)
17:18:05 <michi_cc> andythenorth: Complete enough to to see what fails. If you can tell where in BANDIT to look...
17:19:24 <andythenorth> it works but is...inelegant :P
17:22:02 <andythenorth> it would be elegant to concatenate the identifier for the switch
17:22:18 <andythenorth> but irl, I could just keep adding #if :P
17:29:00 <TrueBrain> blathijs: michi_cc just gave a good example why using CPP is not the tool in this case :D It uses invalid C to parse :D:D
17:29:02 <michi_cc> andythenorth: Bascially to make such constructs work you have to use *two* macros and only do the token pasting in the second macro and just pass it through in the first.
17:29:54 <michi_cc> TrueBrain: Where is that invalid C? Note that CPP does not care about C grammer, *only* about C tokenizing rules.
17:30:05 <TrueBrain> michi_cc: my point exactly :)
17:30:38 <Eddi|zuHause> not getting the point...
17:31:50 <michi_cc> The moment I would replace "THIS_SUBTYPE_TEXT_CB_ID" by e.g. "int THIS_SUBTYPE_TEXT_CB_ID;" it would be perfectly alright C.
17:31:54 <TrueBrain> NML is not a subset of the C language, as shown with 1..THIS_NUM_TRAILERS :)
17:32:43 <Eddi|zuHause> how's that a reason? :)
17:33:14 <TrueBrain> depends for what you are looking a reason Eddi|zuHause
17:33:44 <TrueBrain> michi_cc: to bring a bit of context, earlier I was surprised people were actively using CPP, and blathijs and I got to talk if this was a good tool for the job, as it was efficient
17:34:06 <TrueBrain> but given that NML in fact does not follow the lexer-rules of C, there is clearly places where it breaks
17:34:46 <TrueBrain> which still makes me wonder, even if CPP was used for NFO, why NML doesnt implement its own version of it
17:35:02 <TrueBrain> wouldn't that simplify the work for authors?
17:35:33 <michi_cc> andythenorth: To explain a bit more, you need that indirection because in my example CPP will replace "THIS_SUBTYPE_TEXT_CB_ID" with "THIS_SUBTYPE_TEXT_CB_ID_(THIS_NUM_TRAILERS)", which in turn is expanded to "PASTE(switch_cb_cargo_subtype_text_drawbar_truck_, THIS_NUM_TRAILERS, _trailer)".
17:36:46 *** fjb|tab has joined #openttd
17:36:51 <Eddi|zuHause> michi_cc: why does this work, but writing PASTE(blah) directly not?
17:37:01 <TrueBrain> [18:31] <michi_cc> The moment I would replace "THIS_SUBTYPE_TEXT_CB_ID" by e.g. "int THIS_SUBTYPE_TEXT_CB_ID;" it would be perfectly alright C. <- how does that fix the invalid 1..THIS_NUM_TRAILERS ? That is still invalid C, not?
17:37:43 <michi_cc> andythenorth: If that second macro would already do the token pasting (i.e. the a ## b ## c) you can see that the second token is still THIS_NUM_TRAILERS, as macro expansion happens after token pasting. But thanks to the indirection the line is further expanded to "PASTE(switch_cb_cargo_subtype_text_drawbar_truck_, 2, _trailer)" which then in turn is expanded using PASTE to "switch_cb_cargo_subtype_text_drawbar_truck_2_trailer".
17:38:31 <michi_cc> Eddi|zuHause: Because the ## operator is executed *before* the token is expanded if it is itself a define.
17:39:49 <michi_cc> Yes. It is indeed not really obvious, but the result of the fact that in translating C, tokenization is phase 3 while macro expansion is phase 4.
17:41:46 <andythenorth> michi_cc: just feeding the toddler, but will look at your paste asap :)
17:43:41 *** |Jeroen| has joined #openttd
17:45:16 <andythenorth> how hard is it to write a simple macro processor?
17:45:50 <andythenorth> maybe that's the wrong question
17:47:05 <TrueBrain> andythenorth: depends on your "simple"
17:47:07 <TrueBrain> and on your demands
17:47:16 <andythenorth> michi_cc so to also substitute the type of truck, I'd do "#define PASTE(a, b, c, d) a ## b ## c ##d" and also pass TRUCK_TYPE or such?
17:47:20 <TrueBrain> CPP is efficient, so it truly depends on what you want :)
17:47:40 <andythenorth> define constants, include files, concatenate strings
17:47:50 <andythenorth> I've often wanted maths, but always found a way around it
17:48:10 <andythenorth> nml appears to be able to evaluate maths inline to some extent anyway
17:48:31 <andythenorth> the strings are primarily to create identifiers in nml
17:49:05 <andythenorth> currently I use things like #define THIS_VEH_ID(...) __VA_ARGS__ ## veh_hackler_BB
17:49:36 <andythenorth> but I find that very unintuitive - others' mileage may vary
17:52:13 *** fjb|tab has joined #openttd
17:52:56 <Xaroth> TrueBrain: they should just use xml :) :)
17:53:17 <TrueBrain> XML, the goto solution for all problems
17:56:35 *** Chris_Booth has joined #openttd
17:58:04 <Eddi|zuHause> the facepalm smilie :)
17:58:11 <andythenorth> yeah, XML concatenates strings really well
17:58:36 <andythenorth> and it's really easy to read, what with all those nodes and crap
17:59:05 <Xaroth> oh, easy to read.. python! :P
17:59:06 <Eddi|zuHause> andythenorth: you will probably want "switch_blah_ ## b ## _ ## c ## _trailer" or somesuch
17:59:40 <andythenorth> XML + TAL might work :P
18:00:16 <andythenorth> but it would contain about 200% more markup than is needed
18:00:36 <andythenorth> but at least I could view it in my browser :P
18:00:50 <Eddi|zuHause> that's the killer feature!
18:01:28 <Xaroth> on-error if an error occurs, this attribute works like the content tag.
18:01:34 <Xaroth> that almost sounds like 'on error resume next'
18:02:49 <Eddi|zuHause> bah google is useless...
18:03:14 <Xaroth> mind my ignorance, but what, exactly, is the expected output of this 'tool' ?
18:03:48 <andythenorth> the one we're inventing?
18:03:50 <Eddi|zuHause> i wanted to search whether anybody ever did a "phone mobile", but google insists of showing me all results for "mobile phone"
18:04:09 <Xaroth> the one you're inventing
18:04:26 <andythenorth> it templates NML
18:04:34 <andythenorth> or replaces it :P
18:04:38 <andythenorth> replacing it seems foolhardy
18:05:16 <Xaroth> which is basically a new newgrf creator thingie
18:05:43 <andythenorth> so forget XML as it's stupid
18:06:03 <andythenorth> the neat thing about TAL is that (in the python implementation of it) you can write python in the template
18:06:08 <andythenorth> *restricted python
18:06:16 * andythenorth wonders if NML does that
18:06:21 <Xaroth> why not just use python instead?
18:07:19 * andythenorth is perhaps being confusing :)
18:07:46 <andythenorth> I don't propose TAL for this, I just like its ability to execute python ;)
18:08:01 <andythenorth> if NML could execute python while compiling, I could use that....
18:08:13 * andythenorth should read the NML docs more
18:08:14 <Eddi|zuHause> "inline python" :p
18:08:34 <Eddi|zuHause> maybe it has an unguarded "eval()" that you can abuse :p
18:08:49 <andythenorth> very dangerous in web apps ;)
18:11:03 <Eddi|zuHause> in case you need a debug interface :)
18:12:22 <andythenorth> replace="python: 'foo'"
18:16:16 *** MagisterQuis has joined #openttd
18:16:39 <Eddi|zuHause> soon we need to build deep thought to compile cets
18:18:30 *** frosch123 has joined #openttd
18:20:50 *** FLHerne has joined #openttd
18:21:51 <michi_cc> andythenorth: Yes. Bascially, every time you want to use ## with something that already is a #define, you need to pass it through two macros (e.g. #define A(x) B(x); #define B(x) dummy ## x).
18:22:27 * frosch123 wonders whether tt-forums has a my-little-pony thread somewhere in the off-topic
18:29:10 *** TheMask96 has joined #openttd
18:33:33 *** retro|cz has joined #openttd
18:33:59 <retro|cz> Anyone here interested into bug report ?
18:35:19 <frosch123> bug reports with fixes included are always nice
18:35:42 <retro|cz> frosch123, I'm not sure if it is local bug
18:35:47 <retro|cz> or I should send patch
18:35:54 <retro|cz> I have compilation error in last nightly.
18:36:08 <retro|cz> one include in screenshot.cpp is missing
18:37:02 <frosch123> i think you are too late :)
18:37:06 <DorpsGek> frosch123: Commit by truebrain :: r23784 trunk/src/screenshot.cpp (2012-01-09 23:04:03 UTC)
18:37:07 <DorpsGek> frosch123: -Revert (r23740): compiling without libpng failed to include a correct header
18:37:40 <retro|cz> should i send patch ?
18:37:49 <retro|cz> When I readd this line, it compiles fine
18:38:09 <frosch123> it was already fixed 19 hours ago
18:38:21 <retro|cz> frosch123, ohh, so my build isn't last
18:39:43 *** fonsinchen has joined #openttd
18:45:54 <CIA-1> OpenTTD: translators * r23785 /trunk/src/lang/ (9 files): (log message trimmed)
18:45:54 <CIA-1> OpenTTD: -Update from WebTranslator v3.0:
18:45:54 <CIA-1> OpenTTD: croatian - 6 changes by VoyagerOne
18:45:54 <CIA-1> OpenTTD: czech - 12 changes by TheLamer
18:45:54 <CIA-1> OpenTTD: dutch - 6 changes by habell
18:45:56 <CIA-1> OpenTTD: english_US - 6 changes by Rubidium
18:45:56 <CIA-1> OpenTTD: finnish - 7 changes by jpx_
18:56:51 *** Alberth has joined #openttd
18:56:51 *** ChanServ sets mode: +o Alberth
19:06:46 *** HerzogDeXtEr1 has joined #openttd
19:11:20 *** Brianetta has joined #openttd
19:33:07 <Belugas> hello Wolf01! and Terkhen! and Alberth! and Rubidium! and... etc...
19:42:03 *** andythenorth has joined #openttd
19:43:23 *** andythenorth is now known as Guest23601
19:43:23 *** andythenorth has joined #openttd
20:25:25 *** brendan10211 has joined #openttd
20:30:07 <andythenorth> michi_cc: thanks for the cpp - it works
20:30:13 <andythenorth> I'll see if I can adapt it to other cases
20:30:27 <andythenorth> I kind of get it
20:30:46 <andythenorth> for reasons I can't explain, it reminds me of calling ''.join() in python :P
20:36:28 * andythenorth wonders if the source file for an include can be defined by a macro
20:36:33 <andythenorth> one way to test....
20:39:55 <andythenorth> should work then
20:45:35 <andythenorth> CPP has some interesting opinions about _
20:46:17 <andythenorth> in function names
20:52:42 *** brendan10211 has joined #openttd
20:54:02 <frosch123> anyone uses stop-depot orders?
20:57:36 <Eddi|zuHause> it was my feature request :)
20:57:56 <frosch123> but you are not using service orders
20:58:29 <Eddi|zuHause> occasionally for autoreplace
20:58:53 <frosch123> question, shall stop-order disable automatic servicing of a vehicle, or only the normal depot and service orders?
20:59:57 <frosch123> the question is, what behaviour is more useful, or less surprising to the user :p
20:59:57 <Eddi|zuHause> i think the former for consistency, but explicitly document it
21:01:59 <andythenorth> I can't figure out how to concatenate a name for an include using double quotes
21:02:38 <andythenorth> I can do it with angle brackets, but then the path fails :P
21:02:48 <frosch123> #define concat(a, b) a##b
21:02:59 <frosch123> #include concat(a,b)
21:03:50 <andythenorth> error: #include expects "FILENAME" or <FILENAME>
21:04:30 <frosch123> add a #define quote(bla) #bla
21:05:11 <andythenorth> this one would actually be a valid case for #if
21:05:25 <frosch123> does s/a ## b ## c/#a##b##c/ work?
21:05:28 <andythenorth> but I can't check #if TRUCK_TYPE == string
21:05:49 <andythenorth> seems cpp can only evaluate numbers
21:05:56 <frosch123> (the # in the front should make it quoted)
21:07:25 <andythenorth> where am I adding the #?
21:07:39 <frosch123> in the CONCATENATE_IDENTIFIER_
21:07:48 <frosch123> it must be at the end of the call-chain
21:08:53 <andythenorth> error: pasting ""../templates/trailer_callbacks/capacity_cb_trailers_"" and "fifth_wheel_truck" does not give a valid preprocessing token
21:09:36 <frosch123> don't quote your arguments
21:10:31 <frosch123> hmm, let's actually look at the specs :p
21:13:34 <andythenorth> cpp online docs?
21:16:32 <frosch123> haha, it contanis exactly your usecase as example :p
21:17:02 <frosch123> the correct solution is the one i dismissed earlier.
21:17:06 <andythenorth> google is not my friend :(
21:17:09 <frosch123> #define quote(bla) #bla
21:18:06 <frosch123> #include quote(THIS_CAPACITY_TEMPLATE_NAME)
21:18:07 <andythenorth> so I need an extra define?
21:18:47 *** JVassie has joined #openttd
21:22:11 <andythenorth> so the #include line also calls
21:22:16 <andythenorth> rather than expecting a constant
21:25:18 <frosch123> brendan10211: it's a quote from ISO/IEC 14882:1998(E)
21:28:35 * andythenorth is reading a cpp tutorial that says "you should generally avoid macros when possible"
21:29:20 <SpComb> it is probably correct
21:30:29 <SpComb> #include quote(concat(foo/,bar))
21:37:36 <andythenorth> maybe there's a better way
21:37:42 <andythenorth> currently I'm stumped though :P
21:38:05 <andythenorth> the specs aren't really helping me :)
21:38:38 <frosch123> you only have to add the QUOTE to you current file, don't you?
21:40:54 <andythenorth> it's not calling
21:41:09 *** MagisterQuis1 has joined #openttd
21:43:09 <andythenorth> frosch123: expands to THIS_CAPACITY_TEMPLATE_NAME
21:43:31 <andythenorth> I got the same result with my attempt :)
21:44:05 <andythenorth> probably this is a bad way to do this :)
21:46:56 <andythenorth> error: pasting "capacity_cb_trailers_" and ""THIS_TRUCK_TYPE"" does not give a valid preprocessing token
21:47:22 <frosch123> what do you define THIS_TUCK_TYPE to?
21:47:59 <andythenorth> it's either drawbar_truck or fifth_wheel_truck
21:48:06 <andythenorth> it's probably numeric in your version of the repo
21:49:04 <frosch123> oh, you need to remove the # from CALL_TEMPLATE_NAME_CONCATENATER_
21:50:31 <andythenorth> wonder why it's now passing 4 args when 3 are expected
21:52:09 <andythenorth> doesn't like the "s.tnml" much
21:59:40 *** Chris_Booth has joined #openttd
22:00:33 <Eddi|zuHause> am i reading this right that devzone takes 14 minutes to build CETS?
22:09:32 <andythenorth> what a large number of LOC to do something quite simple :)
22:51:32 *** andythenorth has joined #openttd
23:18:47 *** Brianetta has joined #openttd
23:22:24 <appe_> im having trouble setting up a normal server on windows 7
23:22:37 <appe_> ports are forwarded, server started, lan games work.
23:23:08 <appe_> firewall is completely turned of, and when i try to connect it gives me "server closed"
23:23:13 <appe_> any ideas what i can try?
23:29:22 <glx> can you see your server on servers.openttd.org ?
23:30:40 <glx> do you see it in ingame list ?
23:33:50 <planetmaker> and what about the firewall of your modem / router?
23:34:09 <planetmaker> with respect to incoming and packet types udp and tcp?
23:34:14 <glx> planetmaker: that was the next point ;)
23:34:24 <appe_> i cant see it in the list no.
23:34:47 <appe_> and, i have forwarded the two ports
23:35:12 <planetmaker> it's usually one of the two firewalls people usually have. Or they only forward one packet type but disallow the other or so
23:35:56 <planetmaker> and your cfg tells openttd to also use the two ports you forward, yes?
23:36:36 <appe_> yes, i just re-checked it
23:36:57 <planetmaker> well. you can always check servers.openttd.org
23:37:03 <planetmaker> if it shows there, it should work
23:37:04 <Eddi|zuHause> anyone ever considered implementing distinction in the content download for "not installed" vs. "installed, but outdated" and "not installed, to be installed" vs. "outdated, to be upgraded"
23:38:12 <appe_> its a simple win7 os, no firewall enables (nor AV).
23:38:20 <planetmaker> Eddi|zuHause: yes
23:38:33 <planetmaker> you can "select upgrades"
23:38:40 <Eddi|zuHause> planetmaker: i mean visually
23:38:59 <Eddi|zuHause> as in the icons (green blob vs. checkbox)
23:40:15 <Eddi|zuHause> planetmaker: like: "outdated" -> yellow blob, "outdated, to be upgraded" -> yellow blob with green check
23:40:41 <glx> appe_: start it with -d net1
23:41:03 <Eddi|zuHause> appe_: from the command line
23:41:11 <appe_> oh, i should say, im starting the server dedicated
23:41:28 <glx> then it already have -d net1 :)
23:41:33 <Eddi|zuHause> that should enable -d net=2 automatically
23:41:55 <Eddi|zuHause> -D implies -d net=2
23:42:18 <glx> so you should see lines saying "advertising..."
23:42:48 <Eddi|zuHause> you can select and copy everything in the cmd window
23:43:36 *** kkb110__ has joined #openttd
23:43:54 <Xaroth> dump it on pastebin or so
23:44:06 <Xaroth> DorpsGek doesn't like people pasting crap
23:44:27 *** kkb110_ has joined #openttd
23:45:14 <Eddi|zuHause> there's nothing about advertising there
23:45:14 <Xaroth> does it list a port 3979 in the list
23:45:30 <Xaroth> Eddi|zuHause: that fix is easy :P
23:46:26 <glx> appe_: how is server_advertise in openttd.cfg ?
23:46:32 <appe_> Xaroth: i find "listening" on 0.0.0.0:3979
23:46:36 <Xaroth> appe_: open your openttd.cfg
23:46:41 <appe_> what is the default value?
23:46:43 <Xaroth> and check for lan_internet (tell us its value)
23:46:56 <glx> Xaroth: totally unrelated ;)
23:47:15 <Xaroth> glx: just comparing to my 'working' config
23:47:21 <Xaroth> which has lan_internet 1
23:47:25 <Xaroth> don't care if it's related or not
23:47:26 <glx> lan_internet is for the client
23:47:27 <appe_> server advertise is "false"
23:47:46 <appe_> i guess ill change that to "true"? :)
23:48:15 <appe_> the feature name imply that it should still work, if i have the ip?
23:48:25 <planetmaker> yes. But no one will know
23:48:32 <appe_> well, that wont do the trick, then.
23:48:41 <glx> but it's easier to check setup that way
23:48:42 <planetmaker> without advertisement that is
23:48:47 <appe_> im logging in remotely on a work computer, trying to connect to my own server.
23:50:01 <appe_> wanna have a go? 83.227.118.129
23:50:19 <appe_> server window talking 'bout advertising
23:50:25 <glx> so now you gave [udp] advertising to master server
23:51:45 <appe_> ah, let's see, it gave me a message: "we are not receiving the acknowledgement from the server ../.. please allow udp and tcp packets to port 3979"
23:52:01 <appe_> alright, so something fishy is up with my router, it seems.
23:54:17 <Xaroth> port 3979 both tcp and udp should forward to the machine you're running it on
23:55:00 <appe_> the problem was me - trying to port forward a range in a one-number port forward feature
23:55:07 <appe_> thats sloppy networking for you
23:55:13 <appe_> cheers, thanks a bunch :)
23:55:36 <glx> once advertising works you are free to disable it :)
continue to next day ⏵