--- Log opened Mon Oct 31 00:00:21 2016 20161031 00:14:17-!- gfgtdf [~chatzilla@x4e32b47a.dyn.telefonica.de] has quit [Quit: ChatZilla 0.9.92 [Firefox 49.0.2/20161019084923]] 20161031 00:18:01< lamefun> Well, after lots of coding and bugs, my prettyprinter/unprettyprinter works! 20161031 00:18:02< lamefun> http://paste.ofcode.org/qB2Ef9UnSLt2JxGNp36BRB 20161031 00:18:49< lamefun> Round-trip is a success! 20161031 00:25:44< DeFender1031> lamefun, no more hate? 20161031 00:26:59< lamefun> Well, it's 500 lines. 20161031 00:27:11< lamefun> And took a while to make it even work. 20161031 00:28:40< DeFender1031> there's no reason you should need 500 lines to do that 20161031 00:29:47< lamefun> maybe I'm an idiot? 20161031 00:31:12< lamefun> I mean there's probably an easy way that most non-stupid humans are aware of, but I'm stupid. 20161031 00:36:23< lamefun> Here's what I did: http://paste.ofcode.org/wQdxJdpPgSvdmxHjwzQBAA 20161031 00:42:04-!- wario [~wario_@unaffiliated/wario] has quit [Quit: Leaving] 20161031 00:44:46< lamefun> What did I do wrong that got me these 500 lines of code? 20161031 00:45:37< DeFender1031> ah, you meant for serialize AND unserialize... some of this is a little more verbose than I'd usually write, but it looks more or less sane actually. 20161031 00:45:54< DeFender1031> but yeah, parsing is far harder than printing. 20161031 00:48:57< DeFender1031> though i'm not sure why you're doing all this "explicit_key" stuff in your table serializing. 20161031 00:49:53< lamefun> it separates the array part (i.e. { 1, 2, 3 }) from the key-value part (i.e. { a = b }) 20161031 00:49:57< DeFender1031> i know 20161031 00:50:06< DeFender1031> but there's no reason to do so 20161031 00:50:10< DeFender1031> or rather, let me clarify 20161031 00:50:31< DeFender1031> for a simple serialize/unserialize, the order in which you serialize and unserialize really doesn't matter 20161031 00:51:04< DeFender1031> if you're also using this for debugging and want to have the output sorted so you can easily find a certain key at a glance, then that makes sense. 20161031 00:51:36< lamefun> I want a debug mode, where all values that will go to unit's variables, etc. will be pretty-printed 20161031 00:51:43< DeFender1031> okay 20161031 00:52:12< DeFender1031> so then that does make a certain amount of sense, although for non-debug, you may want to circumvent all that and just serialize in whatever order you get. 20161031 00:52:44< lamefun> that'd just be even more code 20161031 00:53:13< DeFender1031> i would also point out that if you're serializing/unserializing yourself, you're not limited exclusively to lua's data object notation. You could just as easily be using json, for example. 20161031 00:53:21< lamefun> the loss of performance doesn't matter, since I'm already using things like building images by blitting pixels from blank_attack 20161031 00:53:32< DeFender1031> fair enough :P 20161031 00:53:38< lamefun> JSON can't have array and map in the same object 20161031 00:54:11< DeFender1031> if you were turning lua into JSON, you'd exclusively use objects and not arrays anyway. 20161031 00:54:35< DeFender1031> (since lua has only an object equivalent and sort of pretends it can be array-like sometimes) 20161031 00:55:10< lamefun> no number keys in JSON objects 20161031 00:55:13< DeFender1031> or you could special-case for objects which are ONLY sequential numeric keys to use array but otherwise use objects. 20161031 00:55:21< DeFender1031> excuse me? 20161031 00:55:26< DeFender1031> that's not true. 20161031 00:55:40< DeFender1031> {"17" : "this has a numeric key"} 20161031 00:56:10< lamefun> Lua: { 17 = 'numeric key', ['17'] = 'string key' } 20161031 00:56:40< DeFender1031> really? and those will be two separate values that are independently stored and accessed? 20161031 00:57:25< lamefun> well, that's certainly not very probable 20161031 00:59:55< DeFender1031> holy crap! 20161031 01:00:00< DeFender1031> yopu're right 20161031 01:00:19< DeFender1031> i just tested. 20161031 01:01:14< DeFender1031> it DOES store differently for different key types 20161031 01:01:19< DeFender1031> this is horrifying! 20161031 01:02:06< lamefun> why is this horrifying? 20161031 01:02:28< DeFender1031> that it allows keys of differing types 20161031 01:02:33< lamefun> and? 20161031 01:03:06< DeFender1031> keys should be strings. 20161031 01:03:14< lamefun> why? 20161031 01:03:36< DeFender1031> because... umm... 20161031 01:04:46< DeFender1031> it allows other TABLES as keys too?! 20161031 01:04:48< DeFender1031> this is... 20161031 01:04:52< DeFender1031> umm 20161031 01:04:59< DeFender1031> i'm very scared 20161031 01:05:08< lamefun> scared of what? 20161031 01:06:01< DeFender1031> and keys should be of a single type because maps should be used to map a particular piece of data with other data, not to map what amounts to that same data to multiple things. 20161031 01:06:24< DeFender1031> scared of lua. 20161031 01:06:41< DeFender1031> but perahps i'm judging too quickly 20161031 01:06:46< lamefun> '17' and 17 are different data... 20161031 01:07:05< lamefun> > '17' == 17 20161031 01:07:05< lamefun> false 20161031 01:07:19< DeFender1031> well, all i can say is that lua really takes a hard line on its soft-typing. 20161031 01:07:29< DeFender1031> right, that's true 20161031 01:07:48< DeFender1031> or rather, that's false. 20161031 01:07:54< DeFender1031> but what you said is true. 20161031 01:08:10< DeFender1031> or... ('17' == 17) == false is true. 20161031 01:08:24< DeFender1031> sorry, i'm being totally incoherent at the moment, aren't I? 20161031 01:08:46< lamefun> do you require ('17' == 17) to be true not to be scared? 20161031 01:09:34< DeFender1031> no, of course not 20161031 01:09:58< DeFender1031> i'm just... not used to maps with mixed keys 20161031 01:10:14-!- Murgatroyd [~Vadatajs@63-152-63-124.cdrr.qwest.net] has quit [Read error: Connection reset by peer] 20161031 01:10:58< DeFender1031> fine, then you're right, there's no way to convert a lua table to JSON. 20161031 01:11:32< DeFender1031> forget the number vs. string thing, you also have the issue of booleans as keys, tables as keys, etc. 20161031 01:11:42< lamefun> btw I ignored the table-as-keys case 20161031 01:11:48< DeFender1031> why? 20161031 01:11:51< lamefun> because they are keyed by identity, not value 20161031 01:11:51< DeFender1031> it's doable 20161031 01:12:07< DeFender1031> true, but same with values. 20161031 01:12:24< DeFender1031> meaning, you can have a case where the same table appears in two places in your data 20161031 01:13:10< DeFender1031> which will lead to either the data not being tied together anymore after unserialize if you're lucky, or an infinite recursive loop when you try to serialize if you're unlucky. 20161031 01:13:28< DeFender1031> allowing or disallowing table keys doesn't really change that fact much 20161031 01:14:10< lamefun> if values are untied, they can still be useful, if I don't modify the original table 20161031 01:14:17< lamefun> *resulting 20161031 01:14:28< lamefun> i.e. if I just want to use it as data, it doesn't matter much 20161031 01:14:46< DeFender1031> right 20161031 01:14:49< lamefun> but if I lose table identity when they're used as keys, the result becomes useless 20161031 01:14:52< DeFender1031> though the recursion is more of an issue 20161031 01:14:58< DeFender1031> hmm 20161031 01:15:03< DeFender1031> maybe, maybe not. 20161031 01:15:57< DeFender1031> also, it IS possible to theoretically write a serializer which will output a self-executing lua function which will return the data structured identially with the references intact. 20161031 01:16:04< DeFender1031> i've done it for both php and js 20161031 01:16:34< DeFender1031> (it's also obviously more complicated, and you'd need some form of eval() in your case to actually use it) 20161031 01:17:03< lamefun> no I do not, I can just parse the result 20161031 01:17:23< lamefun> but that'd be 2000 lines of code instead of 500 20161031 01:18:54-!- Narrat [~Narrat@p2E5117AF.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.] 20161031 01:19:15< DeFender1031> right 20161031 01:19:20< DeFender1031> which is insane 20161031 01:21:05< DeFender1031> unfortuantely, i now have a lot of lua code i need to go fix now that you've pointed out to me that keys can be anything... 20161031 01:22:26< lamefun> why do you need to fix what works? 20161031 01:45:48< DeFender1031> who says what i wrote works in all cases? 20161031 01:46:15< DeFender1031> all the lua i've written was done under the assumption that all keys are strings. 20161031 01:47:47< DeFender1031> since that's not the case, the assumptions don't hold up, and the code is potentially buggy 20161031 02:45:24< lamefun> :/ 20161031 02:45:25< lamefun> http://paste.ofcode.org/ShadsEPhaEKkwFZwEbZYau 20161031 02:45:57< lamefun> I'm making the thing recursion-proof, the serializer is done, now I have to parse the output... 20161031 02:46:11< lamefun> I miss Haskell's Parsec... 20161031 02:46:17< DeFender1031> oh dear. 20161031 02:48:04< lamefun> Haksell: beginning = P.string "(" >> P.space >> P.string "(" >> P.space >> P.string "function" >> P.space >> P.string "(" >> P.space >> P.string ")" 20161031 02:48:39< lamefun> But I hate Haskell too... 20161031 02:52:00< DeFender1031> Is there anything you don't hate? :P 20161031 02:53:08< lamefun> No, at least about computers. As I've said, the humanity has squandered the computers. 20161031 02:53:20< DeFender1031> in what way? 20161031 02:55:41< lamefun> I hope Mozilla Rust replaces all the garbage soon. 20161031 02:56:13< DeFender1031> that's hardly an answer 20161031 02:57:57< lamefun> Everything is garbage and full of bugs, and that's because the programming languages that see actual usage are stupid. 20161031 02:58:07< lamefun> Dynamic typing is of Satan. 20161031 02:58:44< lamefun> BTW, in Lua, is it somehow possible for a inner function to make the outer function exit? 20161031 02:58:59< DeFender1031> what do you mean? 20161031 02:59:38< lamefun> return in local function makes the parent function return as well 20161031 03:00:07< lamefun> eg. Scheme language allows something like that 20161031 03:00:34< DeFender1031> AFAIK, the outer one would need to be checking the inner one's return. 20161031 03:01:36< lamefun> that's the problem 20161031 03:01:46< DeFender1031> what's the problem? 20161031 03:02:08< lamefun> one line -> 3 lines 20161031 03:05:04-!- edaq [~edaq3@h184-60-58-252.cytnin.broadband.dynamic.tds.net] has joined #wesnoth 20161031 03:05:42< lamefun> In Scheme, there's call/cc function, i.e. in Lua that would be local a = call_cc(function(cont) cont(1); print('this will never be printed') end) 20161031 03:05:58< edaq> hello lamefun 20161031 03:06:05< edaq> lol you are here as well 20161031 03:06:05< edaq> nice 20161031 03:10:57< DeFender1031> lamefun, and that call to "cont()" causes the function in which a exists to return? 20161031 03:11:29< lamefun> well, I'll write a snippet to demonstrate 20161031 03:13:32< lamefun> it causes that call_cc to return the argument to cont 20161031 03:14:01< DeFender1031> how does that differ from a normal return? 20161031 03:14:43< lamefun> call_cc(function(cont) local function local() cont(1) end; local() end) 20161031 03:20:29-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20161031 03:20:35-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth 20161031 03:22:13< lamefun> DeFender1031, http://paste.ofcode.org/g4sabYMkA3xLB6gpcuiXRd 20161031 03:24:02< DeFender1031> i don't know what's going on in this code 20161031 03:27:09< edaq> I see you are here and on Unv lamefun 20161031 03:27:13< edaq> very nice games 20161031 03:27:20< edaq> do you dev for any of them? 20161031 03:27:25< lamefun> I'm not on Unv anymore. 20161031 03:27:29< lamefun> Not until it's done. 20161031 03:29:36-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has quit [Ping timeout: 260 seconds] 20161031 03:34:15< edaq> ah 20161031 03:34:18< edaq> bummer lamefun 20161031 03:34:24< edaq> but nice to see you here 20161031 03:34:35< edaq> how close is Unv to being done lamefun ? 20161031 03:35:19< edaq> I cant get any real dates or info from its dev 20161031 03:35:21< edaq> devs 20161031 03:37:07< lamefun> DeFender1031, http://paste.ofcode.org/pk9EihPKxfzm4Y4kHFrVzf 20161031 03:37:12< lamefun> I'll translate this to Lua now. 20161031 03:37:21< lamefun> (pseudocode of course, as there's no call_cc) 20161031 03:37:51< edaq> are you a dev here lamefun ? 20161031 03:37:54< lamefun> no 20161031 03:37:59< edaq> bummer 20161031 03:38:11< edaq> well I hear a development version of wesnoth was released 20161031 03:38:15< edaq> very nice :) 20161031 03:42:06< lamefun> DeFender1031, http://paste.ofcode.org/sWuQJFD9jWakvyG6k4RcUv - Lua pseudocode. 20161031 03:42:50< lamefun> In Scheme, this actually works. 20161031 03:44:33< lamefun> Nice feature, isn't it? 20161031 03:49:01< DeFender1031> lamefun, it's still not clear to me what this feature would do 20161031 03:49:47< DeFender1031> all i'm seeing here is what seems to be a closure 20161031 03:50:15< lamefun> well, what does back_to_my_function() do? 20161031 03:51:19< lamefun> can you guess? 20161031 03:53:49-!- ArneBab_ [~quassel@55d447c9.access.ecotel.net] has joined #wesnoth 20161031 03:54:27< DeFender1031> it seems to run my_function() 20161031 03:55:17< lamefun> what if you put print('ABC') before call_cc call, would it be run? 20161031 03:56:08< lamefun> print('Setting time machine return point!') would be an accurate message 20161031 03:57:52-!- ArneBab [~quassel@55d44546.access.ecotel.net] has quit [Ping timeout: 256 seconds] 20161031 03:59:07< lamefun> DeFender1031, http://paste.ofcode.org/9c8nLuGHspE6fFwUkkENCx 20161031 04:00:49< DeFender1031> so it basically sets up a returning point and goes back tothat until it tells it to stop 20161031 04:05:36< lamefun> Now why I want it: http://paste.ofcode.org/nEXrSzZMChzmxtmACzX5MW 20161031 04:35:42-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has joined #wesnoth 20161031 05:42:50-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Read error: Connection reset by peer] 20161031 05:43:12-!- vultraz [~chatzilla@124.109.10.167] has joined #wesnoth 20161031 05:43:12-!- vultraz [~chatzilla@124.109.10.167] has quit [Changing host] 20161031 05:43:13-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth 20161031 05:53:31< lamefun> Well, it was fun: http://paste.ofcode.org/iXwKYa2cCetnKTSarAyG6E 20161031 05:58:26< lamefun> 100% recursion-proof! 20161031 06:00:33-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Read error: Connection timed out] 20161031 06:02:53-!- vultraz [~chatzilla@124.109.10.167] has joined #wesnoth 20161031 06:02:53-!- vultraz [~chatzilla@124.109.10.167] has quit [Changing host] 20161031 06:02:53-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth 20161031 06:19:55-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Read error: Connection timed out] 20161031 06:21:23-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth 20161031 06:29:34-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Ping timeout: 244 seconds] 20161031 06:30:53-!- vultraz [~chatzilla@124.109.10.167] has joined #wesnoth 20161031 06:30:53-!- vultraz [~chatzilla@124.109.10.167] has quit [Changing host] 20161031 06:30:53-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth 20161031 07:09:42-!- ChipmunkV [~vova@static-89-94-113-91.axione.abo.bbox.fr] has joined #wesnoth 20161031 07:22:09-!- lamefun [~lamefun@176.214.213.69] has quit [Quit: Leaving] 20161031 07:59:20-!- ChipmunkV [~vova@static-89-94-113-91.axione.abo.bbox.fr] has quit [Quit: ChipmunkV] 20161031 08:01:42< celticminstrel> DeFender1031, lamefun: I'm just wondering, if the serializer produces valid Lua code, why can't you just use loadstring() to deserialize? 20161031 08:02:29 * celticminstrel not expecting answer now, sleep time. 20161031 08:02:44-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has quit [Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] 20161031 08:13:44-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Read error: Connection timed out] 20161031 08:14:44-!- vultraz [~chatzilla@124.109.10.167] has joined #wesnoth 20161031 08:14:44-!- vultraz [~chatzilla@124.109.10.167] has quit [Changing host] 20161031 08:14:44-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth 20161031 08:18:50-!- VultCave [~chatzilla@124.109.10.167] has joined #wesnoth 20161031 08:18:50-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Read error: Connection reset by peer] 20161031 08:19:11-!- VultCave is now known as vultraz 20161031 08:21:35-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth 20161031 08:32:05-!- Jetrel [~Jetrel@2001:558:6014:1e:2422:435:dd84:bbf3] has quit [Quit: "The highest possible stage in moral culture is when we recognize that we ought to control our thoughts." - Charles Darwin] 20161031 08:34:07-!- NeaN [~elouin@fob.spline.inf.fu-berlin.de] has joined #wesnoth 20161031 08:38:42-!- ChipmunkV [~vova@static-89-94-113-91.axione.abo.bbox.fr] has joined #wesnoth 20161031 09:13:31-!- ArneBab_ is now known as ArneBab 20161031 09:13:31-!- ArneBab [~quassel@55d447c9.access.ecotel.net] has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.] 20161031 09:19:01-!- ArneBab [~quassel@55d447c9.access.ecotel.net] has joined #wesnoth 20161031 09:24:45-!- ArneBab [~quassel@55d447c9.access.ecotel.net] has quit [Changing host] 20161031 09:24:45-!- ArneBab [~quassel@freenet/developer/arnebab] has joined #wesnoth 20161031 09:29:22-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has quit [Ping timeout: 256 seconds] 20161031 09:50:02-!- vultraz [~chatzilla@124.109.10.167] has quit [Ping timeout: 244 seconds] 20161031 09:53:00-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has joined #wesnoth 20161031 10:06:33-!- louis94 [~~louis94@91.178.241.125] has joined #wesnoth 20161031 10:11:21-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has joined #wesnoth 20161031 10:46:48-!- louis94 [~~louis94@91.178.241.125] has quit [Quit: Konversation terminated!] 20161031 11:14:05-!- Vadatajs [~Vadatajs@63-152-109-108.cdrr.qwest.net] has joined #wesnoth 20161031 11:35:42-!- Vadatajs [~Vadatajs@63-152-109-108.cdrr.qwest.net] has quit [Read error: Connection reset by peer] 20161031 11:37:19-!- jemadux [~jemadux@unaffiliated/jemadux] has joined #wesnoth 20161031 12:47:37-!- jemadux [~jemadux@unaffiliated/jemadux] has quit [Remote host closed the connection] 20161031 12:59:02-!- jemadux [~jemadux@unaffiliated/jemadux] has joined #wesnoth 20161031 13:04:56-!- jemadux [~jemadux@unaffiliated/jemadux] has quit [Ping timeout: 250 seconds] 20161031 13:07:17-!- edaq [~edaq3@h184-60-58-252.cytnin.broadband.dynamic.tds.net] has quit [Quit: Leaving] 20161031 13:11:43-!- bumbadadabum [~bumbadada@wesnoth/developer/bumbadadabum] has quit [Ping timeout: 245 seconds] 20161031 13:22:40-!- bumbadadabum [~bumbadada@wesnoth/developer/bumbadadabum] has joined #wesnoth 20161031 13:24:28-!- ToBeCloud [uid51591@wikimedia/ToBeFree] has joined #wesnoth 20161031 14:42:25-!- ArneBab [~quassel@freenet/developer/arnebab] has quit [Ping timeout: 260 seconds] 20161031 15:29:48-!- Kranix [~magnus@80.196.50.74] has joined #wesnoth 20161031 15:31:07-!- ToBeCloud [uid51591@wikimedia/ToBeFree] has quit [Quit: Connection closed for inactivity] 20161031 16:43:40-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has joined #wesnoth 20161031 17:13:16-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has quit [Ping timeout: 265 seconds] 20161031 18:12:10-!- claymore [~claymore@unaffiliated/claymore] has joined #wesnoth 20161031 18:15:44-!- wario [~wario_@unaffiliated/wario] has joined #wesnoth 20161031 18:17:14-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has joined #wesnoth 20161031 18:34:38-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has quit [Ping timeout: 245 seconds] 20161031 18:49:38-!- Kwandulin [~Miranda@p5DDD2B8F.dip0.t-ipconnect.de] has joined #wesnoth 20161031 19:15:55-!- ArneBab [~quassel@55d447c9.access.ecotel.net] has joined #wesnoth 20161031 19:15:55-!- ArneBab [~quassel@55d447c9.access.ecotel.net] has quit [Changing host] 20161031 19:15:55-!- ArneBab [~quassel@freenet/developer/arnebab] has joined #wesnoth 20161031 19:37:25-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has joined #wesnoth 20161031 19:47:40-!- Kranix [~magnus@80.196.50.74] has quit [Ping timeout: 250 seconds] 20161031 19:57:45-!- Kranix [~magnus@185.118.249.51] has joined #wesnoth 20161031 19:59:41-!- Kwandulin [~Miranda@p5DDD2B8F.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20161031 20:10:12-!- Kranix [~magnus@185.118.249.51] has quit [Ping timeout: 250 seconds] 20161031 20:10:28-!- Kranix [~magnus@185.118.249.51] has joined #wesnoth 20161031 20:23:12-!- Kranix [~magnus@185.118.249.51] has quit [Ping timeout: 260 seconds] 20161031 20:35:03-!- Kranix [~magnus@x1-6-74-44-01-e4-f1-52.cpe.webspeed.dk] has joined #wesnoth 20161031 20:38:31-!- lamefun [~lamefun@176.214.213.69] has joined #wesnoth 20161031 20:44:29< lamefun> can [object]s contain arbitrary code? 20161031 20:53:15< DeFender1031> of what sort? 20161031 20:54:53< lamefun> of any sort (this is what arbitrary means) 20161031 20:56:34< lamefun> I see the whole [object] stuff as stupid. 20161031 20:57:00< lamefun> If it doesn't allow arbitrary code I mean. 20161031 20:57:56< zookeeper> uh 20161031 20:58:16< zookeeper> sure you can put whatever you want in there. doesn't mean it will magically _do_ anything, though :p 20161031 20:58:31< zookeeper> your question is too vague. maybe [then] is what you want, maybe not. 20161031 20:59:15< lamefun> I mean that executes every time an object is to be applied. 20161031 21:00:13< zookeeper> in that case, no 20161031 21:07:24-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has quit [Ping timeout: 250 seconds] 20161031 21:11:34< DeFender1031> right, what zookeeper said was my question 20161031 21:14:36-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has joined #wesnoth 20161031 21:22:40-!- Appleman1234 [~Appleman1@KD106181164020.au-net.ne.jp] has quit [Ping timeout: 265 seconds] 20161031 21:27:35< celticminstrel> That's true in 1.12. In 1.13 you can extend [effect] to do anything you want. 20161031 21:44:04-!- vultraz [~chatzilla@wesnoth/developer/vultraz] has quit [Ping timeout: 244 seconds] 20161031 21:48:25-!- jemadux [~jemadux@unaffiliated/jemadux] has joined #wesnoth 20161031 21:51:16-!- louis94 [~~louis94@91.178.241.125] has joined #wesnoth 20161031 21:57:00-!- claymore [~claymore@unaffiliated/claymore] has quit [Quit: Leaving] 20161031 22:07:06-!- can-ned_food [~me@dynamic-acs-24-154-138-63.zoominternet.net] has joined #wesnoth 20161031 22:07:26-!- can-ned_food is now known as can-ned_brains 20161031 22:08:08< can-ned_brains> hiya everybody 20161031 22:09:30< celticminstrel> 'lo 20161031 22:09:51< can-ned_brains> has anyone ever done any hacks that redirect a variable string to the name of a new variable? 20161031 22:10:05< can-ned_brains> or should i just write my mp mod in Lua neat? 20161031 22:10:08< celticminstrel> I'm not sure what you mean. 20161031 22:10:27< celticminstrel> If you want to substitute a variable whose name is stored in a variable, that's possible. 20161031 22:10:32< can-ned_brains> i'd like a variable named for the x,y location of each village 20161031 22:10:48< celticminstrel> $my_var_$x|_$y|| 20161031 22:10:59< celticminstrel> (The last | may be optional.) 20161031 22:11:23< celticminstrel> Variable substitution is applied from right to left and is a simple text substitution. 20161031 22:11:38< can-ned_brains> see, i was having problems with the delayed expansion. thanks, i misunderstood the format 20161031 22:11:54< can-ned_brains> so simple. 20161031 22:11:57< zookeeper> there's mainline examples for exactly that, in fact 20161031 22:12:48-!- louis94 [~~louis94@91.178.241.125] has quit [Quit: Konversation terminated!] 20161031 22:13:45< zookeeper> https://github.com/wesnoth/wesnoth/blob/1.12/data/campaigns/Descent_Into_Darkness/scenarios/02_Peaceful_Valley.cfg#L234 20161031 22:14:19-!- ToBeCloud [uid51591@wikimedia/ToBeFree] has joined #wesnoth 20161031 22:15:57< can-ned_brains> yeah, i was using the | in reverse, hoping it would delay expansion for the first $ 20161031 22:16:28< can-ned_brains> which was very convoluted. anyways. 20161031 22:24:39< celticminstrel> $| expands to a dollar sign. 20161031 22:25:02< can-ned_brains> yup, i noticed that too. 20161031 22:27:30-!- Vadatajs [~Vadatajs@63-152-109-108.cdrr.qwest.net] has joined #wesnoth 20161031 22:29:06-!- ChipmunkV [~vova@static-89-94-113-91.axione.abo.bbox.fr] has quit [Quit: ChipmunkV] 20161031 22:40:52-!- jemadux [~jemadux@unaffiliated/jemadux] has quit [Ping timeout: 260 seconds] 20161031 22:44:31-!- louis94 [~~louis94@91.178.241.125] has joined #wesnoth 20161031 22:47:08< DeFender1031> celticminstrel, wait, if $| expands to a dollar sign, and $| is also used to signify non-delayed substitution, how does one use an actual dollar sign before an alphanumeric character? 20161031 22:47:30-!- jemadux [~jemadux@unaffiliated/jemadux] has joined #wesnoth 20161031 22:50:48< celticminstrel> DeFender1031: What? 20161031 22:51:54< celticminstrel> The $...| syntax is general variable substitution, with the | being optional if followed by a non-alphanumeric character (plus underscore, dot, and square brackets). 20161031 22:52:07< celticminstrel> If the variable name is empty, it expands to a dollar sign. 20161031 22:52:25-!- Appleman1234 [~Appleman1@KD106181166169.au-net.ne.jp] has joined #wesnoth 20161031 22:53:25< celticminstrel> If you write something like "$|stuff|" in an inner event, it becomes equivalent to delayed variable substitution because at the time of adding, the "$|" is expanded to a dollar sign, resulting in the string "$stuff|". Then when the event is run, that will be expanded to the value of the variable "stuff". 20161031 22:53:30< celticminstrel> Does that answer your question? 20161031 22:54:09< celticminstrel> The reason why "$|" can be used to delay substitution is precisely because it expands to a dollar sign. 20161031 23:09:54-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 256 seconds] 20161031 23:26:22-!- Appleman1234 [~Appleman1@KD106181166169.au-net.ne.jp] has quit [Ping timeout: 244 seconds] 20161031 23:26:46-!- Appleman1234 [~Appleman1@KD106181166169.au-net.ne.jp] has joined #wesnoth 20161031 23:28:15< DeFender1031> OHHHHHHHHHHHH 20161031 23:28:21-!- Kranix [~magnus@x1-6-74-44-01-e4-f1-52.cpe.webspeed.dk] has quit [Quit: Konversation terminated!] 20161031 23:28:24< DeFender1031> the last line is what did it for me 20161031 23:28:31< DeFender1031> and that's awesome 20161031 23:29:30< DeFender1031> and actually answers another question I had, which is if there's a triple-nested event. how does one specify that the variables should come from outer vs. middle, vs. inner, but that's just be $var vs. $|var vs. $||var 20161031 23:45:05-!- Appleman1234 [~Appleman1@KD106181166169.au-net.ne.jp] has quit [Ping timeout: 252 seconds] 20161031 23:58:23-!- wario [~wario_@unaffiliated/wario] has quit [Quit: Leaving] --- Log closed Tue Nov 01 00:00:34 2016