--- Log opened Thu Jul 05 00:00:26 2018 20180705 00:08:27-!- mattsc [~mattsc@wesnoth/developer/mattsc] has joined #wesnoth-umc-dev 20180705 01:19:03< discordbot1> Also an interesting solution: https://github.com/wesnoth/wesnoth/commit/c7cda91250fac85ab371ec9ed3593e6c11381deb#diff-cb205b0052a07bc004ef8b6189ae4162 20180705 02:58:04-!- mattsc [~mattsc@wesnoth/developer/mattsc] has quit [Quit: So long and thanks for all the fish.] 20180705 04:49:38-!- irker969 [~irker@uruz.ai0867.net] has quit [Quit: transmission timeout] 20180705 13:45:14-!- hk238 [~kvirc@unaffiliated/hk238] has joined #wesnoth-umc-dev 20180705 13:47:23< hk238> hello 20180705 14:08:52< discordbot1> hi 20180705 14:10:47< hk238> I was rewriting the code, haven't tested if the converter works yet but assuming it does 20180705 14:11:08< discordbot1> Nice 20180705 14:11:16< hk238> I'm just calling it with convert_to_wml_table and the corresponding lua table function 20180705 14:11:27< discordbot1> all right 20180705 14:11:34< discordbot1> you might wanna read the radme.md for that 20180705 14:11:45< hk238> that's too sophisticated for my crude ways 20180705 14:11:50< hk238> :D 20180705 14:12:08< discordbot1> https://github.com/Choicerer/Wesnoth_Table_Converter 20180705 14:12:11< hk238> but I guess I could 20180705 14:12:21< discordbot1> it explains something 20180705 14:12:40< discordbot1> " It will only work for wml tables that are prefixed by a [1] index, that is any subtables must go inside that [1] and it must be the only top index. " 20180705 14:12:57< discordbot1> but 20180705 14:13:00< discordbot1> basically 20180705 14:13:22< hk238> huh? 20180705 14:13:22< discordbot1> that's if you want to convert a wml table that you hadn't previously converted with the converter 20180705 14:13:31< discordbot1> huh? 20180705 14:13:42< discordbot1> essentially 20180705 14:13:48< hk238> what does it mean "prefixed by a [1] index" ? 20180705 14:14:02< discordbot1> it means er 20180705 14:14:17< discordbot1> okay, so you are taking a lua table, converting it to wml, then converting it back to lua? 20180705 14:14:22< hk238> yeah 20180705 14:14:26< discordbot1> okay, that's fine then 20180705 14:14:39< discordbot1> this only matters if you have a wml array you defined in wml first 20180705 14:14:48< discordbot1> sorry, bullshit 20180705 14:14:53< discordbot1> i don't know what i'm saying 20180705 14:15:00< hk238> :D 20180705 14:15:09< hk238> okay so it probably works 20180705 14:15:26< hk238> now I have to figure out some way of weighting a random selection between different tables based on turn number 20180705 14:15:47< hk238> basically I was thinking about creating pools like "minor_spawns" "major_spawns" for starters 20180705 14:16:05< hk238> and you'd have minor_spawns in the early part of the game, with high probability, and major spawns in the latter part of the game, with high probability 20180705 14:16:08< discordbot1> I actually have no idea why I wrote that, since I prefix it in the script 20180705 14:16:15< discordbot1> I'll have to investigate 20180705 14:16:18< hk238> :D 20180705 14:16:20< discordbot1> Yeah okay? 20180705 14:16:22< discordbot1> Go on 20180705 14:16:39< hk238> well I'm just writing the function and haven't gotten any ideas yet 20180705 14:17:05< discordbot1> Well, it sounds nice 20180705 14:17:15< hk238> datastructure will be simple, a table, with key "pointer" , and the value is the actual table, and "weight" and the value is somekind of weight formula for turn number 20180705 14:17:19< discordbot1> btw, you know you can look up wml variables in-game? 20180705 14:17:26< hk238> and then I have to have a function that picks one of them 20180705 14:17:31< hk238> no I don't :d 20180705 14:17:53< hk238> you got any ideas how to convert turn number into probability 20180705 14:17:56< discordbot1> okay, you obviously know how to access the command input box, since you're a regular who's hiding under a new nickname 20180705 14:18:10< hk238> command input box? 20180705 14:18:11< hk238> :D 20180705 14:18:20< discordbot1> the thing you do when you want to assign control 20180705 14:18:22< discordbot1> to a playre 20180705 14:18:30< hk238> oh yes I know that one 20180705 14:18:33< discordbot1> so from that box type debug 20180705 14:18:36< discordbot1> then type inspect 20180705 14:18:43< discordbot1> and you get a nice menu 20180705 14:18:47< hk238> but I've had this nickname on irc always at least 20180705 14:18:50< hk238> :D 20180705 14:18:56< discordbot1> yeah, all right 😉 20180705 14:19:21< hk238> also I got just a couple of hours of experience with lua so far 20180705 14:19:52< discordbot1> nice 20180705 14:19:55< hk238> but I have some (though quite little overall) experience with c++ javascript python, and extremely little with ruby and haskell 20180705 14:19:56< discordbot1> you could read a tutorial 20180705 14:20:07< discordbot1> all right 20180705 14:20:08< hk238> so far lua seems most like javascript 20180705 14:20:29< discordbot1> https://www.lua.org/pil/1.html 20180705 14:20:35< discordbot1> good reference and tutorial 20180705 14:20:43< discordbot1> so if you want to know if my script works 20180705 14:20:48< discordbot1> inspect those wml arrays in-game 20180705 14:20:57< hk238> I'm assuming it works I'll get to that later 20180705 14:20:57< hk238> :D 20180705 14:21:12< discordbot1> inspecting in-game is very important for modiding 20180705 14:21:16< discordbot1> in wesnoth, helps a lot 20180705 14:21:17< hk238> current problem is of a creative sort I can't decide how to choose these probabilities 20180705 14:21:20< discordbot1> maybe read up more 20180705 14:21:24< hk238> maybe gaussian function? :d 20180705 14:21:26< discordbot1> on wml 20180705 14:21:29< discordbot1> the wiki 20180705 14:21:35< hk238> sigmoid function :D 20180705 14:22:09< hk238> another thing I was thinking maybe 20180705 14:22:32< discordbot1> Errrr 20180705 14:23:18< hk238> mm I don't know :o 20180705 14:23:31< discordbot1> Yeah, that wouldn't make any sense, use helper.rand instead 20180705 14:23:47< hk238> I mean 20180705 14:24:04< hk238> It's not that I don't know how to generate random numbers I'm having trouble deciding how to weight these odds as a function of turns 20180705 14:24:15< hk238> like I want these minor enemies to spawn in early game, and major enemies to spawn in latter game 20180705 14:24:27< hk238> and that would happen by choosing a random pool for each wave as a function of turns 20180705 14:25:03< hk238> so I could for an example say the "odds" for one table is "turns" and for the other one is "10 + turns" and then I'll just choose one by random 20180705 14:25:23< hk238> I'd like for it to be something neat though this seems crude 20180705 14:27:01< hk238> gaussian function seems cool maybe something with that 20180705 14:32:53< hk238> yeah I could store the parameters to the function as the weights and use turns for x axis basically 20180705 14:35:08< hk238> well that was short :D 20180705 14:46:55< hk238> hmm maybe this doesn't actually have the properties I was looking for 20180705 14:54:34< hk238> nevermind I guess the normalized gaussian function didn't have the properties I was looking for, because it was normalized 20180705 14:54:35< hk238> :D 20180705 14:59:52< hk238> is there some convenient map function implementation for lua? 20180705 15:00:26< hk238> or maybe I need to do that 20180705 15:08:19< hk238> https://pastebin.com/DXRA1KgV 20180705 15:08:26< hk238> trying to implement some sort of map here 20180705 15:08:31< hk238> does this seem correct? 20180705 15:08:44< hk238> using the version key_map here 20180705 15:09:01< hk238> for one I forgot equals sign 20180705 15:09:01< hk238> :D 20180705 15:10:43< hk238> hmm im doing wrong 20180705 15:11:48< hk238> what I'm trying to do and what I'm actually doing don't match very well 20180705 15:11:49< hk238> :D 20180705 15:12:32< hk238> because I want the new table to have key that is the value of pointer, but then I need to make it so key map returns two values, one for the new key and one for the value 20180705 15:17:01< hk238> https://pastebin.com/Nbm3mvV9 20180705 15:17:11< hk238> new version it's supposed to be using key_transform this time but I forgot to change the function call 20180705 15:17:14< hk238> any help with this? 20180705 15:17:16< hk238> :d 20180705 15:17:52< hk238> is the anonymous function even remotely syntactically correct? 20180705 15:18:21< hk238> and what about the destructuring statement with curlies? I think that probably doens't work in lua 20180705 15:18:29< hk238> should probably assign an actual table and the values into it 20180705 15:26:06< hk238> ahh this still doesnt work I'm still not doing what I'm supposed to be doing 20180705 15:29:04< hk238> https://pastebin.com/3rv2nZDJ 20180705 15:29:06< hk238> 1 more attempt 20180705 15:29:06< hk238> :D 20180705 15:29:29< hk238> the anonymous function on lines 46 to 52 can you do it like that? 20180705 15:42:16< discordbot1> Your syntax for the anonymous function itself is correct. 20180705 15:42:47< discordbot1> However, you're attempting to access nonexistent variables "key", "value" and "turn". 20180705 15:42:59< hk238> oh so they're not available in that scope? 20180705 15:43:29< hk238> oh I guess I need to put the key and value into quotation marks 20180705 15:43:39< hk238> since it's supposed to be literally "key" 20180705 15:43:39< hk238> :D 20180705 15:44:19< discordbot1> You can also use this: 20180705 15:44:19< hk238> but why is turn not available? it's the argument to the outmost function? 20180705 15:44:34< hk238> is it scope issue? 20180705 15:44:34< discordbot1> lua sub_response.key = element_pointer 20180705 15:44:42< hk238> yes that's what I was trying to do 20180705 15:45:18< discordbot1> Ah, you're right. I missed that the outermost function receives the turn parameter. 20180705 15:45:23< hk238> why the word "lua" though? are you on discord? 20180705 15:45:28< discordbot1> Indeed, it's in scope and usable. 20180705 15:45:35< hk238> okay cool 20180705 15:45:48< discordbot1> Yes, I'm in Discord. Here the "lua" word enables Lua syntax highlighting. 20180705 15:45:57< hk238> I mean does discord add the "lua" tag or something.. okay :o 20180705 15:46:09< discordbot1> It's a bug that the bot passes the word to IRC instead of stripping it. 20180705 15:46:50< hk238> by the way do you still have that random function implementation in lua that takes stuff with value up to 1 and chooses randomly? 20180705 15:46:55< hk238> I could use that here 20180705 15:47:31< discordbot1> Here: https://gist.github.com/jyrkive/08807b2e4c8b8660c2935e9e7161b647 20180705 15:47:37< hk238> thanks 20180705 15:49:04< hk238> hmm I guess I could put normalization directly into that function though, and I guess with an array of weights normalization is equivalent to dividing with the sum of the weights? 20180705 15:49:27< discordbot1> Yes. 20180705 15:50:07< hk238> alright :o 20180705 15:55:07-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180705 15:55:13-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180705 15:59:32< hk238> ahh I'm exhausted thanks for help again I think I'll finish this tomorrow.. maybe on weekend make a 3p version too :D 20180705 16:47:05-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180705 16:47:11-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180705 17:25:31-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180705 17:25:38-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180705 17:40:24-!- hk238 [~kvirc@unaffiliated/hk238] has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/] 20180705 22:30:40-!- mattsc [~mattsc@wesnoth/developer/mattsc] has joined #wesnoth-umc-dev 20180705 23:39:23-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180705 23:39:29-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev --- Log closed Fri Jul 06 00:00:27 2018