#gemrb@irc.freenode.net logs for 28 Feb 2015 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage

[00:20:30] --- Crevs_Away is now known as CrevsDaak
[00:35:03] --> brada has joined #gemrb
[00:46:29] <-- brada has left IRC (Quit: brada)
[00:49:52] --> brada has joined #gemrb
[01:07:15] <-- Eli2_ has left IRC (Ping timeout: 265 seconds)
[01:07:16] --> Eli2 has joined #gemrb
[01:41:31] <-- brada has left IRC (Quit: brada)
[02:53:09] <-- turtleman_ has left IRC (Ping timeout: 252 seconds)
[05:18:47] --- CrevsDaak is now known as Crevs_Asleep
[06:47:18] <-- Lightkey has left IRC (Ping timeout: 256 seconds)
[06:59:39] --> Lightkey has joined #gemrb
[09:56:53] <-- lynxlynxlynx has left IRC (Read error: Connection reset by peer)
[09:59:17] --> lynxlynxlynx has joined #gemrb
[09:59:17] <-- lynxlynxlynx has left IRC (Changing host)
[09:59:17] --> lynxlynxlynx has joined #gemrb
[09:59:17] --- ChanServ gives channel operator status to lynxlynxlynx
[11:06:41] --> turtleman_ has joined #gemrb
[11:45:56] <lynxlynxlynx> i wrote down the most common cases as test pairs: https://github.com/lynxlynxlynx/gemrb-mods/tree/master/10pp
[11:45:58] <Seniorita> gemrb-mods/10pp at master · lynxlynxlynx/gemrb-mods · GitHub
[11:45:59] <Seniorita> »gemrb-mods - Repository of my GemRB mods and tools not included with GemRB itself«
[14:05:54] <-- turtleman_ has left IRC (Ping timeout: 265 seconds)
[15:08:09] <-- Drakkar has left IRC (Ping timeout: 250 seconds)
[15:09:37] --> Drakkar has joined #gemrb
[15:32:38] --> turtleman_ has joined #gemrb
[15:36:33] <lynxlynxlynx> perl doesn't look that bad for these simple things
[15:46:54] --- Crevs_Asleep is now known as CrevsDaak
[15:47:15] <CrevsDaak> yeah, perl is complicated but not that much for regexp and checks
[15:57:44] <lynxlynxlynx> i'm almost done with the tests
[15:57:56] <CrevsDaak> cool
[15:57:59] <lynxlynxlynx> btw, what platform are you on?
[15:58:10] <CrevsDaak> macosx 10.7
[15:58:20] <lynxlynxlynx> cool, so you have diff, right?
[15:58:23] <CrevsDaak> darwin 11.4.2 if you need more info
[15:58:27] <CrevsDaak> yeah
[15:58:37] <lynxlynxlynx> now it displays a diff of the failed results unless quiet mode is on
[15:58:43] <lynxlynxlynx> ok
[15:59:05] <CrevsDaak> nice
[15:59:07] <lynxlynxlynx> how much did you work with perl before?
[15:59:19] <CrevsDaak> uhm... almost nothing
[15:59:30] <lynxlynxlynx> heh
[15:59:51] <CrevsDaak> only for it's regexps and files it should be easy
[16:00:18] <lynxlynxlynx> yeah, especially the glob interface is very shell-like
[16:00:24] <lynxlynxlynx> no need for manual looping
[16:00:30] <CrevsDaak> yeah
[16:00:39] <CrevsDaak> that's awesome, just a glob and a foreach
[16:00:57] <lynxlynxlynx> how do we do this? Have you used github before?
[16:03:32] <CrevsDaak> yeah
[16:03:58] <lynxlynxlynx> cool
[16:04:18] <CrevsDaak> I'm not a git-wizard but I know about it enough to commit without deleting anything
[16:04:43] <lynxlynxlynx> how i see it is that the fixer should just look at one file at a time
[16:04:49] <lynxlynxlynx> looping can be done externally
[16:05:00] <lynxlynxlynx> that way I can also just import it into the test suite script
[16:05:10] <CrevsDaak> ok
[16:05:20] <lynxlynxlynx> and we can write a wrapper for the other case if needed
[16:05:25] <CrevsDaak> loop it with weidu or sh/bash?
[16:05:38] <CrevsDaak> weidu two ways of looping files
[16:05:40] <lynxlynxlynx> in the end it should all be migrated to weidu, ideally
[16:05:45] <CrevsDaak> ok
[16:06:02] <lynxlynxlynx> but it's more comfortable to get the regexes right without touching it
[16:09:56] <lynxlynxlynx> ok, i've cleaned up the repo and pushed the suite
[16:10:03] <lynxlynxlynx> i suggest you fork it
[16:10:38] <lynxlynxlynx> https://github.com/lynxlynxlynx/gemrb-mods/tree/master/10pp
[16:10:40] <Seniorita> gemrb-mods/10pp at master · lynxlynxlynx/gemrb-mods · GitHub
[16:10:41] <Seniorita> »gemrb-mods - Repository of my GemRB mods and tools not included with GemRB itself«
[16:10:58] <lynxlynxlynx> there's a fork button right there
[16:11:33] <lynxlynxlynx> i'll leave the first steps of the script to you, but feel free to ask anything
[16:13:00] <CrevsDaak> nice
[16:13:37] <CrevsDaak> wouldn't it be easier to let me commit to the repo?
[16:15:30] <lynxlynxlynx> let's see if i can do that
[16:16:31] <lynxlynxlynx> yep
[16:16:37] <lynxlynxlynx> what's your github username?
[16:16:56] <CrevsDaak> CrevsDaak
[16:17:22] <CrevsDaak> can't blame you for asking because I sometimes put a space in the middle
[16:18:28] <lynxlynxlynx> it's done :)
[16:19:03] <CrevsDaak> thanks
[16:20:58] <lynxlynxlynx> nah, thank you
[16:21:12] <lynxlynxlynx> it's nice to get some reinforcements :)
[16:22:12] <CrevsDaak> heh
[16:22:30] <CrevsDaak> later I could create more weird multiclasses mods if you want
[16:22:54] <lynxlynxlynx> that's up to you
[16:23:14] <lynxlynxlynx> i need to check if they work with newer weidu, there's an ancient bug open about it
[16:24:20] <lynxlynxlynx> anyway, test1-test7 are pretty normal, but then it gets nastier
[16:29:06] <CrevsDaak> test8 is the nastiest imo
[16:30:07] <lynxlynxlynx> mnja
[16:30:53] <lynxlynxlynx> 9's weidu error is also problematic
[16:31:24] <CrevsDaak> what? the layer[1-6]?
[16:32:01] <lynxlynxlynx> on one side it also mangles the comment, so it's all nicely marked for disambiguation purposes, but on the other, that means decompilation must have comments enabled, which can result in a different charset (russian or worse)
[16:32:24] <CrevsDaak> s/[^pP]layer[1-6]/Player[1-6]/g
[16:32:33] <lynxlynxlynx> we'll see once we get there, i think it can be done organically
[16:32:49] <CrevsDaak> what about creating something to remove the comments?
[16:33:00] <lynxlynxlynx> 1. a ? is missing; 2. that could easily match elsewhere erroneusly
[16:33:15] <lynxlynxlynx> weidu has an option for that iirc
[16:34:15] <CrevsDaak> but that can cause weird charset issues unless the file is opened as utf8
[16:34:50] <lynxlynxlynx> exactly
[16:35:54] <lynxlynxlynx> just leave it be for now
[16:36:09] <CrevsDaak> ok
[16:36:25] <CrevsDaak> cpp removes comments
[16:38:09] <CrevsDaak> test9 says Dead("layer6)")
[16:39:11] <lynxlynxlynx> that's the misdecompiled bit
[16:39:33] <lynxlynxlynx> surely you noticed yself sometimes?
[16:41:13] <lynxlynxlynx> --nocom for weidu
[16:46:14] <CrevsDaak> what version of weidu do you have?
[16:48:30] <lynxlynxlynx> 22900
[16:48:54] <CrevsDaak> mm
[16:49:06] <CrevsDaak> update it, latest is 23700
[16:49:44] <CrevsDaak> www.weidu.org/~thebigg/
[16:49:57] <lynxlynxlynx> i know it's old, but so far i haven't needed anything new
[16:58:37] <CrevsDaak> did you try testing with somthing like this:
[16:58:39] <CrevsDaak> IF
[16:58:49] <CrevsDaak> Dead("Player4")
[16:59:02] <CrevsDaak> Dead("Player3")
[16:59:05] <CrevsDaak> THEN
[16:59:09] <CrevsDaak> RESPONSE #10
[16:59:16] <CrevsDaak> Wait(0)
[16:59:18] <CrevsDaak> END
[16:59:38] <CrevsDaak> i haven't got any errors compiling and decompiling that one
[17:02:57] <lynxlynxlynx> i don't know what triggers it or if it has been fixed - my dumps are ancient, only how is semi recent
[17:03:26] <lynxlynxlynx> not something i need to care about now
[17:11:32] <lynxlynxlynx> i want to finish the suite; can we agree on the names and api? I suggest extender.pl which has an extend function that gets these params: input baf handle, output baf handle, max party size
[17:47:51] <CrevsDaak> seems alright for me
[18:27:17] <CrevsDaak> the extender.pl is just going to extend them or it is going to fix the scripts too?
[18:32:56] * CrevsDaak pokes lynx
[18:33:00] <lynxlynxlynx> what do you mean by fix?
[18:33:29] <CrevsDaak> double check everything and re-build
[18:33:54] <lynxlynxlynx> unpack and rebuild is for the wrapper
[18:34:22] <lynxlynxlynx> extend "only" adds all the neeeded new triggers, actions, blocks
[18:34:44] <lynxlynxlynx> we can write the wrapper directly in weidu from the onset
[18:34:53] --> kpedersen has joined #gemrb
[18:35:28] <CrevsDaak> ok, but extend does correct OR blocks and cases like borinall?
[18:37:01] <-- kpederse1 has left IRC (Ping timeout: 255 seconds)
[18:42:04] <lynxlynxlynx> yes, of course
[18:42:21] <lynxlynxlynx> all the magic happens there
[18:42:21] <lynxlynxlynx> the rest is just scaffolding
[18:43:58] <CrevsDaak> ok
[18:44:09] <CrevsDaak> are you writing it right now?
[18:55:06] <lynxlynxlynx> no
[18:56:04] <lynxlynxlynx> i'm doing other stuff while you're starting on the extender, but then my first goal is to get the tests to pass
[18:56:28] <lynxlynxlynx> doesn't make much sense to try to run it on more scripts if we know some cases are not covered yet
[19:07:00] <-- lynxlynxlynx has left IRC (Read error: Connection reset by peer)
[19:08:10] --> lynxlynxlynx has joined #gemrb
[19:08:10] --- ChanServ gives channel operator status to lynxlynxlynx
[19:42:07] <Seniorita> [commit] lynxlynxlynx: guiworld: fixed party reform for how https://github.com/gemrb/gemrb/commit/c7394d34cd2d5c1a885e7957aaeb19ad44bc23ef
[20:28:48] <Seniorita> [commit] lynxlynxlynx: demo: added the iwd2 monk desc test; useless for the crash though https://github.com/gemrb/gemrb/commit/79aa8253e2c1d4946792042f5496dd8336ac0e8a
[21:04:21] <-- CrevsDaak has left IRC (Ping timeout: 250 seconds)
[21:57:51] --> CrevsDaak has joined #gemrb
[22:37:03] <CrevsDaak> lynx
[22:37:33] <lynxlynxlynx> yes
[22:37:37] <CrevsDaak> do you think putting the blocks into an array by using split is ok?
[22:37:56] <CrevsDaak> it would make things like boernall easier imo
[22:38:09] <lynxlynxlynx> yes, there are no other places where newlines are consecutive, so it is safe
[22:38:51] <lynxlynxlynx> maybe not true for dialogs, but that will likely require a separate parser
[22:39:35] <CrevsDaak> so I should match \nIF\n.*[\s]+.*END\n right?
[22:40:25] <CrevsDaak> dialogs are waaay nastier
[22:48:30] <lynxlynxlynx> luckily they offload most work to cutscenes
[22:49:04] <lynxlynxlynx> your pattern is no good for the first and last block, they probably don't have extra newlines
[22:49:42] <lynxlynxlynx> maybe (^|\n) and (\n|$) would work
[22:50:24] <CrevsDaak> ok
[22:50:54] <lynxlynxlynx> but really, IF and END are probably enough
[22:51:21] <lynxlynxlynx> yeah, especially due to their zero indentation
[22:52:15] <lynxlynxlynx> but if you want to keep the newlines, just adding ? after them would do the trick more simply (and loosely)
[22:53:42] <CrevsDaak> the newlines are unessesary
[22:53:52] <CrevsDaak> it'll already match on each block
[23:00:41] <lynxlynxlynx> it would be safer with line bounds, but i'm optimistic
[23:01:33] <lynxlynxlynx> why the [\s]+ though?
[23:02:04] <CrevsDaak> so it matches more than a single line
[23:02:16] <CrevsDaak> . doesn't match \n
[23:05:04] <lynxlynxlynx> .* doesn't match multiline?
[23:06:08] <lynxlynxlynx> wouldn't that only match spaces (with no need for []) and you meant \s\S?
[23:07:14] <lynxlynxlynx> http://perldoc.perl.org/perlcheat.html <-- i have this open from before; you can add /s to the end of the regex if you want . to match \n (eg /foo/bar/s)
[23:07:15] <Seniorita> perlcheat - perldoc.perl.org
[23:07:38] <CrevsDaak> \s is a shortcut for [\n\r\t\f]
[23:07:54] <CrevsDaak> ooh /s seems cool, i'll put that/
[23:10:22] <CrevsDaak> i guess i did it...
[23:10:29] <CrevsDaak> but the other way around xD
[23:10:55] <CrevsDaak> ./extender.pl test8 outputs # bg2 fguad.baf
[23:14:30] <CrevsDaak> (my $foo, my $bar) = split(/,/, "bar,foo");
[23:14:49] <CrevsDaak> replaces the , and gives $foo = bar and vice versa
[23:16:18] <CrevsDaak> changed it to split(/\n\n/, <$file>), still have to test more
[23:21:23] --> Mechanim1l has joined #gemrb
[23:21:27] <lynxlynxlynx> mhm
[23:21:30] <-- Mechanimal has left IRC (Read error: Connection reset by peer)
[23:22:03] --- Mechanim1l is now known as Mechanimal
[23:22:56] <lynxlynxlynx> the first one reads like: 1. find a line with IF, 2. next line whatever and some space (potentially newlines) and more whatever, 3. END
[23:23:30] <lynxlynxlynx> if matching is greedy, this could eat up all interim blocks
[23:23:51] <CrevsDaak> right
[23:24:02] <CrevsDaak> what about replacing every IF by IF\n#
[23:24:20] <CrevsDaak> and then splitting every #
[23:24:37] <CrevsDaak> not legit but easy and hackish
[23:25:21] <lynxlynxlynx> does \n\n in split have problems with the first and last block?
[23:25:40] <lynxlynxlynx> should just work
[23:34:01] <CrevsDaak> yeah that works
[23:34:12] --- CrevsDaak is now known as Crevs_Away
[23:38:37] <lynxlynxlynx> i accidentally reimplemented cat -n
[23:43:53] <lynxlynxlynx> yeah, \n\n works fine
[23:43:56] <lynxlynxlynx> perl -e '$a = $a . $_ while(<>); @a = split /\n\n/, $a; $n=1; foreach $i (@a) { print $n++ . " " . $i . "\n\n"; } print "Total: " . --$n . " blocks\n"' tests/test8
[23:58:29] <lynxlynxlynx> well, i'm off to sleep; please push what you have to the repo once you're done for the day, since we have quite a timezone gap