--- Log opened Sat Mar 09 00:00:32 2019 20190309 01:03:54-!- celmin|away is now known as celticminstrel 20190309 06:02:55-!- celticminstrel is now known as celmin|sleep 20190309 07:33:09-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20190309 15:26:45<+wesdiscordbot> can someone pls tell me what is wrong with this line of code? 20190309 15:27:18<+wesdiscordbot> https://cdn.discordapp.com/attachments/442775044590927873/553962015991922698/a.PNG 20190309 15:27:30<+wesdiscordbot> for some reason it's faulty ... 20190309 15:29:43<+wesdiscordbot> you should use "to_x" and "to_y" instead of "x" and "y" 20190309 15:29:59<+wesdiscordbot> https://wiki.wesnoth.org/DirectActionsWML#.5Bmove_unit.5D 20190309 16:05:29<+wesdiscordbot> the schema should have caught this, really 20190309 16:06:48<+wesdiscordbot> but in master to_x and to_y aren't mandatory: https://github.com/wesnoth/wesnoth/blob/f38fa3d607ac49a6f4bbbb368155ec661ee76c57/data/lua/wml/move_unit.lua#L45-L51 20190309 16:08:57<+wesdiscordbot> so it wouldn't be correct to mark to_x as mandatory in the schema (REQUIRED_KEY). but I don't know what would be right. 20190309 16:11:33<+wesdiscordbot> what are the dir and to_location attributes? they don't seem to be documented on the wiki 20190309 16:13:26< celmin|sleep> to_location is like to_x but takes named locations. 20190309 16:13:31-!- celmin|sleep is now known as celticminstrel 20190309 16:13:46< celticminstrel> So you can plop a bunch of waypoints on your map and use them. 20190309 16:13:59< celticminstrel> dir performs a relative movement instead of an absolute movement. 20190309 16:14:27< celticminstrel> So you can use eg dir=n,n,nw to move two spaces north and then one space to the northwest. 20190309 16:18:47<+wesdiscordbot> what's a named location? 20190309 16:18:55< celticminstrel> location_id 20190309 16:19:12< celticminstrel> The locations you can add with the "new location" button in the map editor. 20190309 16:21:12<+wesdiscordbot> alright, thanks, I've added them to the wiki 20190309 16:21:37< celticminstrel> Thanks. 20190309 16:47:26<+wesdiscordbot> seconded 20190309 16:47:44<+wesdiscordbot> celmin, can the schema enforce that "to_x or dir or location must be present" ? 20190309 16:48:04< celticminstrel> Maybe? 20190309 16:48:44< celticminstrel> I'm not sure actually... 20190309 16:49:32< celticminstrel> Maybe some sort of "if key is present then key is required else error" construct would work? 20190309 16:50:04<+wesdiscordbot> there are two separate complications here 20190309 16:50:18<+wesdiscordbot> 1. if either to_x or to_y is specified then both should be 20190309 16:50:27<+wesdiscordbot> 2. either (to_x and to_y) or dir or location must be specified 20190309 16:51:06<+wesdiscordbot> @Pentarctagon thanks for updating the wiki. I've added DevFeature1.15 tagging now too, they aren't in 1.14 20190309 17:05:10< celticminstrel> Mmhm. 20190309 17:15:35<+wesdiscordbot> how complicated does it need to be? are there other tags that have similar requirements about which sets of keys are or aren't mutually exclusive? 20190309 17:15:59< celticminstrel> I think there are some probably. 20190309 17:16:10< celticminstrel> Maybe we should actually implement a new feature in the schema for this... 20190309 17:16:28< celticminstrel> IIRC I use the construct I mentioned somewhere. 20190309 17:17:06<+wesdiscordbot> that would solve my 1), about to_x and to_y needing to both be present 20190309 17:17:40< celticminstrel> You could probably write a construct of the form "if to_x or to_y are present then to_x and to_y are required". 20190309 17:17:43<+wesdiscordbot> but it wouldn't address "either to_x or dir or location", and in fact that should be an exclusive or, if both to_x and dir are specified that's likely a mistake 20190309 17:17:52< celticminstrel> I think 1) is actually the easiest of the two to solve. 20190309 17:18:17<+wesdiscordbot> I see 20190309 17:18:59< celticminstrel> The hard part is enforcing at least one of the three... and enforcing exactly one is probably even harder. 20190309 17:19:39<+wesdiscordbot> I just don't have any intuition for how complicated a solution would need to be. 20190309 17:20:24<+wesdiscordbot> do we need to support arbitrary propositional logic formulas? Or just have a builtin syntax for "one of the following alternatives must be true" 20190309 17:20:46< celticminstrel> The latter sounds sufficient to me? 20190309 17:20:47<+wesdiscordbot> Would it be an option to just specify a Lua function that receives all found keys as a table and returns a boolean about whether they pass validation? 20190309 17:21:01<+wesdiscordbot> so we could have EXACTLY_ONE_OF( to_x mandatory, to_y mandatory, dir forbidden, location forbidden; to_x forbidden, to_y forbidden, dir mandatory, location forbidden; ...) 20190309 17:21:16< celticminstrel> That's impossible. There's no Lua kernel guaranteed to be available during config parsing. 20190309 17:21:32<+wesdiscordbot> but schema validation is an optional feature 20190309 17:21:34< celticminstrel> Could be done with WFL, maybe. 20190309 17:22:19< celticminstrel> My thought was something like an [alternative] tag. 20190309 17:22:30< celticminstrel> You'd use more than one (maybe it would be an error if there's only one). 20190309 17:23:06< celticminstrel> Or maybe it would have a subtag. 20190309 17:23:15< celticminstrel> Not sure. 20190309 17:23:22<+wesdiscordbot> Nothing would block us from creating a Lua kernel while the config is being parsed. 20190309 17:23:26< celticminstrel> Anwyay, the validator would consider all the alternatives. 20190309 17:23:49< celticminstrel> True, Jyrki, though that kinda feels like overkill especially when WFL would work just as well. 20190309 17:23:58< celticminstrel> Anwyay, the validator would consider all the alternatives. 20190309 17:24:16< celticminstrel> Probably in order. 20190309 17:25:13< celticminstrel> If it finds a key or tag specified by one of the alternatives, it would then make sure any required keys in that branch are present, and then it would also check if keys from other branches are present (which would be an error). 20190309 17:26:03< celticminstrel> (Maybe this discussion should move to development tho?) 20190309 17:26:10<+wesdiscordbot> let's move it yes 20190309 17:28:40<+wesdiscordbot> so the alternatives would work somewhat like a switch statement in C, 20190309 17:28:57<+wesdiscordbot> plus the validator would automatically check that exactly one case branch matches 20190309 17:30:28<+wesdiscordbot> would that cover everything we need? 20190309 17:30:53< celticminstrel> ... 20190309 17:31:25< celticminstrel> Well, I don't think it's really like a switch. In fact the schema already has a switch statement. 20190309 17:31:39< celticminstrel> But I suppose there's some similarity. 20190309 17:41:48<+wesdiscordbot> Say, anyone know any sprite template? 20190309 17:51:14< celticminstrel> ? 20190309 17:51:28< celticminstrel> What is a sprite template 20190309 17:51:53<+wesdiscordbot> https://cdn.discordapp.com/attachments/442775044590927873/553998408378220576/unknown.png 20190309 17:51:56<+wesdiscordbot> my sprite template 20190309 17:53:41<+wesdiscordbot> I'll usually take a mainline unit for size/positioning reference and occasionally the team colour ellipse components as well but that's it 20190309 17:53:41<+wesdiscordbot> https://cdn.discordapp.com/attachments/442775044590927873/553998855796949004/unknown.png 20190309 18:40:19<+wesdiscordbot> celmin, having read https://wiki.wesnoth.org/SchemaWML, it's already possible to validate to_x/dir/location with an [if], right? So the proposed addition would just be syntactic sugar 20190309 18:41:02< celticminstrel> I think it's possible, yes. However, the proposed addition might give better error messages. 20190309 18:41:51<+wesdiscordbot> ok 20190309 18:42:29< celticminstrel> In particular, I don't think there's a way for [if][else] to be an error condition. 20190309 18:42:45< celticminstrel> Except by requiring a key that's the error message or something. 20190309 18:47:13<+wesdiscordbot> well, at least it can report an error even if it does so without a good error message 20190309 18:47:35<+wesdiscordbot> that's still better than not reporting the error at all 20190309 18:47:56<+wesdiscordbot> I filed this as https://github.com/wesnoth/wesnoth/issues/3976 @Black Baza 20190309 18:48:05< celticminstrel> True. 20190309 18:48:56<+wesdiscordbot> I suppose we could add a {INVALID error_message} that simply fails unconditionally 20190309 18:49:16<+wesdiscordbot> so as to allow [else] {INVALID "missing to_x or dir or location in [move_unit]"} [/else] 20190309 18:49:44<+wesdiscordbot> @Iris Aye, thanke 20190309 18:50:17< celticminstrel> Well, it would have to be an error message formatted as a valid key name though, I think? 20190309 18:50:32< celticminstrel> Unless the goal is to trigger an "invalid value" message, maybe that would work... 20190309 18:51:08<+wesdiscordbot> {REQUIRE_KEY missing_to_x_or_dir_or_location_in_move_unit} works now 20190309 18:51:18<+wesdiscordbot> I'm just contemplating a new macro that takes a string 20190309 21:37:50-!- sevu [~sevu@p5B28FDCE.dip0.t-ipconnect.de] has joined #wesnoth-umc-dev 20190309 23:29:53-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 255 seconds] --- Log closed Sun Mar 10 00:00:33 2019