--- Log opened Wed Nov 02 00:00:06 2016 20161102 00:11:04-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 260 seconds] 20161102 00:28:30-!- Bonobo [~Bonobo@2001:44b8:254:3200:ec79:4a1f:c1c4:f957] has joined #wesnoth 20161102 00:30:08-!- Bonobo [~Bonobo@2001:44b8:254:3200:ec79:4a1f:c1c4:f957] has quit [Client Quit] 20161102 00:30:30-!- Bonobo [~Bonobo@2001:44b8:254:3200:ec79:4a1f:c1c4:f957] has joined #wesnoth 20161102 00:39:20< DeFender1031> celticminstrel, really? most people don't like macros? 20161102 00:52:32-!- louis94 [~~louis94@91.178.241.185] has quit [Ping timeout: 250 seconds] 20161102 01:04:37-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth 20161102 01:04:50< celticminstrel> At least, I think most of the devs don't. 20161102 01:07:48< celticminstrel> From the engine's viewpoint, using macros means you're duplicating code, which IMO is particularly bad for data such as unit abilities, weapon specials, traits, AMLAs, etc. 20161102 01:15:03< lamefun> I think I have a proof that aliens exist and it is Lua, because it's clear that Lua is not for humans. 20161102 01:15:28< lamefun> Another clear proof is /bin/bash. 20161102 01:20:11< celticminstrel> My only major complaint about Lua is iterators. 20161102 01:20:26< celticminstrel> Lua's idea of iterators is too arcane. 20161102 01:20:42< lamefun> that it stops iterating on first nil? 20161102 01:21:09< celticminstrel> That's not it. 20161102 01:21:34< lamefun> iterators should've been made to return status, x, y, z ... where status is true if there's something left 20161102 01:21:59< celticminstrel> Pretty sure you can do that. 20161102 01:22:56< celticminstrel> Lua stops when the first return value is nil, so you should be able to return true if there's something left and nil otherwise, though it would mean there's an extra unused variable in the for-loop when you use it. 20161102 01:23:09< lamefun> yes, that's the problem 20161102 01:23:24< celticminstrel> The arcanity I refer to is more in the way the iterator-generating function can return up to three distinct values. 20161102 01:23:44< celticminstrel> I think in practice it's probably easiest to implement your iterators as a coroutine closure. 20161102 01:23:59< lamefun> only up to three?? 20161102 01:24:13< celticminstrel> That's the iterator-generating function, not the iterator function itself. 20161102 01:24:19< celticminstrel> So, pairs() for example. 20161102 01:24:36< lamefun> pairs can return up to 3 values? 20161102 01:24:37< lamefun> how? 20161102 01:24:39< celticminstrel> pairs() returns three values - the iterator function next(), the state (which is the table itself), and the initial value (nil). 20161102 01:25:00< lamefun> why would it return so many? 20161102 01:25:02< celticminstrel> No, it's not that pairs() can return up to three values. It returns exactly three values. 20161102 01:25:10< celticminstrel> Because that's how the for-loop works. 20161102 01:25:23< lamefun> ? 20161102 01:25:24< celticminstrel> It expects three values or less. 20161102 01:25:58< lamefun> This is what I use to walk through WML children: http://paste.ofcode.org/sakMU9v4mwfmaBhGp8tyrV 20161102 01:25:59< celticminstrel> Those values are not assigned to the loop variables though. 20161102 01:26:16< lamefun> Do I need to somehow modify this to return more values? 20161102 01:26:36< celticminstrel> Isn't there a helper.child_range() function for that? Maybe it wasn't added until 1.13... 20161102 01:26:50< celticminstrel> Anyway, no. You can return 3 values or less. 20161102 01:27:00< celticminstrel> The first value is a function. 20161102 01:27:04< lamefun> filter can be a string, a full tag or a function in my case 20161102 01:27:06< lamefun> so more flexible 20161102 01:27:08< celticminstrel> The second two are passed to that function on each iteration IIRC. 20161102 01:27:11< celticminstrel> Ah. 20161102 01:27:25< celticminstrel> s/second two/second and third/ 20161102 01:28:52< celticminstrel> You need those values if the function isn't a closure, but when it is a closure, they're probably not normally needed. 20161102 01:30:46< lamefun> why does this even exist? 20161102 01:31:01< lamefun> is it that Lua didn't support closures at some point in the past? 20161102 01:31:12< celticminstrel> I have no idea. 20161102 01:32:25< lamefun> What I don't like about Lua: 20161102 01:32:34< lamefun> 1. It's a dynamic language, dynamic typing is of the devil. 20161102 01:32:47< celticminstrel> I disagree there. 20161102 01:32:52< lamefun> 2. It's not a functional language, mutable values are of the devil. 20161102 01:33:32< celticminstrel> ... 20161102 01:33:35< celticminstrel> Okay, never mind. 20161102 01:34:04 * celticminstrel was going to say more, but decided it's not worth it. 20161102 01:40:15< lamefun> s/devil/aliens from Mars/ 20161102 01:40:17< lamefun> I mean, maybe space aliens from Mars could use dynamic non-functional languages to their fullest extents, but definitely not humans. 20161102 01:42:53< celticminstrel> I'm pretty sure most people find functional languages harder to use. 20161102 01:43:07< celticminstrel> And dynamic typing is very convenient as well. 20161102 01:43:17< celticminstrel> ^pure-functional 20161102 01:43:31< lamefun> Because their developers use elitist terminology and make some basic stuff annoying. 20161102 01:43:52< celticminstrel> Well, it might be because of their training, sure. 20161102 01:44:04< celticminstrel> But it does require a different way of looking at the problem. 20161102 01:44:33< celticminstrel> And I dunno about fullest extents, but we're pretty good at using dynamic non-functional languages. 20161102 01:45:02< celticminstrel> Basically you have no argument. 20161102 01:46:41< lamefun> https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare 20161102 01:46:51< lamefun> Dynamic languages are basically that, but it applies to every type. 20161102 01:48:23< DeFender1031> celticminstrel, no, helper.child_range is in 1.12 too 20161102 01:48:32< lamefun> I'm already tired of chasing wrong types and nil errors... 20161102 01:49:39< celticminstrel> I'm not entirely sure if that's true of all dynamically-typed languages, but... it's certainly true of all the ones I know. 20161102 01:49:55< celticminstrel> Though it's not really as bad as a null reference IMO. 20161102 01:50:06< DeFender1031> it absolutely IS a functional language 20161102 01:50:14< celticminstrel> DeFender1031: What? 20161102 01:50:25< DeFender1031> celticminstrel, to which? 20161102 01:50:32< celticminstrel> That last thing you said 20161102 01:50:38< DeFender1031> lua is a functional language 20161102 01:50:50< celticminstrel> Well, it's not pure-functional at least. 20161102 01:50:59< celticminstrel> And it seems more procedural than functional to me. 20161102 01:51:11< celticminstrel> It does support some functional approaches. 20161102 01:51:16< DeFender1031> it has closures, that makes it functional 20161102 01:51:22 * celticminstrel shrug 20161102 01:51:33< celticminstrel> But not pure-functional 20161102 01:51:46< celticminstrel> WFL is pure-functional (even though it doesn't have first-class functions) 20161102 01:52:53< DeFender1031> perhaps i have an incorrect definition of "functional" then 20161102 01:56:58< lamefun> Does Wesnoth save the Lua state along with WML state? 20161102 01:57:15< lamefun> I.e. can I simply store stuff in Lua globals? 20161102 01:57:43< DeFender1031> no 20161102 01:57:59< DeFender1031> you have to either stick it into a wml variable or add a save/load hook 20161102 01:58:29< DeFender1031> but you already wrote a serialize and unserialize, so either of those things should be trivial. 20161102 01:58:56 * celticminstrel is still wondering why you can't use loadstring() to deserialize if the serializer produces Lua code 20161102 01:59:10< lamefun> I do now. 20161102 01:59:25< DeFender1031> celticminstrel, lamefun seems to like revinventing the wheel. Let him have his fun. 20161102 01:59:43< lamefun> But the serializer grew to 500 lines :( 20161102 02:00:08< DeFender1031> lamefun, how much are you supporting? 20161102 02:00:18< DeFender1031> that's quite a lot of lines 20161102 02:00:41< DeFender1031> (i'm not going to make the mistake of saying "you shouldn't need that much code" again.) 20161102 02:01:08< DeFender1031> (since apparently lua tables are far more complex than I initially thought) 20161102 02:02:10< lamefun> My test: http://paste.ofcode.org/stdaQrmM4tZWXHwgkWXNg3 20161102 02:04:52< lamefun> most of the code assigns names to tables 20161102 02:12:34< lamefun> The main source of lines is my inability to express simple concepts simply. 20161102 02:12:50< lamefun> Eg. http://paste.ofcode.org/YVfGQm58FjcFbU5pSSHH9Q - this sorts the tables in the table list (so that the final table is always at the end). 20161102 02:20:05< DeFender1031> eesh 20161102 02:20:50< lamefun> what can I do about this? 20161102 02:42:49-!- edaq [~edaq3@h184-60-58-252.cytnin.broadband.dynamic.tds.net] has joined #wesnoth 20161102 02:43:29< lamefun> does on_save run before preload? 20161102 02:43:35< lamefun> nvm 20161102 02:44:52-!- ancestral [~ancestral@75-168-80-79.mpls.qwest.net] has joined #wesnoth 20161102 02:48:42-!- lamefun [~lamefun@176.214.213.69] has quit [Remote host closed the connection] 20161102 02:50:33-!- VultCave [~chatzilla@124.109.10.167] has joined #wesnoth 20161102 02:50:49-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Read error: Connection reset by peer] 20161102 02:50:55-!- VultCave is now known as vultraz 20161102 02:52:00-!- vultraz [~chatzilla@124.109.10.167] has quit [Changing host] 20161102 02:52:00-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth 20161102 03:03:10-!- Jetrel [~Jetrel@2001:558:6014:1e:2422:435:dd84:bbf3] has joined #wesnoth 20161102 03:09:57-!- blishchrot [statico@shell.bshellz.net] has quit [K-Lined] 20161102 03:30:29-!- ancestral [~ancestral@75-168-80-79.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20161102 03:41:22-!- lamefun [~lamefun@176.214.213.69] has joined #wesnoth 20161102 03:51:17-!- ArneBab [~quassel@55d415f5.access.ecotel.net] has joined #wesnoth 20161102 03:51:17-!- ArneBab [~quassel@55d415f5.access.ecotel.net] has quit [Changing host] 20161102 03:51:17-!- ArneBab [~quassel@freenet/developer/arnebab] has joined #wesnoth 20161102 03:52:12-!- lamefun [~lamefun@176.214.213.69] has quit [Quit: Leaving] 20161102 03:55:25-!- ArneBab_ [~quassel@55d4455e.access.ecotel.net] has quit [Ping timeout: 250 seconds] 20161102 04:43:37-!- lamefun [~lamefun@176.214.213.69] has joined #wesnoth 20161102 04:47:56< lamefun> Benefits of reinventing the wheel certainly exist: http://paste.ofcode.org/GgPtQ5BiEmCxBAdS7Yfpq6 20161102 05:23:25-!- ancestral [~ancestral@75-168-80-79.mpls.qwest.net] has joined #wesnoth 20161102 05:39:35-!- lamefun [~lamefun@176.214.213.69] has quit [Remote host closed the connection] 20161102 05:39:43-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has quit [Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] 20161102 06:11:07-!- Nikitaw99 [2e00d835@gateway/web/freenode/ip.46.0.216.53] has joined #wesnoth 20161102 06:11:25< Nikitaw99> yo 20161102 06:11:42< Nikitaw99> i've got some mooooore questions :/ 20161102 06:11:56< Nikitaw99> anyway 20161102 06:12:07< Nikitaw99> how do i change a weapon of a specific unit 20161102 06:12:22< Nikitaw99> without changing the unit type 20161102 06:19:09< Nikitaw99> :( 20161102 06:31:04< edaq> ah 20161102 06:31:19< edaq> Nikitaw99, i think 20161102 06:31:23< edaq> but do not know for sure 20161102 06:31:37< edaq> you could make a "copy" of that unit with a different weapon 20161102 06:31:44< edaq> or maybe there is a wml var for that 20161102 06:32:03< edaq> (its been a long time since I have modded wesnoth 20161102 06:32:13< Nikitaw99> edaq: ok 20161102 06:32:29< edaq> if you need anything else feel free to ask :) 20161102 06:32:57< edaq> (I am struggling atm to get a wesnoth to run on a custom machine 20161102 06:33:05< edaq> (almost have it) 20161102 06:33:24< edaq> oh I have to go for now 20161102 06:33:26< edaq> gn all :) 20161102 06:33:31-!- edaq [~edaq3@h184-60-58-252.cytnin.broadband.dynamic.tds.net] has quit [Quit: Leaving] 20161102 06:42:54< Nikitaw99> oh well 20161102 06:42:57< Nikitaw99> anyway 20161102 06:43:04< Nikitaw99> how do I create a new variation of a unit? 20161102 07:03:24< Nikitaw99> ?? 20161102 07:03:36< Nikitaw99> can anyone please tell me how do I create a variation of a mainline unit? 20161102 07:11:27< ancestral> Nikitaw99: Copy the unit file 20161102 07:11:30< ancestral> And make it your own 20161102 07:11:43< Nikitaw99> ancestral: ok, thanks 20161102 07:12:06< ancestral> Best thing to do is download an add-on that has a new unit and again, make the add-on your own 20161102 07:27:36< Nikitaw99> well 20161102 07:27:43< Nikitaw99> I am creating a custom unit 20161102 07:27:54< Nikitaw99> i've made a frankensprite for it already 20161102 07:28:08< Nikitaw99> https://forums.wesnoth.org/download/file.php?id=72778 20161102 07:40:07-!- lamefun [~lamefun@176.214.213.69] has joined #wesnoth 20161102 07:40:13< lamefun> How do I get team color values? 20161102 07:46:58< Nikitaw99> lamefun: I don't really know, but maybe it's [side id].color 20161102 07:47:08< Nikitaw99> idk 20161102 07:48:07< lamefun> this only gets me the color id 20161102 07:52:47< Nikitaw99> then I am not sure... 20161102 07:54:54-!- ancestral [~ancestral@75-168-80-79.mpls.qwest.net] has quit [Quit: ancestral] 20161102 08:05:31-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20161102 08:05:37-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth 20161102 08:06:00-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth 20161102 08:24:42-!- Appleman1234 [~Appleman1@KD106161196101.au-net.ne.jp] has quit [Ping timeout: 261 seconds] 20161102 08:48:03-!- Appleman1234 [~Appleman1@KD106161197252.au-net.ne.jp] has joined #wesnoth 20161102 08:51:13-!- lamefun [~lamefun@176.214.213.69] has quit [Remote host closed the connection] 20161102 10:50:57-!- Vadatajs [~Vadatajs@63-152-97-138.cdrr.qwest.net] has joined #wesnoth 20161102 10:53:29-!- Murgatroyd [~Vadatajs@75-167-223-106.cdrr.qwest.net] has quit [Ping timeout: 244 seconds] 20161102 11:18:13-!- Kranix [~magnus@x1-6-74-44-01-e4-f1-52.cpe.webspeed.dk] has joined #wesnoth 20161102 11:29:37-!- Bonobo [~Bonobo@2001:44b8:254:3200:ec79:4a1f:c1c4:f957] has quit [Quit: Leaving] 20161102 11:48:35< Nikitaw99> uhhhhhhhh 20161102 11:48:36< Nikitaw99> http://i.imgur.com/MXb1JVU.png 20161102 11:48:40< Nikitaw99> RIP EVERYONE 20161102 11:49:00< Nikitaw99> i accidentally messed up the filters so every unit died 20161102 11:54:06< Nikitaw99> IT HAPPENED AGAAIN 20161102 11:54:08-!- Shiki [~Shiki@141.39.226.226] has joined #wesnoth 20161102 11:54:15< Nikitaw99> ship 20161102 12:15:10-!- ChipmunkV [~vova@static-89-94-113-91.axione.abo.bbox.fr] has joined #wesnoth 20161102 12:18:00-!- Murgatroyd [~Vadatajs@97-127-190-5.cdrr.qwest.net] has joined #wesnoth 20161102 12:19:46-!- Vadatajs [~Vadatajs@63-152-97-138.cdrr.qwest.net] has quit [Ping timeout: 244 seconds] 20161102 12:30:50-!- ChipmunkV [~vova@static-89-94-113-91.axione.abo.bbox.fr] has quit [Quit: ChipmunkV] 20161102 12:40:33-!- soloojos [~soloojos@gateway/tor-sasl/soloojos] has quit [Remote host closed the connection] 20161102 12:40:34-!- Shiki [~Shiki@141.39.226.226] has quit [Remote host closed the connection] 20161102 12:41:15-!- soloojos [~soloojos@gateway/tor-sasl/soloojos] has joined #wesnoth 20161102 12:55:53-!- Nikitaw99 [2e00d835@gateway/web/freenode/ip.46.0.216.53] has quit [Quit: Page closed] 20161102 14:15:20-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has joined #wesnoth 20161102 14:23:02-!- Appleman1234 [~Appleman1@KD106161197252.au-net.ne.jp] has quit [Ping timeout: 250 seconds] 20161102 16:52:49-!- cyphase [~cyphase@unaffiliated/cyphase] has quit [Ping timeout: 250 seconds] 20161102 17:05:15-!- Kwandulin [~Miranda@p5DDD2B8F.dip0.t-ipconnect.de] has joined #wesnoth 20161102 17:06:24-!- cyphase [~cyphase@unaffiliated/cyphase] has joined #wesnoth 20161102 17:12:06-!- Samual [~Samual@xonotic/core-team/Samual] has joined #wesnoth 20161102 17:27:44-!- irco [~irco@vpn205-121.rzuser.uni-heidelberg.de] has joined #wesnoth 20161102 17:42:51-!- Kwandulin [~Miranda@p5DDD2B8F.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20161102 18:03:22-!- ChipmunkV [~vova@static-89-94-113-91.axione.abo.bbox.fr] has joined #wesnoth 20161102 18:10:18-!- claymore [~claymore@unaffiliated/claymore] has joined #wesnoth 20161102 18:18:33-!- irco [~irco@vpn205-121.rzuser.uni-heidelberg.de] has quit [Read error: Connection reset by peer] 20161102 18:29:58-!- Kranix [~magnus@x1-6-74-44-01-e4-f1-52.cpe.webspeed.dk] has quit [Quit: Konversation terminated!] 20161102 18:37:11-!- Kwandulin [~Miranda@p5DDD2B8F.dip0.t-ipconnect.de] has joined #wesnoth 20161102 18:48:49-!- louis94 [~~louis94@91.178.242.21] has joined #wesnoth 20161102 18:51:51-!- wario [~wario_@unaffiliated/wario] has joined #wesnoth 20161102 18:57:35-!- hay207 [~hay207@41.34.7.219] has joined #wesnoth 20161102 19:07:25-!- hay207 [~hay207@41.34.7.219] has quit [Ping timeout: 244 seconds] 20161102 19:09:23-!- hay207 [~hay207@41.34.29.141] has joined #wesnoth 20161102 19:11:05< hay207> Hi guys, i modified the kill bounty mod, so that it works applies only to human side , and not ai, it's code is only 50 lines, Can someone revise it, here: http://pastebin.com/7N6Ktqrs 20161102 19:13:38< Ravana_> likely to result in oos if used in multiplayer 20161102 19:15:25< hay207> Ok, thanks for the warning 20161102 19:21:48-!- Kwandulin [~Miranda@p5DDD2B8F.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20161102 19:26:37-!- irco [~irco@vpn205-066.rzuser.uni-heidelberg.de] has joined #wesnoth 20161102 19:28:49-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Ping timeout: 250 seconds] 20161102 19:29:42-!- lamefun [~lamefun@176.214.213.69] has joined #wesnoth 20161102 19:30:04< celticminstrel> lamefun: I don't think WML tag names are allowed to have spaces. 20161102 19:30:16< lamefun> really? 20161102 19:30:21< celticminstrel> Also, you can do T["tagname"] rather than {"tagname" ... 20161102 19:30:33< celticminstrel> Well, I know the game never uses tags with spaces anywhere. 20161102 19:31:06< celticminstrel> T["tagname"] {contents} rather than {"tagname" {contents}} that is 20161102 19:31:19< celticminstrel> Ah, missed the comma, but whatever. 20161102 19:31:46< lamefun> well, if a tag name has spaces, it might as well be a normal table. 20161102 19:31:55-!- Narrat [~Narrat@p2E5117AF.dip0.t-ipconnect.de] has joined #wesnoth 20161102 19:32:12< celticminstrel> You can't use T.xxx syntax for some tags since they are Lua identifiers, of course. 20161102 19:32:27< celticminstrel> eg T.not won't work. 20161102 19:32:44 * celticminstrel wonders if you accounted for that in your serializer. 20161102 19:34:38< lamefun> print(cc.dump(T['not'])) -> '{ 'not', {\n} }' 20161102 19:44:21< lamefun> I've got bigger problems now... 20161102 19:44:31< lamefun> http://uploadpie.com/I7c5g - when I try to properly align these, it crashes... 20161102 19:48:21-!- louis94 [~~louis94@91.178.242.21] has quit [Ping timeout: 260 seconds] 20161102 20:24:39< lamefun> scrollbar_panel works like listbox? 20161102 20:36:53< lamefun> Well, of course it does not :( 20161102 20:37:00< lamefun> would've been too good if it did... 20161102 21:31:00-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth 20161102 21:41:06-!- ChipmunkV [~vova@static-89-94-113-91.axione.abo.bbox.fr] has quit [Quit: ChipmunkV] 20161102 21:41:17-!- claymore [~claymore@unaffiliated/claymore] has quit [Quit: Leaving] 20161102 22:01:20-!- irco [~irco@vpn205-066.rzuser.uni-heidelberg.de] has quit [Ping timeout: 268 seconds] 20161102 22:02:56< lamefun> How does multi_page work? 20161102 22:10:37< DeFender1031> that one IS somewhat similar to listbox 20161102 22:15:18< lamefun> And can I close a dialog in callback? 20161102 22:18:29< lamefun> I want fake tabs. 20161102 22:18:47< lamefun> I.e. clicking a fake tabs regenerates the dialog completely instead of resetting a listbox or a multipage 20161102 22:20:27< lamefun> Since I failed to find any way to generate dynamic tabs properly... 20161102 22:21:58< lamefun> I tried setting canvas of buttons but they just become transparent. 20161102 22:26:44< DeFender1031> vultraz is adding tabs in 1.13 20161102 22:26:50< DeFender1031> (at least last i heard) 20161102 22:27:14< vultraz> i was not the one to add tabs 20161102 22:27:16< DeFender1031> assigning a return value for a button will close the dialog 20161102 22:27:24< vultraz> but the behavior can be done in 1.13, yes 20161102 22:27:32< DeFender1031> vultraz, my mistake. 20161102 22:28:37< lamefun> no 20161102 22:28:51< lamefun> I want it to be: if button is pressed AND a condition is met, the dialog is closed. 20161102 22:29:06< DeFender1031> so to make tabs you'd probably want to check the return value from wesnoth.show_dialog() and then pop up a new one if the return value indicates that it's one of your tabs. 20161102 22:29:32< DeFender1031> disable the button unless the condition is met? 20161102 22:29:34< lamefun> yes, but can I make buttons look better? 20161102 22:29:43< lamefun> "I tried setting canvas of buttons but they just become transparent." 20161102 22:29:47< DeFender1031> define "better"? 20161102 22:29:53< lamefun> with icon and stuff 20161102 22:30:04< DeFender1031> different button definitions will have different stuff 20161102 22:30:20< DeFender1031> (definition=whatever) 20161102 22:31:40< lamefun> vultraz, can tabs be dynamic (i.e. can be regenerated on the fly as the player is buying stuff)? 20161102 22:31:56 * vultraz groans 20161102 22:32:14< vultraz> I'm sorry, it's too early for me to get into the nuances of GUI2, especially if you're not using 1.13 20161102 22:32:22< vultraz> I haven 20161102 22:32:32< vultraz> t even used Lua GUI2 in quite a while 20161102 22:32:44< vultraz> And have been working on the c++ side 20161102 22:32:55< vultraz> Suffice to say tabs aren't really tabs 20161102 22:33:05< vultraz> In 1.13 it's a combination of a horizontal listbox and a stacked widget 20161102 22:33:21< vultraz> but you cannot reproduce that effect in 1.12 because the code was only introduced in 1.13 20161102 22:33:39< vultraz> you could do something similar with a multipage but that would mean every 'tab' has the same layout 20161102 22:34:01< vultraz> and in fact, if you ever switched multipages in the selection callback of a listbox you essentially understand the theory 20161102 22:34:07< vultraz> multipage pages* 20161102 22:34:25< vultraz> certainly you can always add or remove pages whenever you want 20161102 22:34:34< vultraz> and change the values of those visible. 20161102 22:36:27< DeFender1031> It WOULD be nice if there were a dynamic "wesnoth.close_dialog()" function which could be passed a return value and used from dialog callbacks. 20161102 22:37:28< vultraz> I'm sorry, it's too early to deal with this :| 20161102 22:38:32< lamefun> What's GUI2? 20161102 22:38:44< vultraz> the ui framework you're using 20161102 22:39:44< lamefun> I am using it? 20161102 22:39:52< vultraz> yes. 20161102 22:40:15< lamefun> Have I used it in 1.10? 20161102 22:40:36< lamefun> Because I tried to implement dialog shop back then and in 1.12 I'm facing the same troubles. 20161102 22:41:26< lamefun> How to use button definitions? 20161102 22:41:49< vultraz> definition = id 20161102 22:41:53< vultraz> but you cannot add any new ones 20161102 22:42:51< lamefun> what are the existing definitions? 20161102 22:43:07< vultraz> look in data/gui/default/widget/button.cfg 20161102 22:43:12< vultraz> or button_25.cfg 20161102 22:44:19-!- soloojos [~soloojos@gateway/tor-sasl/soloojos] has quit [Ping timeout: 245 seconds] 20161102 22:50:10< lamefun> I don't think even 1.13 will do what I want... 20161102 22:50:41< lamefun> I want eg. if a player buys a weapon in the Weapons tab, an there should appear items in the Enhancements tabs that will allow to further upgrade that weapon. 20161102 22:51:46< lamefun> Well, I suppose I could generate widgets for every possible weapon... 20161102 22:51:52-!- ToBeCloud [uid51591@wikimedia/ToBeFree] has joined #wesnoth 20161102 22:52:20< vultraz> it's possible 20161102 22:52:30< vultraz> dunno if it can be done in lua, though 20161102 22:53:10< lamefun> cann 20161102 22:53:16< lamefun> can it be done in WML? 20161102 22:53:26< celticminstrel> You can't do custom dialogs in WML. 20161102 22:53:55< celticminstrel> Though it'd probably be possible to define a general tag for that. 20161102 22:54:01< celticminstrel> Not sure it's worth it though. 20161102 22:54:09< lamefun> why won't Wesnoth simply expose C++? 20161102 22:54:18< celticminstrel> What? 20161102 22:54:50< lamefun> Because that would be the true way, and Lua and WML are only band-aids. 20161102 22:54:55< vultraz> I'll leave you to it, celticminstrel :| 20161102 22:55:02 * vultraz nopes the fuck out 20161102 22:55:03< celticminstrel> I don't know what you mean. 20161102 22:55:14< aeth> If Wesnoth was designed from scratch, it would probably be WML on top of Lua on top of C++. Wesnoth slowly grew in scope over a very long period of time. 20161102 22:55:35< celticminstrel> If Wesnoth were designed from scratch there would probably be far less WML. 20161102 22:55:39< aeth> The UI stuff similarly is not very clean 20161102 22:55:42< celticminstrel> (Also, don't forget there's also WFL.) 20161102 22:55:45< aeth> celticminstrel: WML should basically just be data and configuration 20161102 22:55:48< celticminstrel> Yes. 20161102 22:55:51< aeth> It's decent at that 20161102 22:55:59< aeth> WML should basically just be equivalent to XML or JSON or YAML 20161102 22:56:12< lamefun> That's how I'm using it anyway... 20161102 22:56:42< aeth> And maybe in 10 years WML can switch to XML with <>s instead of []s because it's basically the same thing :-p 20161102 22:56:43< celticminstrel> Animation and terrain graphics syntax are overly complicated, but most of the WML is quite decent. 20161102 22:56:49< aeth> (When used properly) 20161102 22:56:59 * celticminstrel still doesn't know what lamefun meant by "expose C++" 20161102 22:57:09< aeth> One thing Wesnoth has a lot is NIH, e.g. in UI and WML 20161102 22:57:10< lamefun> Allow including .dlls in mods. 20161102 22:57:20< aeth> lamefun: that would break portability 20161102 22:57:32< aeth> And would be terribly insecure 20161102 22:57:48< celticminstrel> .dlls are a Windows-only thing. :P (Yes other platforms have an equivalent, but it's not .dll) 20161102 22:58:19< aeth> And you can tell WML kind of grew over time as a configuration language instead of actually being designed for programming because wow it violates a lot of rules of language design 20161102 22:58:21< lamefun> Portability doesn't matter, the only OSes people are using are Windows, Linux, macOS, Android and iOS, not too many targets, eg. gcc can cross-compile. 20161102 22:58:28< aeth> You shouldn't NIH 20161102 22:58:35< aeth> (unless you know the theory, then you can NIH) 20161102 22:59:10< lamefun> Security also doesn't matter, because soon it will be the glorious future, the future that is for PEOPLE, the future that is free from the fear of viruses! 20161102 22:59:14< aeth> lamefun: what about e.g. ARM non-Android Linux or PowerPC Linux? 20161102 22:59:24< celticminstrel> I kinda want to know what rules it's violating. 20161102 22:59:30< lamefun> See: Flatpak, AppImage, Snappy. 20161102 22:59:30< aeth> lamefun: Wesnoth runs on a ton of platforms that restricts what it can do vs. a game written in 2016 to 2016's realities 20161102 22:59:46< aeth> People will be mad if e.g. non-x86 desktop support was dropped, which I'm 90% sure Wesnoth supports 20161102 23:01:19< aeth> Even switching to OpenGL 3.3, which I've looked into several times, drops support for a surprising number of computers that currently run Wesnoth 20161102 23:01:38< aeth> And 3.3 is ancient by graphics standards. 20161102 23:02:12< celticminstrel> I think that drops support for my computer. 20161102 23:02:16< celticminstrel> Well, my Mac. 20161102 23:02:51< aeth> If you were to write a game like Wesnoth today you could say "use a proper scripting system instead of this Lua+WML mess" and "support modern OpenGL 4.x on desktop" and maybe even "only support x86(_64) on desktop for the three major desktop OSes" etc 20161102 23:03:19< aeth> But because it's an ancient game with an ancient codebase run on ancient computers, even supports-nearly-everything OpenGL 3.3 will be controversial, let alone the rest of the stuff 20161102 23:03:42< lamefun> What are proper scripting systems? 20161102 23:03:55< celticminstrel> Probably Lua or JS. 20161102 23:04:02< celticminstrel> Maybe Python or Lisp. 20161102 23:04:07< celticminstrel> Or Tcl. 20161102 23:04:09< aeth> It's basically just Lua because of sandboxing. 20161102 23:04:17< aeth> You might get away with a custom Scheme if you wanted something Lispy 20161102 23:04:24< celticminstrel> Nah, there are definitely options. 20161102 23:04:25< aeth> Scheme's small enough that you could build your own sandbox 20161102 23:05:10< lamefun> Lua+WML is not even a bad scripting system... 20161102 23:05:21< celticminstrel> Doesn't JS do sandboxing too? 20161102 23:05:25< lamefun> My problem is that I keep hitting limitations... 20161102 23:05:40< celticminstrel> There are quite some limitations in what's exposed to Lua, yes. 20161102 23:05:42< aeth> But you'd want to (1) separate configuration and scripting, (2) use a real scripting language for all of the scripting (in Wesnoth's case, that'd be dropping programming from WML), (3) expose everything that's safe to the scripting language (not everything's exposed to the Lua, quite a few major oversights exist until someone tries to access it, e.g. terrain images weren't exposed until recently) 20161102 23:05:48-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [] 20161102 23:05:50< celticminstrel> If you keep pointing them out they should eventually be addressed. 20161102 23:05:52< aeth> And you'd want a real UI system, almost certainly from a library. 20161102 23:06:38< aeth> And you'd probably want to use modern OpenGL for even 2D games, which means 3.3 at a minimum on desktop. Right now, Wesnoth uses SDL's 2D stuff. 20161102 23:06:44< lamefun> What's wrong with the Wesnoth UI system? 20161102 23:07:18< celticminstrel> It's kinda arcane on the C++ level, making it hard to maintain and apply bugfixes. 20161102 23:07:21< aeth> lamefun: Look at how it works. Look at the massive piles of boilerplate WML that it requires. Look how half-complete it is. Look at the stuff that isn't exposed to the Lua. 20161102 23:07:26< celticminstrel> The Lua API to it is pretty terrible as well. 20161102 23:07:34< celticminstrel> Though that's been addressed a little. 20161102 23:07:39< aeth> And yeah, not only is it half-complete, it's basically uncompletable because the one person who knew how it works isn't working on it. 20161102 23:08:33< lamefun> "knew how it works" - what can be in there that's so complicated? 20161102 23:08:37< aeth> C++ is not a good language for what Wesnoth is. It's a huge language and Wesnoth doesn't really work in a subset of C++. That means good luck reading the code of Wesnoth. 20161102 23:09:14< aeth> And Wesnoth hardcodes a lot of things that keep it from being a modern game engine iirc. Switching to modern rendering would be tricky, for one. 20161102 23:09:37< aeth> And to get truly modern rendering you'd need to change how the sprites and terrain are done, anyway, so it would be massive work on the art side. 20161102 23:10:48< celticminstrel> lamefun: Lots of templates, complex event handling system, uhh... 20161102 23:10:53< aeth> A lot of modern pixel art uses shaders and lighting like a 3D game does. Wesnoth couldn't do that without redoing every single sprite because the lighting tricks require multiple sprites just like 3D lighting requires multiple textures. 20161102 23:11:03< celticminstrel> aeth: How is it massive work on the art side. 20161102 23:11:23< celticminstrel> There's no need to use lighting just because we can. 20161102 23:11:32< aeth> celticminstrel: Lit sprites are basically flat-shaded and then you have a separate texture (or several?) that gives the lighting engine information on how to light it from various angles 20161102 23:11:44< DeFender1031> lamefun, Did you seriously manage to type out the words "Portability doesn't matter, the only OSes people are using are Windows, Linux, macOS, Android and iOS" without realizing how ridiculous they sound? 20161102 23:11:45-!- louis94 [~~louis94@91.178.242.21] has joined #wesnoth 20161102 23:12:10< lamefun> Why so? 20161102 23:12:12< aeth> DeFender1031: well, I mean it's true if you're only targeting Steam and possibly the app stores. 20161102 23:12:19-!- soloojos [~soloojos@gateway/tor-sasl/soloojos] has joined #wesnoth 20161102 23:12:34< celticminstrel> But there's no need to do that. The current sprites can be used just fine. 20161102 23:12:37< aeth> And Steam is probably 90% of non-console, non-mobile games, if not more. 20161102 23:12:51< DeFender1031> because you followed up the statement of "portability isn't important" with a list of five different OSs with radically different portability needs. 20161102 23:13:50-!- Appleman1234 [~Appleman1@KD106161198196.au-net.ne.jp] has joined #wesnoth 20161102 23:14:00< aeth> celticminstrel: Right, it's not that big of a deal at the abstract scale Wesnoth works at, although it might impact the dungeon/indoor terrain set (which is terribly lacking... good luck making a good looking dungeon that doesn't mix in caves or some other terrain all over the place) 20161102 23:14:15< DeFender1031> lamefun, as for "Security also doesn't matter" because of some magical future where viruses can't happen, you seem to be unaware that the only way to prevent viruses is to prevent arbitrary code execution, unless you're counting on the universal altruism of 100% of the human race. 20161102 23:14:40< lamefun> See: Flatpak, AppImage, Snappy. 20161102 23:14:48< lamefun> This is exactly how these work. 20161102 23:15:06< aeth> The only light sources outside of the sun are basically just camp fires, wall torches, and a handful of other very minor, rarely-seen details. (And the illuminates effect.) 20161102 23:15:24< lamefun> Sandboxed apps. Thanks, Apple, for popularizing the concept, without you the users would live in fear forever! 20161102 23:15:42< aeth> Wesnoth doesn't really play with lighting in a way that angles would matter much except for illuminates and camp fires. 20161102 23:17:16< aeth> lamefun: per-app sandboxes can still cause issues... a malware add-on would be able to steal your Wesnoth password (which is also your forum password) and could probably try to see if you repeat that password on other accounts associated with the same email once logging into the Wesnoth forums to get your email 20161102 23:17:44< aeth> Security is pretty hard, and perfect security is basically impossible 20161102 23:18:43< aeth> Anyone who uses the same password on the email associated with their Wesnoth account and their Wesnoth account would have quite a few things compromised by fairly trivial Wesnoth add-on malware. 20161102 23:20:01< aeth> (1) get the password from logging into the server (it could even be stored locally), (2) log into the Wesnoth forums as that user, (3) fetch the email, (4) try the password on the email. 20161102 23:20:11-!- Smedles_ [~quassel@CPE-58-160-77-59.ssqn1.lon.bigpond.net.au] has joined #wesnoth 20161102 23:20:13< aeth> Sandboxed apps don't stop that. 20161102 23:20:20-!- Smedles [~quassel@CPE-58-160-77-59.ssqn1.lon.bigpond.net.au] has quit [Ping timeout: 260 seconds] 20161102 23:21:07< lamefun> Well, I'm an idiot. You're right. 20161102 23:21:15< celticminstrel> aeth: If you tell Wesnoth to remember your password, currently it's stored as plaintext in your prefs file. 20161102 23:21:39< celticminstrel> This is the main reason why the new Lua preferences API was restricted to the application Lua kernel. 20161102 23:21:43< lamefun> I think it would still be feasible if the main Wesnoth app is barred from network access and passwords are handled through a separate app that provides a microservice. 20161102 23:21:51< celticminstrel> (That's the kernel used by Lua plugins loaded from the command-line.) 20161102 23:22:16< celticminstrel> (Which are run as a coroutine.) 20161102 23:22:38< lamefun> But then it would be possible for malicious add-ons to phish out the passwords from users by making a dialog that looks like the genuine password box... 20161102 23:22:50< lamefun> I'm sure it's theoretically possible even right now... 20161102 23:23:27< aeth> lamefun: you can get 90% of a decent add-on experience by exposing enough of the game to scripting APIs in a sandboxed scripting language like Lua 20161102 23:23:45< aeth> Yeah, Lua's terrible, but, hey, so is C++. Languages that become popular lock in really bad early decisions and it becomes too late to fix them. 20161102 23:24:23< aeth> The worst sin of Lua is probably using 1-based indexing in a language designed to interact with 0-based indexed languages, but there are many mistakes in its design. Not having +=, -=, /=, etc. is pretty bad too for a language with that sort of syntax. 20161102 23:24:36< celticminstrel> Probably. 20161102 23:24:48< lamefun> I've never had any issue with these "problems"... 20161102 23:24:57< celticminstrel> In other words you probably shouldn't tell Wesnoth to save your password. 20161102 23:25:18< aeth> lamefun: I like really_long_variable_names, which makes the lack of syntactic sugar for += really, really, really annoying 20161102 23:25:34< aeth> It can easily lead to breaking 100 character lines needlessly. 20161102 23:25:37< celticminstrel> aeth: Eh, I don't think I can agree there. I dislike the lack of augmented assignment, but 1-based indexing is no less arbitrary than 0-based indexing. 20161102 23:26:03< aeth> celticminstrel: but when you interoperate with two 0-based indexed languages (C or C++) as the main and really only purpose of the language, it causes headaches 20161102 23:26:09< aeth> celticminstrel: Especially if you come back to Lua after not coding it for months 20161102 23:26:16< celticminstrel> I'm not so sure about that. 20161102 23:26:17< aeth> It's a gotcha that didn't need to exist. 20161102 23:26:26< celticminstrel> I mean, even in the C API, Lua uses 1-based indexing everywhere. 20161102 23:26:33< aeth> But it didn't need to. 20161102 23:26:48< celticminstrel> So if you're working with Lua, it's always 1-based indexing even in C/C++. 20161102 23:27:01< DeFender1031> lamefun, sure your add-on could get someone to input something, but since wesnoth's lua doesn't actually expose a way to send it anywhere or use it, it can't actually do anything 20161102 23:27:10< aeth> celticminstrel: but then you access e.g. WML in Lua and things start with 0 20161102 23:27:37< lamefun> DeFender1031, it synchronizes state with the other players... 20161102 23:28:36< DeFender1031> lamefun, okay, fair enough. 20161102 23:29:01< celticminstrel> aeth: Yes, there's an issue there, true. 20161102 23:29:04< DeFender1031> still, you have to actually lure them into a game WITH YOU in order to get that data 20161102 23:29:07< celticminstrel> But that's not really an issue with Lua itself. 20161102 23:29:23< DeFender1031> aeth, agreed on the assignment operators and long variable names. 20161102 23:29:53< celticminstrel> I guess it's too late for Lua to add augmented assignment. 20161102 23:29:58< aeth> celticminstrel: but Lua encourages issues like this unless you adopt Lua from the start because there's no reason to even think about 1-indexing anything related to C or C++ unless you're working with Lua 20161102 23:30:05< celticminstrel> Because ~= would need ot be an augmented assignment, but it already has another meaning. 20161102 23:30:18< lamefun> My problem with Lua is dynamic types and mutable variables they are both from the space aliens from Mars (i.e. not meant for human use). 20161102 23:30:25< aeth> If Lua used 0-based indexing like 95% of modern languages, no one would notice this issue at all 20161102 23:30:29< DeFender1031> I also agree about the 1-indexing. 20161102 23:30:41< celticminstrel> aeth: I wouldn't say there's no reason. It's something that people wouldn't tend to think of maybe, but I don't think there's no reason to think about 1-indexing stuff in C or C++. 20161102 23:30:57< DeFender1031> celticminstrel, ~=? what assignment operator is that? 20161102 23:31:03< celticminstrel> And once again lamefun says something to prove that his opinion doesn't matter. 20161102 23:31:09< aeth> Another issue with Lua is that it does something with variables that Java does with just about everything. The right thing to do is more verbose than the wrong thing to do. "local foo = bar". What? local isn't the default? Okay, add another easy way to add bugs to people not used to Lua 20161102 23:31:12< celticminstrel> DeFender1031: XOR 20161102 23:31:17< celticminstrel> Bitwise XIR is ~ 20161102 23:31:19< celticminstrel> XOR 20161102 23:31:44< DeFender1031> xor in lua is ~? 20161102 23:31:47< celticminstrel> Yup. 20161102 23:31:52< celticminstrel> From 5.3. 20161102 23:31:56< DeFender1031> that's.... interesting. 20161102 23:31:56< celticminstrel> So not in Wesnoth 1.12. 20161102 23:32:28< celticminstrel> (Logical XOR is of course ~= ) 20161102 23:32:40< DeFender1031> aeth, javascript is like that too 20161102 23:33:07< aeth> The most common thing should always be the least verbose imo. 20161102 23:33:20< celticminstrel> I'm undecided on whether local or global should be the default. 20161102 23:33:26< DeFender1031> aeth, i tend to agree. 20161102 23:33:27< celticminstrel> I think there was a pretty good argument for local. 20161102 23:33:30< aeth> It's impossible to do with everything from the start, and then you're locked in because of backwards compatibility, but something like "local" is really, really not forward thinking. 20161102 23:33:52< aeth> celticminstrel: The thing is, global variables should be used like 3 times in an app if at all. 20161102 23:33:57< aeth> And local variables are used in just about every function 20161102 23:34:06< aeth> Globals should stand out. 20161102 23:35:01< lamefun> IMO the best way to write Wesnoth if it were possible to start from scratch would be: write the platform abstraction in C++ and then write the actual game in Lua, this way add-ons would be able to go as far as replacing the whole game with Pacman if they wanted to. 20161102 23:35:27< aeth> lamefun: too bad Lua is so limited of a language, though 20161102 23:35:52< aeth> lamefun: The right way to write an application imo is to write the whole thing in a very high level language and then move stuff that needs to be in C or C++ to C or C++ once it's profiled. 20161102 23:35:52< lamefun> Limited how? Dynamic types, yes, but you can add classes and everything else 20161102 23:35:57< aeth> Lua's not a good language for this style, though. 20161102 23:36:02< aeth> It's a common style for e.g. Python 20161102 23:36:23< lamefun> How is it not good? 20161102 23:36:26< aeth> There's no issue of "X, Y, and Z aren't exposed" if the whole thing was written in the higher level language first 20161102 23:36:46< aeth> Lua doesn't really have enough robustness to work like this. 20161102 23:36:54< aeth> It's very much for scripting and only scripting. 20161102 23:37:05< aeth> Anything even remotely low level shouldn't be done in Lua 20161102 23:37:18< aeth> A lot of other high level languages can go deeper than Lua 20161102 23:37:21< lamefun> IMO robustness = static typing, immutable variables. 20161102 23:37:59< DeFender1031> lamefun, what exactly do you have against mutable variables? 20161102 23:38:05< aeth> I like this approach: Start without static typing, add types in slowly over time imo. Not many languages really are built around this, though. 20161102 23:38:12< aeth> Mutable variables are kinda necessary in gamedev, though. 20161102 23:38:36< aeth> You'd need a really, *really* good compiler and a special language designed for game engines to go about pretending things are "immutable" while being as mutable as a game engine needs to be 20161102 23:39:14< aeth> You need mutability. Not really to the degree of C, but definitely more than e.g. a typical functional programming langauge. 20161102 23:39:18 * celticminstrel assumes lamefun is a fan of eg Haskell. 20161102 23:39:49< aeth> Even if you're using a GC language, you want to avoid creating garbage as much as possible. That kind of goes against the whole immutable thing. 20161102 23:41:38< aeth> You don't want to create and throw away something 60 to 200 times a second. 20161102 23:41:59< celticminstrel> Immutability is counter to the design of a procedural language. 20161102 23:42:05< celticminstrel> You can do it in a pure-functional language. 20161102 23:42:14< celticminstrel> WFL lacks mutability. 20161102 23:42:43< celticminstrel> WFL could have (in theory) been expanded to fill the role that Lua now fills, but it's kinda late for that now. 20161102 23:44:31< aeth> celticminstrel: It's pretty easy to do immutability in (some) procedural languages. Just return copies. So e.g. foo(a, b) returns something of the same type as a or b, but doesn't modify a or b. 20161102 23:44:39< lamefun> My other problem with Lua is that tables can't be separated from references. 20161102 23:45:01< lamefun> I.e. I have to not forget to copy tables at interface boundaries. 20161102 23:45:06< aeth> celticminstrel: You don't need a pure functional language to use pure functions 20161102 23:45:13< DeFender1031> lamefun, immutablel languages: https://imgflip.com/i/1dfjjd 20161102 23:45:27< celticminstrel> Sure. 20161102 23:46:19< lamefun> e.g. I have a thing.pos property that is { x = .., y = .. } table. 20161102 23:46:40< lamefun> but it can't be simply changed, something else has to be done when it changes. 20161102 23:46:46< aeth> celticminstrel: The problem is that you want a foo!(a, a, b) that modifies a over a foo(a, b) a lot of the time, especially if it's run every frame. 20161102 23:47:22< lamefun> so thing.pos accessor has to copy the internal pos, so that the user won't simply modify the private state of thing 20161102 23:47:26< aeth> Outside of games, you probably want a foo(a, b), though. 20161102 23:47:29< celticminstrel> lamefun: You could probably use metatables to get an effect like that. 20161102 23:47:58< DeFender1031> lamefun, a lot of languages are like that. I actually (shockingly) agree with you on that. I personally like how in C and C++ everything is passed by copy unless explicitly specified as a reference, or unless modified via pointer, both of which make it obvious that there's direct modification going on. 20161102 23:48:32< DeFender1031> (referring to the "tables need to me copied to avoid modifying them directly" thing) 20161102 23:50:00< lamefun> celticminstrel, this also lowers the performance... 20161102 23:50:25< celticminstrel> Not sure why you're worried about performance, but sure, maybe it has some tiny effect on it. 20161102 23:51:33< DeFender1031> Me too, especially since lamefun is the one who BLITs images together pixel-by-pixel. 20161102 23:52:08< lamefun> eg. you implement a map (tree or hash table), then what if a key is modified? then the maps suddenly becomes bugged! 20161102 23:53:00< celticminstrel> Well, in C++, maps have immutable keys, so that's a non-issue. 20161102 23:53:06< celticminstrel> In Lua it's a non-issue for the same reason. 20161102 23:53:41< celticminstrel> Mutable types (mainly tables) are keyed by identity (ie, memory address). 20161102 23:54:09< lamefun> coords[{1, 2}] = 'thing'; print(coords[{1, 2}]) ... 20161102 23:55:12< celticminstrel> Oh, fair enough. That'll work with C++ maps though. 20161102 23:55:15< DeFender1031> lamefun, your issue isn't the mutability so much as the implicit passing all tables around by reference no matter the context 20161102 23:55:19< celticminstrel> But yeah, it'll fail with Lua maps. 20161102 23:55:54< DeFender1031> (and the subsequent modification of the table in all contexts in which it's used even when your intention is to only change it locally) 20161102 23:56:15-!- louis94 [~~louis94@91.178.242.21] has quit [Quit: Konversation terminated!] 20161102 23:58:21-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Ping timeout: 250 seconds] 20161102 23:58:38-!- wario [~wario_@unaffiliated/wario] has quit [Quit: Leaving] 20161102 23:58:49< lamefun> "the one who BLITs images together pixel-by-pixel" - do I have a choice? --- Log closed Thu Nov 03 00:00:08 2016