--- Log opened Thu Sep 17 00:00:20 2015 20150917 00:12:49-!- midzer [~quassel@p4FFCE1F9.dip0.t-ipconnect.de] has quit [Ping timeout: 246 seconds] 20150917 00:13:04-!- midzer [~quassel@p4FFCE1F9.dip0.t-ipconnect.de] has joined #wesnoth-dev 20150917 00:14:48-!- gfgtdf [~chatzilla@f054150069.adsl.alicedsl.de] has quit [Ping timeout: 264 seconds] 20150917 00:28:56< celticminstrel> vultraz Why speaker = wesnoth.get_units(cfg)[1].__cfg ? 20150917 00:42:03-!- Guest90959 [0ecaaf17@gateway/web/freenode/ip.14.202.175.23] has quit [Ping timeout: 246 seconds] 20150917 00:53:04-!- Appleman1234 [~Appleman1@KD111239007043.au-net.ne.jp] has quit [Ping timeout: 246 seconds] 20150917 01:05:07-!- iceiceice [~chris@cpe-67-250-33-238.nyc.res.rr.com] has joined #wesnoth-dev 20150917 01:05:07-!- iceiceice [~chris@cpe-67-250-33-238.nyc.res.rr.com] has quit [Changing host] 20150917 01:05:07-!- iceiceice [~chris@wesnoth/developer/iceiceice] has joined #wesnoth-dev 20150917 01:26:57-!- wedge010 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has joined #wesnoth-dev 20150917 01:30:33-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has quit [Ping timeout: 255 seconds] 20150917 01:30:33-!- wedge010 is now known as wedge009 20150917 01:30:46< vultraz> celticminstrel: why not? 20150917 01:31:07< celticminstrel> You didn't do the same for the get_unit calls. 20150917 01:31:16< celticminstrel> Or do they return a config rather than a proxy? 20150917 01:32:08 * celticminstrel is specifically asking about the __cfg part. 20150917 01:33:07< vultraz> It was just an optimization 20150917 01:33:17< celticminstrel> How so? 20150917 01:34:48< vultraz> Something i usually do in my own code, I don't think it's strictly necessary in this case, but I don't think it will hurt 20150917 01:35:10< celticminstrel> So, if that's the case, shouldn't the same be done to the above get_unit lines as well? 20150917 01:35:30< celticminstrel> ie, wesnoth.get_unit(context.x2, context.y2).__cfg 20150917 01:36:44< celticminstrel> BTW, for tonumber(side) in blah does not work, I had to move the tonumber to a line of its own. 20150917 01:37:05-!- Turuk [~Turuk@cpe-174-97-3-219.cinci.res.rr.com] has joined #wesnoth-dev 20150917 01:37:08-!- Turuk [~Turuk@cpe-174-97-3-219.cinci.res.rr.com] has quit [Changing host] 20150917 01:37:08-!- Turuk [~Turuk@wesnoth/forum-moderator/turuk] has joined #wesnoth-dev 20150917 01:37:24< vultraz> I'm not sure about getunit 20150917 01:38:58< celticminstrel> I guess I'll try it and see, then. 20150917 01:43:18< vultraz> TBH I've never gotten get_unit to work 20150917 01:43:36-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Read error: Connection reset by peer] 20150917 01:43:49< celticminstrel> I think the documentation is a bit wonky there. If I recall correctly, it works if you pass a location but not if you pass an ID. 20150917 01:44:01< celticminstrel> Not quite sure though. 20150917 01:48:57< vultraz> have you gotten everything working? 20150917 01:49:11< celticminstrel> The API function seems to be working very well. 20150917 01:49:19< celticminstrel> Just about to test [message]. 20150917 01:49:28< celticminstrel> I think I've got all the syntax errors fixed, at least. 20150917 01:50:22< celticminstrel> Maybe I'll actually make a separate PR for [object]. 20150917 01:50:40-!- Appleman1234 [~Appleman1@KD106161090030.au-net.ne.jp] has joined #wesnoth-dev 20150917 01:50:51< celticminstrel> Another syntax error. 20150917 01:50:55< vultraz> Oh? 20150917 01:51:00< vultraz> Where 20150917 01:51:07< celticminstrel> Already fixed it. :P 20150917 01:51:20< celticminstrel> It was a wml_message call that I added recently. 20150917 01:51:53< celticminstrel> That should be the last one, because it was right near the end. 20150917 01:54:55< vultraz> This will be good since it actually refactors the message implementation a lot 20150917 01:55:40< celticminstrel> Missing an end somewhere... 20150917 01:56:07< celticminstrel> Found it. 20150917 02:07:57-!- halfspiral [~halfspira@c-174-61-222-16.hsd1.wa.comcast.net] has joined #wesnoth-dev 20150917 02:14:14-!- [Relic] [~Relic]@2602:306:33a3:6d30:70fc:577b:4641:bae9] has quit [Quit: I press the magic X and all the weirdos go away!] 20150917 02:16:35-!- [Relic] [~Relic]@2602:306:33a3:6d30:1178:3b3a:b2fd:3c6b] has joined #wesnoth-dev 20150917 02:19:03< celticminstrel> Looks like wesnoth.select_hex throws an error on invalid values 20150917 02:23:41-!- halfspiral [~halfspira@c-174-61-222-16.hsd1.wa.comcast.net] has quit [Quit: WeeChat 1.1.1] 20150917 02:23:52< celticminstrel> My moveto event is not triggering. 20150917 02:24:50-!- Jozrael [~Jozrael@192.91.144.6] has quit [Ping timeout: 250 seconds] 20150917 02:30:46< celticminstrel> Or... maybe it is. 20150917 02:40:57< celticminstrel> ...wait... the one-argument form of wesnoth.find_unit expects some sort of internal numeric ID of the unit. o.O 20150917 02:41:26< vultraz> this is why I use get_units :P 20150917 02:41:46< celticminstrel> Well, I was using the two-argument form though. 20150917 02:42:08 * vultraz shrugs 20150917 02:42:56< celticminstrel> I have no idea whether it was working. 20150917 02:43:11< celticminstrel> It still seems as though the moveto event might not be triggering. 20150917 02:43:26< vultraz> If you want to get the unit config, I would recommend get_units[1].__cfg for simplicity 20150917 02:43:38< celticminstrel> I'm also getting errors with that. 20150917 02:43:51< vultraz> o_O 20150917 02:43:52< celticminstrel> "Attempt to index field '?' (a nil value)" 20150917 02:43:53< vultraz> wat errors 20150917 02:43:58< vultraz> code? 20150917 02:43:59< celticminstrel> Something like that. 20150917 02:45:01< celticminstrel> First I thought it might be because the filter matched nothing. 20150917 02:45:17< celticminstrel> Then I thought it might be because the speaker was "narrator" and I was trying to index a string. 20150917 02:45:25< celticminstrel> I'll see if I'm right in a minute. 20150917 02:46:21< celticminstrel> If it's the former, it's probably easier to forgo .__cfg 20150917 02:46:34< vultraz> Why? 20150917 02:46:58< celticminstrel> Because that adds a second level of indexing. 20150917 02:47:12< celticminstrel> If I use .__cfg, I need extra logic to check if the filter actually matched something. 20150917 02:47:48< celticminstrel> Here's the code, since you asked (error is in get_speaker): https://gist.github.com/CelticMinstrel/d4262f02688e05c39f1b 20150917 02:48:41< celticminstrel> Well, that fixed it. 20150917 02:48:49< celticminstrel> [message] now does... absolutely nothing. 20150917 02:50:24< vultraz> You could say return speaker[1] 20150917 02:50:28< celticminstrel> Which is something of an improvement. At least there's no errors. 20150917 02:50:43< vultraz> Oh wait, there's that narrator value 20150917 02:50:45< vultraz> blah 20150917 02:51:04< vultraz> why do we need that to be nil again? 20150917 02:51:12< celticminstrel> What? 20150917 02:53:49-!- iceiceice [~chris@wesnoth/developer/iceiceice] has quit [Ping timeout: 256 seconds] 20150917 02:58:12< celticminstrel> Okay, it seems speaker detection is utterly broken, somehow. 20150917 02:58:46< celticminstrel> I have several [message] commands in a row, and only one showed itself - the one with options. 20150917 02:59:04< celticminstrel> Even the one with text input was not shown, but that might be because of the error message filling my screen... 20150917 02:59:56-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has joined #wesnoth-dev 20150917 03:04:24< celticminstrel> Hm, actually, perhaps it could be those nonexistent fields causing trouble... 20150917 03:05:04< celticminstrel> wesnoth.is_skipping_replay and wesnoth.context_skip_messages 20150917 03:05:25< celticminstrel> ...hmm, maybe the latter would make sense shoved into wesnoth.current.event_context... 20150917 03:07:28< celticminstrel> For the former I might instead hard-code it into the implementation of show_message_dialog. 20150917 03:07:51-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has joined #wesnoth-dev 20150917 03:09:03< celticminstrel> Though that would mean you hear the sounds even when skipping replay. Not quite ideal. 20150917 03:14:37< celticminstrel> Text input one shows now, but there's no text input box. 20150917 03:15:03< celticminstrel> The others still aren't showing up at all. I'm not quite sure if it's failure to detect the speaker, or something else. 20150917 03:24:14< celticminstrel> I put a log message when the message is skipped because there's no speaker, and I'm only getting that log message once. 20150917 03:24:37-!- oldlaptop [~quassel@50-107-94-87.adr02.mskg.mi.frontiernet.net] has quit [Ping timeout: 246 seconds] 20150917 03:25:17< vultraz> about the speaker, I think there's some optimizing that could be done there... 20150917 03:25:28< vultraz> instead of copying the config to multiple functions 20150917 03:25:30< celticminstrel> I don't care about optimizing right now. 20150917 03:25:59< celticminstrel> Also, what do you mean, copying? Doesn't Lua pass it by reference? 20150917 03:26:40-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has quit [Disconnected by services] 20150917 03:27:11-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has joined #wesnoth-dev 20150917 03:27:18< vultraz> no, I just meant the functions seem a bit roundabout, it might make debugging harder 20150917 03:27:23< celticminstrel> Maybe. 20150917 03:28:31< vultraz> the config is passed to get_speaker() which is returned as speaker which is passed to build_message_dialog (why do we have this function?) and passed through get_caption and get_image, returned as message_cfg and then fed to message_user_choice() 20150917 03:29:11< celticminstrel> I'm unsure about the choice of separating build_message_dialog from message_user_choice as well... 20150917 03:29:24< celticminstrel> aeth says it's good because of separation of concerns. 20150917 03:29:31< celticminstrel> I'm not sure if I agree. 20150917 03:30:41< celticminstrel> It's annoying how it takes like a minute to build. Surely it should be much faster, considering all it has to do is copy a single text file. 20150917 03:30:50< celticminstrel> Or is it two minutes? I dunno really. 20150917 03:31:13< celticminstrel> I suppose I could edit the version in the app package and copy the code back over once I get it working. 20150917 03:33:23< vultraz> That's what I did when I worked on os x 20150917 03:36:31< vultraz> I also agree with you not agreeing about separating those two functions 20150917 03:38:23< celticminstrel> I think I figured out why the text input doesn't work. 20150917 03:40:29< celticminstrel> Oooh, I think I figured out why normal messages aren't displaying, too. 20150917 03:40:53< celticminstrel> I was calling the message_user_choice function, but what I really needed to call was the function that it returned. 20150917 03:43:47< celticminstrel> Portrait detection isn't working. 20150917 03:43:49< celticminstrel> I think. 20150917 03:44:06< celticminstrel> Seems like nearly everything works now. 20150917 03:44:16< celticminstrel> One more error to fix with text input. 20150917 03:45:47< celticminstrel> Also, speaker=none seems to be raising the "no speaker found" warning. 20150917 03:46:05< celticminstrel> (Which I'll demote to debug in a bit. Or maybe even to info.) 20150917 03:51:53< celticminstrel> Ah, wait, I think I got two different things mixed up (it's image that has a special-case for none). 20150917 03:56:59< aeth> celticminstrel: if you always call synchronize_choice what you can do is move that into the function instead of returning a function 20150917 03:57:12< celticminstrel> I don't always call it. 20150917 03:57:23< aeth> Yes, I mean, if you want to always call it even if it's not always necessary. 20150917 03:57:29< celticminstrel> If there's no options and no text input, then synchronize choice is not called. 20150917 03:57:37< celticminstrel> And I don't see why it should be called. 20150917 03:57:47< aeth> Iirc the examples in the wiki have a lambda function defined within the call to synchronize_choice itself 20150917 03:58:00< celticminstrel> Portrait is working for some but not for others. Hmm. 20150917 03:58:43< aeth> celticminstrel: there's probably something you can do with metatables or something to wrap the ugly API 20150917 04:00:24-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has quit [Ping timeout: 255 seconds] 20150917 04:00:32< aeth> celticminstrel: The idiomatic Lua way to handle ugly APIs is to use some arcane table magic 20150917 04:01:32< celticminstrel> I have zero reason to do that. 20150917 04:01:38< celticminstrel> When I can just alter the API instead. 20150917 04:01:46< aeth> celticminstrel: I agree my solution didn't work because my GUI code is slightly different than yours, and that slight difference makes all the difference. 20150917 04:02:24< aeth> celticminstrel: What you probably could do is keep the three arguments and make each take a function or a table, and if they take a table, make it a list of length two, with the first being the function and the second being the arguments. 20150917 04:02:31< aeth> celticminstrel: That way you can get arguments on all 3 functions 20150917 04:02:46< aeth> {foo, {bar, baz}} for foo(bar, baz) 20150917 04:02:47< aeth> or something 20150917 04:02:54< aeth> An added advantage is that it looks roughly like foo(bar, baz) 20150917 04:05:05< celticminstrel> I'm adding "profile" to the proxy unit metatable. 20150917 04:05:55< aeth> wait, are you adding profile outside of the .__cfg stuff? or is it not in there in the first place for some strange reason? 20150917 04:06:18< celticminstrel> It's in the __cfg stuff. 20150917 04:06:23< celticminstrel> I'm adding it outside. 20150917 04:06:34< aeth> But there's a dozen things more important than profile that are also only in the .__cfg stuff 20150917 04:06:47< aeth> arguably e.g. the unit image will show up in more menus than the profile because it can be inlined with the text in a list of units 20150917 04:07:03< celticminstrel> I was actually thinking of adding image too, but not sure. 20150917 04:07:21< aeth> At least afaik image would be more common than portrait in UMC if you were to convert macros to Lua 20150917 04:07:38< aeth> portraits will *sometimes* show up on selection of a unit. images should almost always show up on lists of units 20150917 04:07:52< aeth> So with a few niche exceptions, images will outnumber portraits afaik 20150917 04:09:21< aeth> Images are already free in Lua (in WML afaik you have to hardcode the paths to the images so it's a bit of work, or at least you had to when I wrote my fancy WML macros years ago) 20150917 04:10:06< vultraz> celticminstrel: adding profile and image to the proxy table? 20150917 04:10:28< celticminstrel> Well, if it doesn't make [message] work I might change my mind, but otherwise yes. 20150917 04:10:57< vultraz> Why not use the .__cfg dump instead 20150917 04:11:12< celticminstrel> For some reason, that's not working for every unit. 20150917 04:11:19< vultraz> Huh 20150917 04:11:20< celticminstrel> So I'm trying this to see if it fixes it. 20150917 04:11:38< aeth> celticminstrel: do you mean units without portraits like e.g. Khalifate? 20150917 04:11:57< aeth> because idk why it wouldn't work on all units 20150917 04:11:59< celticminstrel> No, it was an elvish shaman, but I assume it'd also fail for khalifate. 20150917 04:12:06< aeth> oh 20150917 04:12:10< vultraz> shouldn't get_image have a unit.image fallback? 20150917 04:12:27< aeth> celticminstrel: is there some bug with the way the elvish shaman shows up internally? 20150917 04:12:52< celticminstrel> Not sure. In the [unit_type] I believe elvish shaman doesn't have a profile key. 20150917 04:13:07< celticminstrel> Instead it uses a [portrait] tag. 20150917 04:13:13< vultraz> I removed those 20150917 04:13:16< celticminstrel> I could be mistaken though. 20150917 04:13:24< celticminstrel> Or, okay then. 20150917 04:13:49< celticminstrel> Supposedly the elvish shaman is supposed to always appear on the right, for some reason. 20150917 04:14:21< celticminstrel> According to a comment in the unit_type config file. 20150917 04:14:38< celticminstrel> Well, maybe a comment that vultraz removed, though. 20150917 04:15:01< vultraz> That is trie 20150917 04:15:03< vultraz> true 20150917 04:15:05< vultraz> profile="portraits/elves/shaman.png~RIGHT()" 20150917 04:15:34< celticminstrel> Ah, okay then. 20150917 04:16:54< celticminstrel> Hmm, still not working for the shaman. Might be a different issue then. Once I get it working I'll try it again with __cfg, and if it works I'll remove the addition to the unit proxy table. 20150917 04:16:57-!- Shackra [~Jorge@186.177.2.148] has quit [Ping timeout: 252 seconds] 20150917 04:17:29< vultraz> Ok 20150917 04:17:41< vultraz> Once you're done I'll do some refactoring 20150917 04:17:57< celticminstrel> Not sure I'll be able to finish tonight though. 20150917 04:18:27< celticminstrel> The escape key also doesn't work right now. 20150917 04:18:39< celticminstrel> Oh wait, that could be because I commented out that block. 20150917 04:20:41< celticminstrel> Now escape key works too well. 20150917 04:20:52< vultraz> xD 20150917 04:21:07< celticminstrel> (Blocks all future messages ever, instead of just until the end of the event.) 20150917 04:21:27< vultraz> I assume that's because the switch isn't reset 20150917 04:21:35< celticminstrel> Yup. 20150917 04:21:48< celticminstrel> Let's see if the event context is mutable. 20150917 04:23:16< celticminstrel> Apparently not. Unfortunate. 20150917 04:25:13-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150917 04:26:11< celticminstrel> Ah, it's more that it's reconstructed every time you ask for it. 20150917 04:26:45-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has joined #wesnoth-dev 20150917 04:35:05< celticminstrel> Fixed with a local variable and a wesnoth.game_events.on_event. 20150917 04:35:25< celticminstrel> There's a slightly worrying thing there, though. 20150917 04:35:38< celticminstrel> By default, wesnoth.game_events.on_event is nil. 20150917 04:36:08< celticminstrel> So this could cause some problems if add-ons install their own handler without checking whether there's already a handler installed. 20150917 04:36:43< celticminstrel> I think the only thing still not working is the shaman's portrait. 20150917 04:38:48< celticminstrel> Arif portrait works with __cfg.profile. 20150917 04:38:54< celticminstrel> Or rather, its lack of portrait. 20150917 04:39:00< celticminstrel> I don't understand why the shaman doesn/t 20150917 04:39:03< celticminstrel> ^doesn't 20150917 04:39:07< celticminstrel> :inspect time 20150917 04:39:45< celticminstrel> Maybe it's the hard-coded ~RIGHT()... 20150917 04:40:22< celticminstrel> That shouldn't be it though. 20150917 04:46:08< celticminstrel> Aha, figured it out. 20150917 04:46:26< celticminstrel> gsub takes a regular expression, so parentheses are special characters. 20150917 04:50:00-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has joined #wesnoth-dev 20150917 04:53:06< celticminstrel> Thus it was still had the () at the end of the image name. 20150917 04:53:08< celticminstrel> ^image path 20150917 04:53:14< celticminstrel> ^-was 20150917 04:54:38-!- shadowm is now known as seriousshadowm 20150917 04:54:54< vultraz> ah 20150917 04:55:10< celticminstrel> Works now. Two things left to deal with though. 20150917 04:57:14< celticminstrel> It could also use a bit more extensive testing, but that can wait. 20150917 05:08:19-!- jinblack [~jinblack@128.111.48.6] has quit [Remote host closed the connection] 20150917 05:10:44-!- seriousshadowm is now known as shadowm 20150917 05:13:17-!- oWSLA [629bcbec@gateway/web/freenode/ip.98.155.203.236] has joined #wesnoth-dev 20150917 05:14:35-!- Rhonda [~rhonda@anguilla.noreply.org] has quit [Ping timeout: 265 seconds] 20150917 05:14:41-!- Rhonda [~rhonda@anguilla.noreply.org] has joined #wesnoth-dev 20150917 05:37:19-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has quit [Read error: Connection reset by peer] 20150917 05:37:25-!- ancestral_ [~ancestral@97-116-185-165.mpls.qwest.net] has joined #wesnoth-dev 20150917 05:39:28-!- jinblack [~jinblack@ip184-187-174-107.sb.sd.cox.net] has joined #wesnoth-dev 20150917 05:44:30-!- jinblack [~jinblack@ip184-187-174-107.sb.sd.cox.net] has quit [Ping timeout: 272 seconds] 20150917 05:55:14-!- iceiceice [~chris@ext-74.ias.edu] has joined #wesnoth-dev 20150917 05:55:14-!- iceiceice [~chris@ext-74.ias.edu] has quit [Changing host] 20150917 05:55:14-!- iceiceice [~chris@wesnoth/developer/iceiceice] has joined #wesnoth-dev 20150917 05:56:51-!- jinblack [~jinblack@jinblack.it] has joined #wesnoth-dev 20150917 06:04:20-!- Kwandulin [~Miranda@p5B008FB7.dip0.t-ipconnect.de] has joined #wesnoth-dev 20150917 06:15:34-!- ancestral_ [~ancestral@97-116-185-165.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150917 06:17:39-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has joined #wesnoth-dev 20150917 06:20:50< celticminstrel> vultraz, gfgtdf, aeth, anyone else interested - it's PR492 20150917 06:21:42-!- celticminstrel is now known as celmin|sleep 20150917 06:40:20-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-dev 20150917 06:42:54-!- oWSLA [629bcbec@gateway/web/freenode/ip.98.155.203.236] has quit [Ping timeout: 246 seconds] 20150917 06:47:59-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150917 06:48:48-!- [Relic] [~Relic]@2602:306:33a3:6d30:1178:3b3a:b2fd:3c6b] has quit [Quit: I press the magic X and all the weirdos go away!] 20150917 06:53:34-!- jinblack [~jinblack@jinblack.it] has quit [Ping timeout: 246 seconds] 20150917 06:55:47-!- iceiceice [~chris@wesnoth/developer/iceiceice] has quit [Ping timeout: 256 seconds] 20150917 07:04:04-!- mjs-de [~mjs-de@x4db69dfd.dyn.telefonica.de] has joined #wesnoth-dev 20150917 07:10:45-!- jinblack [~jinblack@jinblack.it] has joined #wesnoth-dev 20150917 07:14:05< shadowm> gfgtdf: 1) Why does the PR description and the first commit message (and diff) call them different things? 20150917 07:14:39< shadowm> wesnoth.get_user_choice(s) in the description vs. wesnoth.synchronize_choice(s) in the commit and code. 20150917 07:14:50-!- Jetrel [~Jetrel@c-73-228-139-39.hsd1.mn.comcast.net] has quit [Ping timeout: 260 seconds] 20150917 07:15:25< shadowm> 2) I guess wesnoth.synchronize_choice will continue to work as it does now, thus not requiring any sort of compatibility path? 20150917 07:17:13< shadowm> 3) I guess it wasn't possible to retrofit the new feature into the existing wesnoth.synchronize_choice function as a third parameter somehow? I usually find the notion of singular_name vs. plural_name APIs confusing, myself. 20150917 07:17:55< shadowm> I don't suppose other people have that problem -- just like most people are able to count past two without breaking their brains. 20150917 07:21:47< shadowm> Can't comment on the code because a) I've never really understood wesnoth.synchronize_choice very well (I don't know MP stuff in general); b) haven't studied ice³'s refactoring of the Lua engine stuff yet and I didn't really understand the Lua engine stuff before anyway. 20150917 07:22:37< shadowm> I know how to add a new function and that's about it. :p 20150917 07:26:01< shadowm> celmin|sleep: https://github.com/CelticMinstrel/wesnoth/commit/e3c643c17950f602a8bb1a78c001e1df16316897 -- Is that massive return table at the end of wml-utils.lua really the only way to achieve whatever it is that needs to be achieved there? :s 20150917 07:27:32< shadowm> (Note: I'm not a Lua expert, I just happen to have learned some Lua by looking at existing examples and by writing my own code. As a rule of thumb, if I haven't done it before, I don't know how it's done.) 20150917 07:28:21< shadowm> Hm, I look at this in more detail later. 20150917 07:42:50-!- prkc [~prkc@catv-89-134-159-103.catv.broadband.hu] has quit [Remote host closed the connection] 20150917 08:17:48-!- jinblack [~jinblack@jinblack.it] has quit [Ping timeout: 255 seconds] 20150917 08:22:58-!- esrever [d285dffb@gateway/web/freenode/ip.210.133.223.251] has joined #wesnoth-dev 20150917 08:23:05-!- joet [~joet@host86-163-221-131.range86-163.btcentralplus.com] has joined #wesnoth-dev 20150917 08:25:39< esrever> Hi all. I'd like to help out the development of the project. To whom I should speak to 20150917 08:29:33< esrever> I'll start from here http://forums.wesnoth.org/viewtopic.php?t=42911 but I'm not sure if my knowledge of C++ an Python is up to the challenge 20150917 08:30:04< esrever> What's the shortest path to find that out? 20150917 08:32:39< esrever> shadown: Hi there. I'd like to help out with the development of the project. I'll start from here http://forums.wesnoth.org/viewtopic.php?t=42911 but I'm not sure if my knowledge of C++ and Python is up to the challenge. What's the shortest path to find that out? you can reach me at chesslp@usa.com Thanks! 20150917 08:33:11< esrever> shadowm: Hi there. I'd like to help out with the development of the project. I'll start from here http://forums.wesnoth.org/viewtopic.php?t=42911 but I'm not sure if my knowledge of C++ and Python is up to the challenge. What's the shortest path to find that out? you can reach me at chesslp@usa.com Thanks! 20150917 08:33:47-!- esrever [d285dffb@gateway/web/freenode/ip.210.133.223.251] has quit [Quit: Page closed] 20150917 08:45:59-!- louis94 [~~louis94@109.129.229.117] has joined #wesnoth-dev 20150917 08:51:24-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has quit [Ping timeout: 264 seconds] 20150917 08:55:14< vultraz> celmin|sleep: echoing above, why do you have the return table? why can't we have a utils namespace if it is needed 20150917 09:13:16-!- louis94 [~~louis94@109.129.229.117] has quit [Quit: Konversation terminated!] 20150917 09:35:43-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has quit [Quit: wedge009] 20150917 09:38:52-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has joined #wesnoth-dev 20150917 10:14:23-!- zombah [~zombah@2a02:28:3:1:214:4fff:fe47:5920] has joined #wesnoth-dev 20150917 10:17:29< vultraz> celmin|sleep: also, you can change line 43 to return "narrator" and at then end do return speaker[1]. Just a small optimization 20150917 10:51:03-!- gfgtdf [~chatzilla@f054136178.adsl.alicedsl.de] has joined #wesnoth-dev 20150917 10:51:24< gfgtdf> 20150917 07:17:13< shadowm> 3) I guess it wasn't possible to retrofit the new feature into the existing wesnoth.synchronize_choice function as a third parameter somehow? I usually find the notion of singular_name vs. plural_name APIs confusing, myself. 20150917 10:53:00< gfgtdf> shadowm: that's the point i coulddo that but then i had a functions with many optional parameters that returns sometimes a wml table and sometimes an array of wml tables. with is alsorather confusin 20150917 10:53:14-!- gfgtdf [~chatzilla@f054136178.adsl.alicedsl.de] has quit [Client Quit] 20150917 11:15:22< celmin|sleep> shadowm/vultraz: Eh... I could initialize a table at the top and assign all the functions to that table, then return it. 20150917 11:29:41-!- danni [~quassel@adsl-au-4-115.ozonline.com.au] has quit [Remote host closed the connection] 20150917 11:35:33-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20150917 11:44:04-!- louis94 [~~louis94@109.129.229.117] has joined #wesnoth-dev 20150917 11:47:04-!- fabi [~quassel@wesnoth/developer/fendrin] has quit [Quit: No Ping reply in 180 seconds.] 20150917 11:48:32-!- fabi [~quassel@176.0.36.112] has joined #wesnoth-dev 20150917 11:48:45-!- fabi [~quassel@176.0.36.112] has quit [Changing host] 20150917 11:48:45-!- fabi [~quassel@wesnoth/developer/fendrin] has joined #wesnoth-dev 20150917 12:00:05-!- {V} [~V@105-70-ftth.on.nl] has quit [Ping timeout: 256 seconds] 20150917 12:11:46-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has joined #wesnoth-dev 20150917 12:12:12< shadowm> celmin|sleep: Yes, that sounds much cleaner than what you currently have. 20150917 12:13:30< shadowm> But again, I don't know what the 'proper' way to do this in Lua actually is, so take with a grain of salt. 20150917 12:21:50-!- shadowm_desktop2 [ignacio@wesnoth/developer/shadowm] has joined #wesnoth-dev 20150917 12:23:46-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has quit [Ping timeout: 240 seconds] 20150917 12:53:40-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has joined #wesnoth-dev 20150917 12:53:55< vultraz> celmin|sleep: that's how helper does itm yes 20150917 12:55:22-!- Kwandulin [~Miranda@p5B008FB7.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20150917 12:55:58-!- shadowm_desktop2 [ignacio@wesnoth/developer/shadowm] has quit [Ping timeout: 260 seconds] 20150917 12:56:24< vultraz> it,* 20150917 12:58:36-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has quit [Read error: Connection reset by peer] 20150917 13:04:00-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has joined #wesnoth-dev 20150917 13:09:38-!- fabi [~quassel@wesnoth/developer/fendrin] has quit [Ping timeout: 250 seconds] 20150917 13:39:10-!- Kwandulin [~Miranda@p5B008FB7.dip0.t-ipconnect.de] has joined #wesnoth-dev 20150917 13:48:27-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has quit [Quit: wedge009] 20150917 13:48:48-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has joined #wesnoth-dev 20150917 13:57:31-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has quit [Quit: wedge009] 20150917 13:57:47-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has joined #wesnoth-dev 20150917 14:00:35-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has quit [Client Quit] 20150917 14:02:23< celmin|sleep> Well, I've already pushed that. Next step is [object]. 20150917 14:03:00< celmin|sleep> And if anyone wants to add to the [message] implementation (or fix something about it), feel free. 20150917 14:03:32-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has joined #wesnoth-dev 20150917 14:04:29-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has quit [Client Quit] 20150917 14:04:46-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has joined #wesnoth-dev 20150917 14:07:21-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has quit [Client Quit] 20150917 14:10:15-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has joined #wesnoth-dev 20150917 14:21:30-!- louis94 [~~louis94@109.129.229.117] has quit [Ping timeout: 240 seconds] 20150917 14:25:27-!- louis94 [~~louis94@109.129.229.117] has joined #wesnoth-dev 20150917 14:26:07-!- mattsc [~mattsc@wesnoth/developer/mattsc] has joined #wesnoth-dev 20150917 14:31:20< celmin|sleep> I have a feeling wesnoth.get_units() is inefficient when you only want one unit. 20150917 14:31:25-!- celmin|sleep is now known as celticminstrel 20150917 14:32:55-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has joined #wesnoth-dev 20150917 14:34:12< mattsc> celticminstrel: wesnoth.get_units() with parameters can be much slower than getting all units and filtering yourself. 20150917 14:34:36< mattsc> Don’t know if that is always true for a single unit, but wesnoth.get_unit() is definitely much faster if you know the coordinates. 20150917 14:35:50< celticminstrel> I imagine it's not too slow if there's only a single unit that matches, the issue is that it goes and finds all units and then you just take the first one, discarding the rest. 20150917 14:36:21< celticminstrel> Basically I think maybe the Lua API needs a "find first matching unit" function. Or maybe a parameter to get_units specifying this. 20150917 14:37:03< celticminstrel> The C++ API has this function, why doesn't the Lua API have it? 20150917 14:37:21< shadowm> get_units is generally assumed to return a table, so you'd want a separate function. 20150917 14:38:21< celticminstrel> Probably best that way, yes, but with an extra parameter it could be something like "return no more than X units". Mind you, if X > 1 then it'll still have to find all matches, so maybe that's pointless. 20150917 14:38:36< celticminstrel> (Assuming the C++ API is unchanged.) 20150917 14:39:44< shadowm> Why: Nobody knows. 20150917 14:40:40< shadowm> The author most likely didn't feel it necessary at that point (premature optimizations, etc.), and since he left prematurely it's unlikely we'll ever know if he had a specific plan in mind. 20150917 14:40:56< celticminstrel> Author of the Lua API? 20150917 14:40:57< shadowm> That point being the same commit that first added Lua support. 20150917 14:41:28-!- iceiceice [~chris@ext-74.ias.edu] has joined #wesnoth-dev 20150917 14:41:28-!- iceiceice [~chris@ext-74.ias.edu] has quit [Changing host] 20150917 14:41:28-!- iceiceice [~chris@wesnoth/developer/iceiceice] has joined #wesnoth-dev 20150917 14:41:38< celticminstrel> The 1-argument get_unit function seems pointless. It appears to expect some sort of internal numeric unit ID. 20150917 14:41:50< celticminstrel> Think that's safe to remove? 20150917 14:41:56< celticminstrel> Not that I intend to just now. 20150917 14:42:27< shadowm> The author of the Lua support patches. 20150917 14:43:16< shadowm> It *may* be used by some crazy people. The id of some sort you mean is actually the unit's underlying id. 20150917 14:43:20< shadowm> I believe you've seen me allude to its existence before. 20150917 14:43:46< celticminstrel> Ah. 20150917 14:44:33< shadowm> Also, today I learned that there actually is a logic behind the weird engine-land Lua callback function names. 20150917 14:44:52< celticminstrel> The intf_ stuff? 20150917 14:45:02< shadowm> intf/impl/cfun/luaW 20150917 14:45:08< celticminstrel> I've started to suspect that that's a shorthand for "interface". 20150917 14:45:23< celticminstrel> While luaW parallels luaL, with W meaning "Wesnoth". 20150917 14:45:33< celticminstrel> Haven't seen any cfun ones, I think. 20150917 14:45:38< shadowm> It's explained in a comment in src/scripting/game_lua_kernel.cpp carried over from the old code from the original author. 20150917 14:45:48< celticminstrel> Ah. 20150917 14:45:50< shadowm> I mean, enumerated, not explained. 20150917 14:45:57< shadowm> It should be pretty obvious what comment I mean. 20150917 14:52:47< celticminstrel> Alright, first-draft [object] completed. 20150917 15:01:08< vultraz> That was fast 20150917 15:01:23< celticminstrel> It's less complicated than [message]. 20150917 15:03:27< vultraz> Your message PR looks fine to me now, BTW 20150917 15:03:42< celticminstrel> I actually changed a couple things a few minutes ago. 20150917 15:03:52< celticminstrel> I'll push them in a minute. 20150917 15:04:53< vultraz> Oh, ok 20150917 15:05:08< vultraz> Only thing I was going to suggest is using utils instead of util for the include in wml_tags 20150917 15:06:19< celticminstrel> Has anyone tested my message PR more extensively than I did? I didn't test any of the fancy features like sides_for or show_if or whether they show during replay. 20150917 15:06:39< vultraz> I just looked over the code 20150917 15:06:44< celticminstrel> I tested various values for speaker and that options and text input work, pretty much. Oh, and that escape works. 20150917 15:08:39< celticminstrel> Pushed. Might rebase it back to 3 commits later. 20150917 15:11:09-!- Jozrael [~Jozrael@192.91.144.19] has joined #wesnoth-dev 20150917 15:26:51< celticminstrel> The wiki example for on_load / on_save uses a value= key, but I can just insert any WML I want, right? 20150917 15:28:54-!- janebot__ is now known as janebot 20150917 15:29:19< celticminstrel> Also, are used object IDs supposed to persist into the next scenario? 20150917 15:29:24-!- janebot is now known as Guest16999 20150917 15:31:25-!- iceiceice [~chris@wesnoth/developer/iceiceice] has quit [Quit: Leaving] 20150917 15:35:24-!- [Relic] [~Relic]@2602:306:33a3:6d30:acec:2539:3e4d:4fea] has joined #wesnoth-dev 20150917 15:44:00-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150917 15:44:22-!- gfgtdf [~chatzilla@f054136178.adsl.alicedsl.de] has joined #wesnoth-dev 20150917 15:44:44< gfgtdf> celticminstrel: you sholdn't depeactehelper.get_user_choice 20150917 15:44:50< celticminstrel> Why not? 20150917 15:44:59< gfgtdf> celticminstrel: if i understodd correctly your new function wirks quite different 20150917 15:45:49< gfgtdf> celticminstrel: specially it is not synced 20150917 15:45:51-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has joined #wesnoth-dev 20150917 15:45:54< celticminstrel> It works more or less the same. The main difference is that get_user_choice pipes through [message], so the input is a valid [message] tag, but I think for the average use case it would be the same. 20150917 15:46:11< celticminstrel> wesnoth.show_message_dialog is not synced. 20150917 15:46:23< gfgtdf> celticminstrel: yes exactly 20150917 15:46:27< celticminstrel> Right. 20150917 15:46:37< gfgtdf> celticminstrel: but get_user_choice is becasue it used [message] 20150917 15:46:41< celticminstrel> Yes. 20150917 15:47:23< gfgtdf> celticminstrel: what you can do though is implemeting get_user_choice dorctly with show_message_dialog and sync_choice instead of using [message]. But i dont know if that much benefit 20150917 15:47:50-!- louis94 [~~louis94@109.129.229.117] has quit [Ping timeout: 240 seconds] 20150917 15:50:41< celticminstrel> I thought of doing that, but it means for backwards compatibility I'd have to translate [message] syntax. 20150917 15:50:58< celticminstrel> I could probably get away with skipping some things, like [show_if]. 20150917 15:52:46< gfgtdf> celticminstrel: also teh message Player isn't controlling side that should .... is not a rwrnign onyl debug message 20150917 15:53:29< celticminstrel> I'm going to assume you're asking me to change it to a debug message. 20150917 15:53:49< gfgtdf> celticminstrel: y its also a debug message in teh origninal code 20150917 15:57:51< gfgtdf> celticminstrel: in the c++ api you can also use options = lua_check >(L, 2) directly 20150917 15:58:17< celticminstrel> Oh, for the options list? 20150917 15:58:50< gfgtdf> y, asssuming the parameter is lua array of lua strings 20150917 15:59:20< celticminstrel> I'm confused. I put {OBJ_STAFF_SPEED} in my scenario, and for some reason the [object] tag is getting called before the objectives dialog shows. 20150917 15:59:36< celticminstrel> Oh wait. 20150917 15:59:53< celticminstrel> Right. I had some [objects] up in the prestart. Duh. 20150917 16:00:12< gfgtdf> celticminstrel: [objects] is completeely unrelated to objectives 20150917 16:00:22< celticminstrel> I know. 20150917 16:00:42< celticminstrel> This does mean my silent logic is wrong though. 20150917 16:05:15-!- boucman_work [~jrosen@wesnoth/developer/boucman] has quit [Ping timeout: 250 seconds] 20150917 16:06:10-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has quit [Ping timeout: 240 seconds] 20150917 16:08:13-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has joined #wesnoth-dev 20150917 16:09:50< gfgtdf> celticminstrel: about object ids: 20150917 16:10:00< gfgtdf> celticminstrel: currently i dont persist in later scenarios 20150917 16:10:19< celticminstrel> I'm asking about current behaviour. 20150917 16:11:04< gfgtdf> celticminstrel: but i really doubt the usefulness of these object ids. 20150917 16:11:12< celticminstrel> Huh? 20150917 16:11:17< gfgtdf> celticminstrel: its quret easy to archieve teh same with variables. 20150917 16:11:18< celticminstrel> What's that supposed to mean? 20150917 16:11:30< celticminstrel> Eh. 20150917 16:11:36< celticminstrel> Doesn't really matter. 20150917 16:11:39< gfgtdf> celticminstrel: i think it would be better of object ids had teh same aeefect as advancement ids 20150917 16:11:43< gfgtdf> celticminstrel: meaing beeing per-unit 20150917 16:12:09< gfgtdf> celticminstrel: i dont rmember in detal 20150917 16:12:12< gfgtdf> detail* 20150917 16:12:13< celticminstrel> No, that doesn't even make sense. 20150917 16:12:31< gfgtdf> celticminstrel: but when i wroity my addon i was quiet annoyed about these object ids 20150917 16:12:32< celticminstrel> The point of them is generally supposed to be so that you can't get a unique item twice. 20150917 16:12:53< celticminstrel> If your [object] does not represent a unique item, then you don't use them. 20150917 16:14:19< gfgtdf> celticminstrel: like i said i dont rmember exatly 20150917 16:14:59< gfgtdf> celticminstrel: also note that current wml codes like https://github.com/wesnoth/wesnoth/blob/master/data/campaigns/Dead_Water/utils/items.cfg#L271 use a wml variale nayway to check that mkaing the id= thing useless in these casres 20150917 16:18:56< celticminstrel> Ah, because they want to give you the choice of whether to pick it up. I don't think it necessarily makes it useless though. 20150917 16:19:19-!- ancestral [~ancestral@97-116-185-165.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150917 16:21:56< celticminstrel> Seems like I can't load saved games in multiplayer scenarios, so I'm unable to test if the persistence part works. 20150917 16:22:25< gfgtdf> celticminstrel: you can, you just need to load them via in multiplayer olobby 20150917 16:22:33< celticminstrel> Tried that. 20150917 16:22:38< celticminstrel> Still crashed. 20150917 16:22:47< gfgtdf> celticminstrel: what exactly does it say ? 20150917 16:22:54< celticminstrel> Also tried "back to turn". That crashed too. 20150917 16:23:09< celticminstrel> EXC_BAD_ACCESS aka segfault. 20150917 16:23:19< gfgtdf> celticminstrel: you have a stacktrace ? 20150917 16:23:28< celticminstrel> Actually, yes I do. 20150917 16:23:59< gfgtdf> celticminstrel: please post it (using some pastebign side maby) 20150917 16:26:14< celticminstrel> http://pastebin.com/raw.php?i=Z9vE3J4U 20150917 16:27:15< celticminstrel> Guessing resources::teams does not exist. 20150917 16:27:16< gfgtdf> celticminstrel: hm ok i know what teh problem is but thats ofr teh back_turn button right ? 20150917 16:27:41< celticminstrel> I tried back to turn last night, that stack trace is from the multiplayer lobby. 20150917 16:28:30< gfgtdf> celticminstrel: hmm right i forgot i changes teh code too 20150917 16:28:33< gfgtdf> celticminstrel: will fix it 20150917 16:28:56< celticminstrel> And I now know how I can get it to work by altering the scenario code. 20150917 16:29:13< celticminstrel> I don't really need the [effect]apply_to=recall_cost test anymore anyway. 20150917 16:30:10< celticminstrel> This crash is even my fault. >_> 20150917 16:30:20< gfgtdf> celticminstrel: qhy ou think that ? 20150917 16:30:25< celticminstrel> I imagine it can probably be fixed by changing the order things are done in. 20150917 16:30:37< celticminstrel> Why? Because I was the one who added [effect]apply_to=recall_cost. 20150917 16:32:19< gfgtdf> celticminstrel: hm no when you aded that line the teams where available at that point i think 20150917 16:32:37< celticminstrel> Were they? I wouldn't know, because I never actually tested loading with that. 20150917 16:32:52< celticminstrel> Didn't even think of it. 20150917 16:33:09< celticminstrel> Anyway, IDs persistence seems to work for my [object]. 20150917 16:33:20< gfgtdf> celticminstrel: how do you store them ? 20150917 16:34:25< celticminstrel> Last thing is to check backwards compatibility. 20150917 16:36:36< celticminstrel> gfgtdf: With on_load/on_save hooks. 20150917 16:36:46< gfgtdf> celticminstrel: hm ok 20150917 16:37:06< celticminstrel> [used_items]staff_of_speed=yes[/used_items] 20150917 16:37:20< celticminstrel> That's how it looks in the saved game file (minus the line breaks and tabs). 20150917 16:42:50-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Quit: Konversation terminated!] 20150917 16:43:43< celticminstrel> For savefile compatibility, do I want saved_game.cpp or savegame.cpp? 20150917 16:43:53-!- ancestral [~ancestral@63.92.240.233] has joined #wesnoth-dev 20150917 16:45:18< celticminstrel> savegame apparently. 20150917 16:47:12< gfgtdf> celticminstrel: y but since those arent in start-of-scenario saves anyway you dont need it 20150917 16:47:26< gfgtdf> celticminstrel: (be default we onyl support start-of-scenario saves form older versions) 20150917 16:47:31< celticminstrel> Ah, okay. 20150917 16:47:45-!- {V} [~V@105-70-ftth.on.nl] has joined #wesnoth-dev 20150917 16:47:45< gfgtdf> celticminstrel: of course you can still so it 20150917 16:47:51< celticminstrel> But that reminds me, do object IDs currently persist to the next scenario? 20150917 16:51:03< celticminstrel> Come to think of it, if they did, Dead Water would only ever let you get one Ring of Strength. 20150917 16:52:23-!- ancestral [~ancestral@63.92.240.233] has quit [Ping timeout: 244 seconds] 20150917 16:52:29-!- prkc [~prkc@catv-89-134-159-103.catv.broadband.hu] has joined #wesnoth-dev 20150917 16:52:47< celticminstrel> Because it has the same ID in every scenario it appears in. 20150917 16:52:51< celticminstrel> So I guess they don't. 20150917 17:03:31-!- zombah [~zombah@2a02:28:3:1:214:4fff:fe47:5920] has quit [Quit: Leaving] 20150917 17:03:37-!- prkc_ [~prkc@catv-89-134-159-103.catv.broadband.hu] has joined #wesnoth-dev 20150917 17:03:48-!- prkc_ [~prkc@catv-89-134-159-103.catv.broadband.hu] has quit [Remote host closed the connection] 20150917 17:06:14< celticminstrel> Okay vultraz, shadowm, aeth, gfgtdf, anyone else interested - PR492 now has Lua [object] as well. 20150917 17:07:59< mattsc> figs 20150917 17:08:25< celticminstrel> Figs? 20150917 17:08:41< mattsc> Mmm, figs. Actually, I should have said: prunes 20150917 17:08:45< mattsc> Sorry, wrong window. 20150917 17:09:40< celticminstrel> I didn't cancel the deprecation of helper.get_user_choice, but that would be easy to do. 20150917 17:13:42< gfgtdf> celticminstrel: why didnt you cancel it ? 20150917 17:13:55< celticminstrel> Mostly, just didn't get around to it? 20150917 17:14:29< gfgtdf> ok 20150917 17:16:34-!- mattsc [~mattsc@wesnoth/developer/mattsc] has quit [Quit: So long and thanks for all the fish.] 20150917 17:21:02-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has quit [Ping timeout: 265 seconds] 20150917 17:22:13< celticminstrel> And the looping tags are now PR493. 20150917 17:22:53< celticminstrel> I'll do [break]/[continue] separately. 20150917 17:26:11< celticminstrel> Mainly these need style review, I guess. PR492 could use a little more testing, but I did do a fair amount of testing with it. 20150917 17:34:13-!- Shackra [~Jorge@186.177.2.148] has joined #wesnoth-dev 20150917 17:36:10< vultraz> if silent == nil then silent = (text:len() == 0) end 20150917 17:36:12< vultraz> interesting 20150917 17:38:00< vultraz> celticminstrel: I would just put a return in a check for silence to keep the main code in toplevel 20150917 17:38:08< vultraz> so, if silent then return end 20150917 17:39:18< vultraz> why the redraw before showing the dialog? 20150917 17:42:30-!- subliun [~quassel@unaffiliated/subliun] has quit [Ping timeout: 260 seconds] 20150917 17:43:58-!- subliun [~quassel@unaffiliated/subliun] has joined #wesnoth-dev 20150917 17:48:46-!- Shackra_ [~Jorge@186.177.2.148] has joined #wesnoth-dev 20150917 17:49:30-!- Shackra [~Jorge@186.177.2.148] has quit [Ping timeout: 240 seconds] 20150917 17:53:58-!- tomreyn [~tomreyn@megaglest/team/tomreyn] has joined #wesnoth-dev 20150917 18:11:07< celticminstrel> vultraz: Not sure, the C++ version had a redraw so I assumed there was a reason. 20150917 18:11:23< celticminstrel> Also, what's interesting? 20150917 18:12:56< celticminstrel> vultraz: I can only do "if silent then return end" if it's acceptable for [then]/[else] to execute before the popup. 20150917 18:13:58< vultraz> why? 20150917 18:14:20< celticminstrel> What do you mean, why? 20150917 18:14:54< vultraz> ah, so it will still execute commands even if silent 20150917 18:14:56< vultraz> right 20150917 18:14:57< vultraz> ok 20150917 18:15:03< celticminstrel> Yes. 20150917 18:15:45< vultraz> as for interesting, I just found the method you used interesting 20150917 18:16:37< celticminstrel> Checking the string length? 20150917 18:18:40< vultraz> Yes 20150917 18:20:30-!- joet [~joet@host86-163-221-131.range86-163.btcentralplus.com] has quit [Ping timeout: 240 seconds] 20150917 18:23:01< celticminstrel> Should I wait for more feedback before merging it? 20150917 18:41:34< vultraz> maybe a little 20150917 18:44:41< celticminstrel> Where's the info on WML test cases? 20150917 18:46:55-!- fabi [~quassel@wesnoth/developer/fendrin] has joined #wesnoth-dev 20150917 18:47:32-!- jinblack [~jinblack@128.111.48.6] has joined #wesnoth-dev 20150917 18:47:57< vultraz> uh not sure 20150917 18:52:19< celticminstrel> Found it. 20150917 18:52:27< celticminstrel> Now I need to remember why I was looking for it... 20150917 18:52:31< celticminstrel> Oh right. 20150917 18:52:40< celticminstrel> The schedule stuff. 20150917 18:54:03< celticminstrel> ...and... it's not even there. 20150917 18:55:41< celticminstrel> Okay. 20150917 19:28:34-!- ancestral [~ancestral@76.sub-70-197-208.myvzw.com] has joined #wesnoth-dev 20150917 19:29:14-!- tomreyn [~tomreyn@megaglest/team/tomreyn] has quit [Quit: tomreyn] 20150917 19:33:55< gfgtdf> celticminstrel: why dos your foreach has a helper.set_variable_array at the end? 20150917 19:35:25-!- ancestral [~ancestral@76.sub-70-197-208.myvzw.com] has quit [Ping timeout: 250 seconds] 20150917 19:35:45-!- Jozrael [~Jozrael@192.91.144.19] has quit [Read error: Connection reset by peer] 20150917 19:36:37< celticminstrel> Uh... I have no idea. 20150917 19:36:52< celticminstrel> I don't think that should be there. 20150917 19:36:59-!- Appleman1234 [~Appleman1@KD106161090030.au-net.ne.jp] has quit [Ping timeout: 240 seconds] 20150917 19:38:20< celticminstrel> Oh wait. 20150917 19:38:54< celticminstrel> It's so that if they changed any elements through $this_item, the changes will be saved. 20150917 19:39:10< celticminstrel> So it should probably be in a "if not cfg.readonly". 20150917 19:40:06< celticminstrel> Setting readonly=yes doesn't stop you from mutating the array through $array[$i] though. 20150917 19:40:13-!- jinblack [~jinblack@128.111.48.6] has quit [Ping timeout: 256 seconds] 20150917 19:41:07< celticminstrel> On the other hand, assuming I make the change I just mentioned, setting readonly=no will mean that any mutations through $array[$i] are overwritten. 20150917 19:52:30< vultraz> I can't remember why you said we had both for and foreach 20150917 19:53:09< celticminstrel> [foreach] is an opaque foreach statement, while [for] is a for-range statement. 20150917 19:54:43< celticminstrel> Alright! I have altered run_wml_tests so that it works for me. 20150917 19:55:23-!- jinblack [~jinblack@128.111.48.6] has joined #wesnoth-dev 20150917 19:55:25< celticminstrel> Though it looks like a timeout of 20 seconds isn't enough. 20150917 19:59:38< gfgtdf> you know if there is some notification message similar to chatmesseges that last forever until i remove them manually? 20150917 20:00:10< celticminstrel> Huh? 20150917 20:01:08< gfgtdf> hmm i guess ad_floating label is what i want 20150917 20:18:53-!- jcnewjersey [~jcnewjers@pool-108-35-38-39.nwrknj.fios.verizon.net] has joined #wesnoth-dev 20150917 20:21:11-!- Kwandulin [~Miranda@p5B008FB7.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20150917 20:30:29-!- tomreyn [~tomreyn@megaglest/team/tomreyn] has joined #wesnoth-dev 20150917 20:30:30-!- Shackra_ [~Jorge@186.177.2.148] has quit [Ping timeout: 260 seconds] 20150917 20:34:00-!- Samual [~Samual@xonotic/core-team/Samual] has quit [Ping timeout: 255 seconds] 20150917 20:34:22-!- Appleman1234 [~Appleman1@KD118156250060.au-net.ne.jp] has joined #wesnoth-dev 20150917 20:35:10-!- jcnewjersey [~jcnewjers@pool-108-35-38-39.nwrknj.fios.verizon.net] has quit [Read error: Connection reset by peer] 20150917 20:44:58-!- Samual [~Samual@xonotic/core-team/Samual] has joined #wesnoth-dev 20150917 20:48:03-!- boucman [~rosen@wesnoth/developer/boucman] has joined #wesnoth-dev 20150917 20:51:20-!- Jozrael [~Jozrael@192.91.144.6] has joined #wesnoth-dev 20150917 21:02:21-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has joined #wesnoth-dev 20150917 21:03:23< shadowm> `git blame` and `git log -p` are useful tool if you need to figure out why a particular piece of code exists. 20150917 21:03:30< shadowm> Tools, too. 20150917 21:04:30< celticminstrel> Have you seen my PR492/3? 20150917 21:05:01< shadowm> I've not had time to take a look at it/them yet. 20150917 21:05:11< celticminstrel> Okay. 20150917 21:05:41 * celticminstrel is currently working on break/continue. 20150917 21:17:41-!- joet [~joet@host86-163-221-131.range86-163.btcentralplus.com] has joined #wesnoth-dev 20150917 21:20:10< gfgtdf> celticminstrel: you have a usecase for [found_item] tag? 20150917 21:20:51-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has left #wesnoth-dev [] 20150917 21:22:29-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20150917 21:25:22-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has joined #wesnoth-dev 20150917 21:25:36< celticminstrel> Whoops. 20150917 21:28:47< gfgtdf> celticminstrel: ? 20150917 21:29:58< celticminstrel> Accidentally closed the channel. 20150917 21:31:07-!- joet [~joet@host86-163-221-131.range86-163.btcentralplus.com] has quit [Ping timeout: 250 seconds] 20150917 21:31:59< celticminstrel> I think [found_item] could be used in Dead Water, for example - that section you linked to me before. 20150917 21:32:16< celticminstrel> Instead of setting ring_x to 999, it could put [found_item] in a [filter_condition]. 20150917 21:32:39< celticminstrel> Well, it'd be [not][found_item], but still. 20150917 21:32:57< celticminstrel> I didn't have any particular usecase in mind when I added it, but it seemed like something that could be useful. 20150917 21:33:02< gfgtdf> celticminstrel: hmm ok. 20150917 21:33:07< gfgtdf> celticminstrel: another issue: 20150917 21:33:53< gfgtdf> celticminstrel: teh oudn items are stored in a single [used_items] with the its beeing the attribute keys? 20150917 21:33:56< gfgtdf> found* 20150917 21:34:11< celticminstrel> Yes. 20150917 21:34:18< celticminstrel> The IDs are the attribute keys. 20150917 21:35:05< gfgtdf> celticminstrel: im not 100% sure but i think this could casue bugs if the ids have strange characters in them, like '=' im not even sure it it can handle spaces 20150917 21:35:45< celticminstrel> I can see your point. I doubt most people put such characters in (except maybe spaces), but... 20150917 21:36:23< gfgtdf> celticminstrel: y the '=' is quite exotic but spaces arent that uncommon i think 20150917 21:36:43< celticminstrel> If spaces are the only problem, I can convert them to underscores. 20150917 21:37:03< celticminstrel> I highly doubt someone would use two IDs that only differ in spaces vs underscores. 20150917 21:37:03-!- [Relic] [~Relic]@2602:306:33a3:6d30:acec:2539:3e4d:4fea] has quit [Quit: I press the magic X and all the weirdos go away!] 20150917 21:37:46< gfgtdf> celticminstrel: i still think its good diea to tet if it also works correctly with a it with a space in it when relaoding 20150917 21:37:51-!- louis94 [~~louis94@109.129.229.117] has joined #wesnoth-dev 20150917 21:37:56< gfgtdf> idea to test* 20150917 21:38:04< gfgtdf> it/id* 20150917 21:38:39< celticminstrel> I'm pretty sure that wouldn't work. 20150917 21:41:23< gfgtdf> celticminstrel: then i think saving it in this format isnt a good idea 20150917 21:41:37< celticminstrel> I disagree. 20150917 21:41:46< gfgtdf> celticminstrel: why? 20150917 21:41:55< celticminstrel> However, since it wasn't saved in this format before, I'd be willing to change it to match the old format. 20150917 21:42:38< celticminstrel> Why? Because it's the logical way to store a set of values in key-value format. 20150917 21:44:11< gfgtdf> celticminstrel: hmm yes but thats not something the preople who use [object] care about. 20150917 21:44:52< celticminstrel> The old format would break if an ID contained a comma. 20150917 21:45:42< gfgtdf> celticminstrel: yes i know, but spaces re mor common taht commas 20150917 21:45:45< gfgtdf> are* 20150917 21:48:26-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Ping timeout: 272 seconds] 20150917 21:48:29< celticminstrel> The WML unit tests are excruciatingly slow. 20150917 21:50:21< gfgtdf> celticminstrel: hmm is it ok for you if i already merge the [message] part? I want to change some parts of the c++ get_user_choice interface whcih woudl conflict with your pr otherwise 20150917 21:50:32< Aginor> http://mobile.slashdot.org/story/15/09/17/1752210/d-link-accidentally-publishes-private-code-signing-keys 20150917 21:50:37< Aginor> whops, sorry 20150917 21:50:39< Aginor> wrong window 20150917 21:51:57< celticminstrel> I feel like the very act of merging it is likely to result in conflicts... 20150917 21:52:08< celticminstrel> I'm hoping to get it merged today, though. 20150917 21:53:45-!- stikonas_ [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20150917 21:53:49-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Read error: Connection reset by peer] 20150917 21:54:09-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth-dev 20150917 21:57:14-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20150917 21:58:29-!- stikonas_ [~gentoo@wesnoth/translator/stikonas] has quit [Ping timeout: 256 seconds] 20150917 22:01:19< celticminstrel> I've changed the save-file format back to the used_items="comma,separated,list" format. 20150917 22:01:55< gfgtdf> celticminstrel: hm ok 20150917 22:02:52< celticminstrel> Testing now, then I'll push. 20150917 22:03:00< celticminstrel> Assuming of course that it works. 20150917 22:08:22-!- mjs-de [~mjs-de@x4db69dfd.dyn.telefonica.de] has quit [Remote host closed the connection] 20150917 22:09:39-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 240 seconds] 20150917 22:30:42-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has quit [Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] 20150917 22:31:05-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has joined #wesnoth-dev 20150917 22:39:06-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Ping timeout: 272 seconds] 20150917 22:40:00-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth-dev 20150917 22:43:03-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Remote host closed the connection] 20150917 22:43:03-!- joet [~joet@host86-163-221-131.range86-163.btcentralplus.com] has joined #wesnoth-dev 20150917 22:49:03-!- joet [~joet@host86-163-221-131.range86-163.btcentralplus.com] has quit [Ping timeout: 252 seconds] 20150917 22:50:19-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20150917 22:56:27-!- boucman [~rosen@wesnoth/developer/boucman] has quit [Remote host closed the connection] 20150917 23:01:27< Aginor> gfgtdf: are you looking at https://github.com/wesnoth/wesnoth/pull/494 ? 20150917 23:11:06< celticminstrel> Ah, I see. It seems that the Lua on_load hook only supports saving data as subtags, not as toplevel attributes. 20150917 23:11:41< celticminstrel> So my plan to revert to the old format would require altering that. 20150917 23:11:46< celticminstrel> gfgtdf: Thoughts? 20150917 23:18:56< celticminstrel> I'll probably revert to the original format, but with an extra line to transform spaces to underscores. 20150917 23:19:09< celticminstrel> ie, the [used_items] tag. 20150917 23:26:08-!- louis94 [~~louis94@109.129.229.117] has quit [Quit: Konversation terminated!] 20150917 23:32:36< gfgtdf> Aginor: i just said what i thought 20150917 23:36:35< gfgtdf> celticminstrel: hmm maybe you coudl just write on [used_item]is=itemid[used_item] for every item (like wml arrays do) 20150917 23:36:58< gfgtdf> celticminstrel: also teh helper fnction is still deprecated 20150917 23:37:05< celticminstrel> Oh right. 20150917 23:37:37< celticminstrel> I suppose I could use an array, but I don't see why allowing weird characters is important. 20150917 23:37:59< shadowm> If you pass a shared_ptr by reference then you might as well pass the underlying naked pointer instead. :| 20150917 23:38:26< celticminstrel> shadowm: Do you have an opinion on allowing arbitrary characters in [object]id=? 20150917 23:38:43< gfgtdf> shadowm: hm passing by reference allows you to make a copy if you want 20150917 23:38:43< celticminstrel> The C++ implementation did allow it (except commas). 20150917 23:39:00< gfgtdf> celticminstrel: treating spaces like _ is finy by me 20150917 23:39:06< shadowm> Yes. We need an API to declare left-side-safe attribute values. 20150917 23:39:16-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Ping timeout: 272 seconds] 20150917 23:39:33< shadowm> This would amongst other things solve the longstanding save-killing WML variables exploit. 20150917 23:39:51< celticminstrel> Okay. 20150917 23:39:55< gfgtdf> shadowm: what is teh save killing explit ? 20150917 23:40:02< shadowm> {VARIABLE =foo bar} 20150917 23:40:14< shadowm> {VARIABLE "f o o" bar} 20150917 23:40:19< shadowm> {VARIABLE = bar} 20150917 23:40:23< shadowm> Et cetera. 20150917 23:41:12< shadowm> It's the most popular (by which I mean it's known and used on purpose by some authors) but not the only one. 20150917 23:41:34< gfgtdf> shadowm: why woudl anyone do that ? :o 20150917 23:42:07< shadowm> This is used by some people of questionable morality in lieu of an officially-sanctioned mechanism to disable saves for a particular scenario at the code's request. 20150917 23:42:46< shadowm> It also occasionally happens by accident (e.g. {VARIABLE $this_variable_does_not_exist_yet value}). 20150917 23:45:14< gfgtdf> shadowm: hm ok 20150917 23:50:47< celticminstrel> Updated PR492, removing deprecation and doing the spaces conversion thing. 20150917 23:54:31-!- Jozrael [~Jozrael@192.91.144.6] has quit [Ping timeout: 246 seconds] 20150917 23:59:40< gfgtdf> celticminstrel: the check_key print an erro about [object] but can also used outside object 20150917 23:59:53< celticminstrel> gfgtdf: Oh, right. --- Log closed Fri Sep 18 00:00:07 2015