--- Log opened Sun Mar 27 00:00:24 2016 20160327 00:12:04-!- Appleman1234 [~Appleman1@KD106161138227.au-net.ne.jp] has quit [Read error: Connection reset by peer] 20160327 00:18:45< aeth> Is there a way to tell the map or should I just set a variable? 20160327 00:19:38-!- Appleman1234 [~Appleman1@KD106161138227.au-net.ne.jp] has joined #wesnoth 20160327 00:22:36-!- Haldrik [~haldrik@unaffiliated/haldrik] has quit [Quit: Haldrik] 20160327 00:24:48< zookeeper> ..what? 20160327 00:26:02< aeth> zookeeper: If I only want certain Lua to be available on certain scenarios or maps (doesn't matter, no maps are shared), but otherwise keep all the Lua code in common, is there a way to do that? 20160327 00:26:56< aeth> I guess I could do some hack like make every map size different, but it doesn't look like there's a general solution available. http://wiki.wesnoth.org/LuaWML#Map_and_terrains 20160327 00:27:44< aeth> So the easiest thing I can think of is to just set a global variable from the WML for each scenario and otherwise keep the stuff in common. 20160327 00:29:27< celticminstrel> So basically you want a way to get the ID of the current scenario? 20160327 00:30:10< aeth> Sort of. Any way to distinguish between my scenarios. (Also, my MP campaign system is non-linear, any map can lead to any other map.) 20160327 00:31:33< aeth> It doesn't need to work on other maps. 20160327 00:33:56< aeth> If it sounds like I am treating maps/scenarios equivalently it's because I don't really have scenarios, just a bunch of Lua that's run on all maps and the minimum amount of WML needed to get to this. 20160327 00:34:27< celticminstrel> I think the setting a global variable field might be the only way. 20160327 00:34:46< celticminstrel> ^-field 20160327 00:35:30< zookeeper> yeah, seems like the simplest solution 20160327 00:56:12-!- Ravana_ [~Ravana@unaffiliated/ravana/x-2327071] has quit [Ping timeout: 276 seconds] 20160327 01:04:30-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth 20160327 01:08:37-!- Ravana_ [~Ravana@unaffiliated/ravana/x-2327071] has joined #wesnoth 20160327 01:11:05-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 244 seconds] 20160327 01:14:57-!- DreadKnight [~DreadKnig@unaffiliated/dreadknight] has joined #wesnoth 20160327 01:25:49-!- trewe [~trewe@bl20-31-249.dsl.telepac.pt] has quit [Quit: quit] 20160327 01:26:10-!- prkc [~prkc@540265D3.dsl.pool.telekom.hu] has quit [Quit: Leaving] 20160327 01:46:41-!- wario [~wario_@unaffiliated/wario] has joined #wesnoth 20160327 02:04:53-!- Haudegen [~quassel@85.124.51.57] has quit [Ping timeout: 268 seconds] 20160327 02:14:58-!- Haudegen [~quassel@85.124.51.57] has joined #wesnoth 20160327 02:22:03-!- wario [~wario_@unaffiliated/wario] has quit [Quit: Leaving] 20160327 02:27:54-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has joined #wesnoth 20160327 02:39:01-!- ArneBab_ [~quassel@55d41ec6.access.ecotel.net] has joined #wesnoth 20160327 02:43:12-!- ArneBab [~quassel@55d445dc.access.ecotel.net] has quit [Ping timeout: 260 seconds] 20160327 02:51:08-!- Narrat [~Narrat@p548DD64D.dip0.t-ipconnect.de] has quit [Quit: They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.] 20160327 02:55:09< aeth> ugh 20160327 02:55:26< aeth> wesnoth.match_unit is pretty much exactly what I need and it's 1.13-only 20160327 02:55:47< aeth> actually, it's not what I need. 20160327 02:57:04< aeth> I'd need something like .match_all_units, which I could implement myself, but not efficiently. 20160327 02:59:41< celticminstrel> So you need to test that a filter matches every unit? 20160327 02:59:48< aeth> yes 20160327 03:00:07< celticminstrel> Could you use get_units twice and compare the lengths? 20160327 03:00:33< aeth> I need to basically implement my own status effects by doing an action to a tagged unit (so unit.foo_variable = 1 or something) each turn until it wears off 20160327 03:00:38< aeth> for all tagged units 20160327 03:01:17< celticminstrel> It still sounds like wesnoth.get_units is what you want... 20160327 03:01:39< aeth> ah 20160327 03:02:11< aeth> I would have never thought about it like that because I'm doing almost everything in Lua and that's basically described as "WML filter" 20160327 03:02:18< aeth> But I guess the variables *would* be visible through WML too 20160327 03:02:31< celticminstrel> Well, match_unit is also a WML filter. 20160327 03:02:48< celticminstrel> A standard unit filter, to be precise. 20160327 03:02:58< aeth> yes, but with the name it's more obvious what it does 20160327 03:03:18< celticminstrel> Huh? 20160327 03:03:20< aeth> If I were to name the API, get_units would be match_units because it's more like match_unit than get_unit 20160327 03:03:28< aeth> I use get_unit all the time, with coordinates. 20160327 03:03:52< celticminstrel> It's not really like match_unit in my opinion - it returns a list of units, not a boolean. 20160327 03:04:09< vultraz> it's very common to use get_units({})[1] 20160327 03:04:13< aeth> ah, true 20160327 03:04:49< aeth> vultraz: Well, I don't really need get_units({})[1] since these are custom multi-turn, but finite potion effects. 20160327 03:05:06< aeth> So every unit that has one should have it applied, and then have their variable decremented. 20160327 03:05:39< celticminstrel> So loop through get_units{T.filter_wml{whatever}}? 20160327 03:05:56< vultraz> https://github.com/Vultraz/Shadows_of_Deception/blob/master/lua/gui/spellcasting.lua#L137 20160327 03:06:02< vultraz> i did something similar 20160327 03:06:06< vultraz> might be good reference 20160327 03:06:26< celticminstrel> Oh, if the variable is an integer rather than a boolean you probably need something like T.not{T.filter_wml{whatever}} 20160327 03:06:27< aeth> celticminstrel: Yes. I might have done this a long time ago, I don't remember. For some reason, I messed it up miserably, and introduced all sorts of bugs, and so I removed the whole thing. 20160327 03:06:44< aeth> celticminstrel: integer and > 0 20160327 03:06:55< aeth> Since if it had the effect, but got it decremented to 0, it shouldn't have it anymore 20160327 03:07:02< celticminstrel> Will it ever be set to a negative number? 20160327 03:07:08< aeth> not on purpose 20160327 03:07:48< celticminstrel> Then I think T["not"] {T.filter_wml {T.variables {variable = 0}}} should work as a filter. 20160327 03:07:56< aeth> if it applies for 10 turns it'd go (apply it immediately and set var to 9), 9 (apply one-turn effect again and decrement), 8, 7, 6, 5, 4, 3, 2, 1, 0 (don't apply it) 20160327 03:09:28< celticminstrel> Maybe I should expose the WML variables to formulas, then you could just use get_units{formula = "variables.whatever > 0"}. Of course, that'd be 1.13 only though, so not much help to you at the moment. 20160327 03:10:02< aeth> well, yeah, but there's lots of edge cases I discovered in my rather elaborate mod, such as not being able to set a text_input in gui2 as focused via Lua (fixed in 1.13) 20160327 03:10:26< aeth> That's just what happens when I mod things that no one has modded, or at least no one has both modded and reported to the devs when it isn't working elegantly. 20160327 03:11:06< aeth> So it'll never really be "complete" until 1.13. I might even do something fancy to have two separate versions supported in the same code, and remove the 1.12 stuff when 1.14 is out. 20160327 03:11:49< aeth> Another edge case is apparently I can't access the terrain icons from Lua (for menus... this could even be used in mainline, like ANL, if it ever got ported to GUI2) 20160327 03:12:07< aeth> I'm not sure if this ever got fixed for 1.13 or not. I will probably have to do pull requests because a lot of these are trivial one line oversights. 20160327 03:14:03< celticminstrel> Terrain icons? 20160327 03:14:20< celticminstrel> Like the little icons that show on the sidebar? 20160327 03:14:33< aeth> Yes. 20160327 03:14:48< celticminstrel> That sounds like something that's either already possible or that, like you said, only requires one line added to make it possible. 20160327 03:14:49< aeth> There's no way to programmatically access the terrain icons from Lua (or at least not in 1.12) for use in e.g. menus 20160327 03:15:05< aeth> I brought it up in the fall. If no one got to it, I think it's literally one line of C++ 20160327 03:15:12< aeth> iirc 20160327 03:15:28< celticminstrel> I guess this is for something like "set the menuitem icon to match the terrain clicked on". 20160327 03:15:32< aeth> There are a lot of very small changes that I need to remember to either remind people of or submit pull request for before the 1.13 feature freeze 20160327 03:16:07< aeth> celticminstrel: well, not the terrain clicked on. e.g. in ANL you change the terrain type, so it would be the terrain you'd *want* (if given the terrain tag) 20160327 03:16:27< aeth> So instead of hardcoding the path to the image in a macro (which I think is what's currently done), which can obviously break at any time in the dev version, you can just remember "Gg" 20160327 03:17:05< celticminstrel> Okay. I have never tried ANL. 20160327 03:17:55< shadowm> File pull requests instead of hoping people will remember an IRC conversation months later. 20160327 03:18:02< shadowm> s/pull/feature/ 20160327 03:18:41< celticminstrel> Yeah, I tend to forget these conversations pretty quickly. 20160327 03:18:43< aeth> shadowm: No, I mean, I don't know if someone fixed it in 2 seconds when I brought it up months ago or if I need to do a pull request, since most of the things I spot are so trivial. 20160327 03:18:54< aeth> Since I don't use the devel version because I do MP content. 20160327 03:18:58< shadowm> Time isn't trivial, unfortunately. 20160327 03:19:44< shadowm> Very often people are on IRC either relaxing or attending to something else right before leaving, so it's not very often that you can throw ideas at a developer and get them to start working on them immediately. 20160327 03:20:14< shadowm> And generally, if something isn't in the changelog and it isn't in the wiki, it doesn't exist. 20160327 03:21:00< aeth> I know. 20160327 03:21:28< aeth> What I'm saying is that I literally don't know if someone randomly made the change or not because it's been months, even though it's unlikely. 20160327 03:22:26< celticminstrel> Then check? :P 20160327 03:23:02< shadowm> Also, perhaps this is just me, but in the past whenever someone has posted an idea and I've implemented it later, I make sure to notify them in some fashion ASAP. 20160327 03:23:25< shadowm> I believe this is basic courtesy and trust that most other Wesnoth developers do the same. 20160327 03:24:10< aeth> shadowm: yes, but my IRC client only picks up "^aeth: " for some reason, so I have missed message before. 20160327 03:24:23< aeth> I only know that I have missed messages because ancestral has poked me in another channel when that happens. 20160327 03:24:30< celticminstrel> I suppose it's also possible that someone implemented it without realizing that someone else suggested it. 20160327 03:49:59< aeth> Oh, also, if I lose power (which happens too often) I am not going to check logs for mentions of me when my account was online but I wasn't because I am poked very rarely. 20160327 03:50:19< aeth> I probably should be doing that. 20160327 03:58:45< aeth> Wow. Right around when I said "I have missed messages before" I received a message on another channel that my client didn't pick up as a message directed at me. What a coincidence. 20160327 04:19:23-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20160327 04:27:42-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has joined #wesnoth 20160327 05:14:03-!- mattsc [~mattsc@wesnoth/developer/mattsc] has quit [Ping timeout: 240 seconds] 20160327 05:14:21-!- ToBeCloud [uid51591@wikimedia/ToBeFree] has quit [Quit: Connection closed for inactivity] 20160327 05:22:55-!- mattsc [~mattsc@wesnoth/developer/mattsc] has joined #wesnoth 20160327 06:38:29-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20160327 06:48:40-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has quit [Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] 20160327 07:32:37-!- Kwandulin [~Miranda@p200300760F191C9238214AA1C74AE295.dip0.t-ipconnect.de] has joined #wesnoth 20160327 08:13:58-!- vn971 [~vasya@0896414046.static.corbina.ru] has quit [Quit: Leaving.] 20160327 08:30:22-!- DeFender1031 [~DeFender1@cbl217-132-134-6.bb.netvision.net.il] has joined #wesnoth 20160327 08:53:50-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth 20160327 09:38:52-!- Haldrik [~haldrik@unaffiliated/haldrik] has joined #wesnoth 20160327 10:18:18-!- claymore2 [~hexchat@host86-165-180-50.range86-165.btcentralplus.com] has joined #wesnoth 20160327 10:28:22-!- wario [~wario_@unaffiliated/wario] has joined #wesnoth 20160327 10:53:33-!- Haudegen [~quassel@85.124.51.57] has quit [Ping timeout: 276 seconds] 20160327 11:23:28-!- Kwandulin [~Miranda@p200300760F191C9238214AA1C74AE295.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20160327 11:24:18-!- Haudegen [~quassel@85.124.51.57] has joined #wesnoth 20160327 11:52:42-!- claymore2 [~hexchat@host86-165-180-50.range86-165.btcentralplus.com] has quit [Quit: Leaving] 20160327 12:59:35-!- Alduin_ [~Alduin@p2003008644399000E29467FFFE0EE8C4.dip0.t-ipconnect.de] has joined #wesnoth 20160327 13:15:05-!- Kwandulin [~Miranda@p200300760F191C5C35492131FAAF22C6.dip0.t-ipconnect.de] has joined #wesnoth 20160327 13:21:22-!- Alduin_ [~Alduin@p2003008644399000E29467FFFE0EE8C4.dip0.t-ipconnect.de] has quit [Ping timeout: 268 seconds] 20160327 13:52:02-!- DreadKnight [~DreadKnig@unaffiliated/dreadknight] has quit [Quit: #AncientBeast - Master Your Beasts ( www.AncientBeast.com )] 20160327 14:14:24-!- Haudegen [~quassel@85.124.51.57] has quit [Ping timeout: 276 seconds] 20160327 14:38:08-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has joined #wesnoth 20160327 14:47:05-!- Haudegen [~quassel@85.124.51.57] has joined #wesnoth 20160327 14:49:32-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has joined #wesnoth 20160327 15:48:50-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20160327 15:55:08-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth 20160327 16:00:52-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20160327 16:07:12-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has joined #wesnoth 20160327 16:18:48-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20160327 16:22:37-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has joined #wesnoth 20160327 17:18:20-!- vn971 [~vasya@91.247.233.240] has joined #wesnoth 20160327 17:29:57-!- Ravana_ [~Ravana@unaffiliated/ravana/x-2327071] has quit [Disconnected by services] 20160327 17:30:27-!- Ravana_ [~Ravana@unaffiliated/ravana/x-2327071] has joined #wesnoth 20160327 17:49:24-!- ToBeCloud [uid51591@wikimedia/ToBeFree] has joined #wesnoth 20160327 18:01:05-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20160327 18:37:05-!- irco [~irco@p5B373AD8.dip0.t-ipconnect.de] has joined #wesnoth 20160327 18:43:20-!- cyphase [~cyphase@unaffiliated/cyphase] has joined #wesnoth 20160327 18:50:06-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20160327 18:54:35-!- Alduin_ [~Alduin@p2003008644399000E29467FFFE0EE8C4.dip0.t-ipconnect.de] has joined #wesnoth 20160327 19:02:14-!- Alduin_ [~Alduin@p2003008644399000E29467FFFE0EE8C4.dip0.t-ipconnect.de] has quit [Ping timeout: 250 seconds] 20160327 19:14:16< celticminstrel> aeth: https://github.com/wesnoth/wesnoth/commit/503c2f01aedb7378f7f3404fbcf650351569f017 20160327 19:43:15< aeth> oops, it's two lines 20160327 19:44:49< aeth> celticminstrel: thanks 20160327 19:48:09< aeth> (two lines per exposed thing to the Lua API, I mean) 20160327 19:48:59< celticminstrel> It depends, really. If it was in the unit proxy table, it'd be one line, as long as it's a simple attribute. 20160327 19:50:27-!- irco [~irco@p5B373AD8.dip0.t-ipconnect.de] has quit [Ping timeout: 276 seconds] 20160327 19:50:32< aeth> iirc, I did this change (only icon and editor_image) a while back (November?) and didn't pull request it. I'm not sure why. 20160327 19:50:59< aeth> Probably because I hit a massive wall in my add-on that required me to rewrite most of it, again. 20160327 19:51:10< aeth> And I took a few months off of working on it because of that. 20160327 19:55:09-!- irco [~irco@p5B373AD8.dip0.t-ipconnect.de] has joined #wesnoth 20160327 20:38:33-!- irco [~irco@p5B373AD8.dip0.t-ipconnect.de] has quit [Ping timeout: 276 seconds] 20160327 20:46:21-!- Kwandulin [~Miranda@p200300760F191C5C35492131FAAF22C6.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20160327 20:53:34-!- irco [~irco@p5B373AD8.dip0.t-ipconnect.de] has joined #wesnoth 20160327 21:19:22-!- Narrat [~Narrat@p548DD64D.dip0.t-ipconnect.de] has joined #wesnoth 20160327 21:39:03-!- Appleman1234 [~Appleman1@KD106161138227.au-net.ne.jp] has quit [Ping timeout: 240 seconds] 20160327 21:39:32-!- prkc [~prkc@108.61.123.83] has joined #wesnoth 20160327 21:54:00-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth 20160327 22:06:09-!- irco [~irco@p5B373AD8.dip0.t-ipconnect.de] has quit [Ping timeout: 260 seconds] 20160327 22:11:20-!- irco [~irco@p5B373AD8.dip0.t-ipconnect.de] has joined #wesnoth 20160327 22:36:26-!- Appleman1234 [~Appleman1@KD106161147208.au-net.ne.jp] has joined #wesnoth 20160327 22:39:46-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20160327 23:08:36-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has joined #wesnoth 20160327 23:29:21-!- ancestral [~ancestral@75-168-27-21.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20160327 23:35:02-!- Haldrik [~haldrik@unaffiliated/haldrik] has quit [Quit: Haldrik] 20160327 23:43:22-!- Narrat [~Narrat@p548DD64D.dip0.t-ipconnect.de] has quit [Quit: They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.] 20160327 23:49:44-!- wario [~wario_@unaffiliated/wario] has quit [Quit: Leaving] --- Log closed Mon Mar 28 00:00:38 2016