--- Log opened Wed Aug 22 00:00:40 2018 20180822 01:19:19-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 01:19:25-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 02:56:54-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 02:57:00-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 03:41:00-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 03:41:06-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 04:42:26-!- vn971 [~vasya@94.158.103.15] has quit [Ping timeout: 272 seconds] 20180822 04:43:32-!- vn971 [~vasya@94.158.103.15] has joined #wesnoth-umc-dev 20180822 06:37:45-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20180822 07:58:18<+wesdiscordbot> I can't find any information anywhere about removing a unit type from the recruit list. Anyone here know how? 20180822 07:59:42< zookeeper> ReferenceWML -> DirectActionsWML -> [disallow_recruit] 20180822 08:00:14<+wesdiscordbot> Looks solid. Thanks. 👌 20180822 08:05:11< vn971> @abledbody if you're working from Lua, you can also assign a new recruit array to any unit/side. 20180822 08:05:41< vn971> like unit.recruit = {"Peasant", "Mage"} 20180822 08:06:33<+wesdiscordbot> If I'd known LUA was an option I probably would've tried that first, but now I'm working in WML. 20180822 08:08:12<+wesdiscordbot> Nitpicking: Lua isn't an acronym. It's a Portuguese word that means "moon". 😛 20180822 08:08:58<+wesdiscordbot> I didn't put much thought into whether or not it was an acronym, but I thought it was capitalized. Guess not. 20180822 08:10:55<+wesdiscordbot> Where would the [disallow_recruit] tag go? I can't get it to work in [side] or [event]. 20180822 08:12:01<+wesdiscordbot> [event] is correct. 20180822 08:13:27<+wesdiscordbot> [event] name=prestart [disallow_recruit] type="Saurian Skirmisher" side=1 [/disallow_recruit] [/event] Not doing a thing. 20180822 08:15:30< zookeeper> that WML _is_ correct. where are you putting that [event] and what is the context anyway? 20180822 08:16:19<+wesdiscordbot> In [scenario]. The Saurians got left behind. 20180822 08:16:43 * zookeeper tries it 20180822 08:18:35< zookeeper> well what do you know, it really doesn't work. 20180822 08:20:05<+wesdiscordbot> Does the Saurian Skirmisher have some weird ID that doesn't match its name? 20180822 08:20:36< zookeeper> no, i'm pretty sure it's another recruit-related feature that has broken [disallow_recruit]. 20180822 08:20:46<+wesdiscordbot> Ech. 20180822 08:21:15< zookeeper> i'd say... try [disallow_extra_recruit] instead (and as the filter, give the leader) 20180822 08:21:54< zookeeper> ah well, i'll try it myself, just a second 20180822 08:22:22<+wesdiscordbot> The implementation of [disallow_recruit]: https://github.com/wesnoth/wesnoth/blob/1.14/data/lua/wml-tags.lua#L181 20180822 08:22:52< zookeeper> yeah that works. you can just switch [disallow_recruit] to [disallow_extra_recruit] and type= to extra_recruit= and it seems like it works that way. 20180822 08:23:27< zookeeper> @jyrkive i presume that currently recruits are fetched from the leader unit, not from the side, causing [disallow_recruit] to actually do nothing. 20180822 08:23:55<+wesdiscordbot> [disallow_extra_recruit] worked. 20180822 08:24:42<+wesdiscordbot> Btw, is there an easy way of reloading Wesnoth? I'm tired of having to close and open the thing constantly. 20180822 08:24:52< zookeeper> you can press F5 in the titlescreen 20180822 08:25:15<+wesdiscordbot> 'Ey, nice. 20180822 08:26:42< zookeeper> @jyrkive and if my hypothesis is correct, then i believe whoever implemented all this per-leader-recruits stuff didn't think things entirely through. 20180822 08:27:18<+wesdiscordbot> When were they implemented? Are they new in 1.14? 20180822 08:28:45< zookeeper> not sure whether they were in 1.12 already 20180822 08:29:36< zookeeper> yeah, in 1.12 already 20180822 08:30:22<+wesdiscordbot> I think it can't really be fixed at this point. There probably are add-ons which rely on [disallow_recruit] not affecting unit recruits. 20180822 08:30:53< zookeeper> maybe, i dunno. 20180822 08:31:45< zookeeper> the implementation is all wrong though if leaders created for a side inherit the side's recruit list and thus all removals from the side's recruit list do nothing. 20180822 08:32:27< zookeeper> the leaders should only carry a list of additions/removals with them, not a complete inherited list 20180822 08:33:23< zookeeper> i'm guessing that the recruit code combines both the leader's recruit list and the side's recruit list, which is why [allow_recruit] works but [disallow_recruit] doesn't. 20180822 08:51:24<+wesdiscordbot> While I'm here, do the {TRAIT_} macros go in [side] / [unit]? 20180822 08:55:51<+wesdiscordbot> Nvm, figured it out. 20180822 09:30:19< vn971> @abledbody sry, was away and didn't get a "mention". Just for the record, you can mix Lua and WML if you want. In fact, you cannot even use Lua without WML, it's always a mix (wesnoth current constraint). 20180822 09:30:19< vn971> The usefulness of this depends on the task though. Like if you want to fire-and-forget some complex logic, you can as well enjoy doing it in Lua. If you want to change something in the middle of a complex WML though, it could be easier to leave it as is and add a small hack to get what you want. 20180822 09:32:19< zookeeper> yeah, i wouldn't exactly recommend doing simple tasks in lua simply because you can, but it's good for particularly complex operations. 20180822 09:33:57< vn971> zookeeper: A rule I would use for deciding this: if you ever start needing a "loop" (iterating some elements), switch to Lua until it's too late and you're trapped in unreadable buggy code :) While you have no loops, feel free to do everything in WML & the variables. 20180822 09:35:53< vn971> Though I'm seriously impressed how some people manage to write complex logic - including loops, macros and such - in pure WML. I wouldn't be able to repeat this sanely, but it's awesome how some people manage it. 20180822 09:36:08< zookeeper> i strongly object to the notion that WML loops are unreadable and buggy! heck, converting existing loops to lua has probably resulted in more bugs than the original ones ever had. 20180822 09:36:45< vn971> zookeeper: if you convert any kind of code, you always get bugs. That's pretty obvious in almost any programming context. 20180822 09:38:56< zookeeper> i consider the main downside of writing complex logic in WML to be that it gets long and verbose, i don't find it unreadable or hard to understand otherwise. 20180822 09:39:37< zookeeper> well, macro-heavy WML is another matter of course. _that_ is hard to read. 20180822 09:45:42< vn971> zookeeper: you also lack: 20180822 09:45:42< vn971> * functions as variables 20180822 09:45:42< vn971> * Lua table functionality (has maps) 20180822 09:45:42< vn971> * tables as variables (which you can pass around etc) 20180822 09:45:42< vn971> * wesnoth Lua API itself. 20180822 09:45:42< vn971> * general Lua API: string manipulation capabilities, upper case / lower case functions, math library etc 20180822 09:45:43< vn971> But to be fair, you also get more complex initialization scheme in Lua. You really have to be careful with that one at times. 20180822 09:47:35<+wesdiscordbot> As far as I'm concerned, Lua's interpretation of a loop is unreadable buggy code. 20180822 09:47:59< Soliton> if you try to read WML and expect it to look/work like some other language you're bound to have trouble. same with any other combination of languages. 20180822 09:48:13<+wesdiscordbot> It looks and works a bit like HTML. 20180822 09:48:21< vn971> @abledbody for k, v in ipairs(my_array) do print(k, v) end -- this is unreadable buggy code? :-) 20180822 09:48:41< zookeeper> vn971, sure, but those are mostly convenience features that aren't inherently difficult to workaround with more verbose code in a simpler language such as WML, just more... lengthy. 20180822 09:49:06<+wesdiscordbot> [1] is unreadable buggy code. 20180822 09:49:24<+wesdiscordbot> Index from 1 is a nightmare for two reasons. 20180822 09:50:14< vn971> that one doesn't need explaining, I agree right on :D 20180822 09:50:23<+wesdiscordbot> Zero: It makes loopy math harder. One: It makes going back and forth between Lua and another language a pain in the butt. 20180822 10:40:06<+wesdiscordbot> I like indexing from 1. 20180822 10:40:29<+wesdiscordbot> I worked on a large Lua codebase for about 1,5 years, and got completely used to it. 20180822 10:40:41<+wesdiscordbot> I think it's more intuitive than indexing from 0. 20180822 10:46:22<+wesdiscordbot> Having to do this is so gross. Lua function fromRGB(red, green, blue) local greenPos = math.clamp( math.round(green * 15), 0, 15) local redPos = math.clamp( math.round(red * 15), 0, 15) local bluePos = math.clamp( math.round(blue * 15), 0, 15) local x = redPos + bluePos * 16 + 1 local y = greenPos + 1 return LUT[y][x] end 20180822 10:50:53<+wesdiscordbot> Especially when, like in the very scenario I wrote this for, you have to do this extremely often, to the degree that any extra operation will cost performance dearly. 20180822 10:51:19< vn971> @abledbody you know you can access `0` index as well right? 20180822 10:51:47<+wesdiscordbot> I wouldn't recommend it. Lua standard library assumes indexing from 0. 20180822 10:52:41< vn971> @jyrkive you mean from 1? Anyway, my point is: the code above feels like a hash table, not an array. For a hash table you can use whatever you like as keys. 20180822 10:53:19< vn971> I don't see any iteration on "LUT" at least. To be honest I have no idea what LUT even means or does. 20180822 10:54:28<+wesdiscordbot> How often you need to adjust table indices depends on what you're doing. Our project was a mobile game; sometimes we needed to calculate loop indices and add 1, but most of the time it was simple iteration, finding a matching element, that kind of stuff. 20180822 10:56:51<+wesdiscordbot> LUT is a table of a table of integers. 20180822 10:57:05<+wesdiscordbot> Stands for LookUp Texture. 20180822 10:57:30<+wesdiscordbot> It's used to convert RGB values into a color index. 20180822 10:58:00< vn971> @abledbody can you index it with 0 elements as well? 20180822 10:58:02<+wesdiscordbot> Without having to recalculate the nearest color every time, I mean. 20180822 10:58:29<+wesdiscordbot> Probably not. 20180822 10:58:58< vn971> @abledbody so it basically is a "cache" of pre-computed data. Hash-like interface (0 index) would do in this case. 20180822 10:58:59<+wesdiscordbot> I left out this bit, here. Lua LUT = loader.constructTexture("images/LUT.bmp") for i = 1, #LUT do for j = 1, #LUT[i] do LUT[i][j] = colors.fromRGB( LUT[i][j][1] * 255, LUT[i][j][2] * 255, LUT[i][j][3] * 255) end end 20180822 10:59:51<+wesdiscordbot> Hmm, apparently you have even low-level code in Lua. We had stuff like that in the game engine, which was written in C++ and maintained by a separate team. 20180822 11:00:43<+wesdiscordbot> It's a 3D rendering engine for ComputerCraft. 20180822 11:01:10<+wesdiscordbot> https://cdn.discordapp.com/attachments/437925567975915533/470643071818661888/2018-07-22_13-26-24.gif 20180822 11:03:12<+wesdiscordbot> Cool. 😃 I'd say that Lua doesn't fit well for writing rendering engines, though (1-based indexing is one reason). 20180822 11:04:14<+wesdiscordbot> There's one thing it's good at, in this case. I can pass code to shaders without having to worry about converting stuff or typedness. 20180822 11:04:33< vn971> Also, let's face it, rendering engines are not meant to be written in a CPU-oriented language at all. It's GPU that should do the heavy work. 20180822 11:04:48<+wesdiscordbot> Computercraft terminals don't have GPUs. 20180822 11:05:03<+wesdiscordbot> Or other options for programming languages. 20180822 11:05:20< vn971> maybe? Still though.:) 20180822 11:05:47<+wesdiscordbot> The reason I did it is that I shouldn't've. 20180822 11:22:16-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 11:22:22-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 12:14:44-!- vn971 [~vasya@94.158.103.15] has quit [Quit: Leaving.] 20180822 13:03:47-!- sevu [~sevu@141.57.61.193] has joined #wesnoth-umc-dev 20180822 13:57:04-!- vn971 [~vasya@94.158.103.15] has joined #wesnoth-umc-dev 20180822 14:09:57-!- hk238 [~kvirc@unaffiliated/hk238] has joined #wesnoth-umc-dev 20180822 14:10:11< hk238> hi 20180822 14:55:14-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 14:55:20-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 15:00:28-!- sevu [~sevu@141.57.61.193] has quit [Remote host closed the connection] 20180822 18:00:30-!- hk238 [~kvirc@unaffiliated/hk238] has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/] 20180822 18:16:09-!- Netsplit *.net <-> *.split quits: @ChanServ 20180822 18:22:28-!- Netsplit over, joins: @ChanServ 20180822 18:33:05-!- iwaim [~iwaim@2001:470:fd5c:2002:603a:105:9960:1aa7] has quit [Ping timeout: 265 seconds] 20180822 18:44:30-!- iwaim [~iwaim@rasteenie.alib.jp] has joined #wesnoth-umc-dev 20180822 19:15:29-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 19:15:35-!- janebot [~Gambot@206.189.184.60] has joined #wesnoth-umc-dev 20180822 19:16:07-!- janebot [~Gambot@206.189.184.60] has quit [Changing host] 20180822 19:16:07-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 19:27:05-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 19:27:11-!- janebot [~Gambot@206.189.184.60] has joined #wesnoth-umc-dev 20180822 19:27:30-!- janebot [~Gambot@206.189.184.60] has quit [Changing host] 20180822 19:27:31-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 19:41:49-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 19:41:55-!- janebot [~Gambot@206.189.184.60] has joined #wesnoth-umc-dev 20180822 19:42:16-!- janebot [~Gambot@206.189.184.60] has quit [Changing host] 20180822 19:42:16-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 19:49:40-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 19:49:46-!- janebot [~Gambot@206.189.184.60] has joined #wesnoth-umc-dev 20180822 19:50:09-!- janebot [~Gambot@206.189.184.60] has quit [Changing host] 20180822 19:50:10-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 20:12:57-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 20:13:03-!- janebot [~Gambot@206.189.184.60] has joined #wesnoth-umc-dev 20180822 20:13:21-!- janebot [~Gambot@206.189.184.60] has quit [Changing host] 20180822 20:13:21-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 21:08:58-!- sevu [~sevu@p548557AE.dip0.t-ipconnect.de] has joined #wesnoth-umc-dev 20180822 21:10:11< sevu> vn971, you could add Plan Advancments as dependency for Creep Wars in the add-on manager too 20180822 21:34:26-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180822 21:34:32-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180822 21:41:20-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 268 seconds] 20180822 22:49:50-!- Netsplit *.net <-> *.split quits: @ChanServ 20180822 23:03:26-!- Netsplit over, joins: @ChanServ 20180822 23:52:54-!- sevu [~sevu@p548557AE.dip0.t-ipconnect.de] has quit [Remote host closed the connection] --- Log closed Thu Aug 23 00:00:21 2018