--- Log opened Fri Feb 01 00:00:32 2019 20190201 00:01:57-!- mattsc [~mattsc@wesnoth/developer/mattsc] has joined #wesnoth-umc-dev 20190201 00:43:24<+wesdiscordbot> https://www.youtube.com/watch?v=FX890q58m2k 20190201 00:43:38<+wesdiscordbot> i recognize this from a few campaigns 👌 20190201 01:08:04<+wesdiscordbot> 👀 20190201 02:58:08-!- celmin|away is now known as celticminstrel 20190201 05:08:03-!- celticminstrel is now known as celmin|sleep 20190201 08:12:25< vn971> Interesting problem. How to show a certain message so that the user definitely sees it, but so that it doesn't suppress turn notification? 20190201 08:12:59< vn971> For example, I've done it with PUA add-on by delaying the event till the user moves (as I've explained early). But what if it's some other message? 20190201 08:13:45< vn971> should I be willing to delay *ALL events* till user is paying attention by e.g. moving units? 20190201 08:14:24< vn971> * delay all information-like messages. 20190201 08:16:27< vn971> If that is indeed a problem inherent to wesnoth, how to I generalize the solution? 20190201 08:18:09< vn971> I'm thinking of a function like this: `my_addon.execute_when_user_active(func)` 20190201 08:19:19< vn971> But how would I then make scheduled functions survive game reloads? 20190201 08:19:59< vn971> Is this problem possible to solve at all, in any sane way? 20190201 08:23:11<+wesdiscordbot> it sounds like it might make sense to change when the new turn notification is displayed? 20190201 08:23:45<+wesdiscordbot> which would be a wesnoth change 20190201 08:28:25<+wesdiscordbot> May I ask a quick question? This one is a simple syntax I just don't seem to be getting haha. 20190201 08:29:03<+wesdiscordbot> go for it 20190201 08:29:28<+wesdiscordbot> So I'm trying to make it so it picks a random variable from an array. 20190201 08:29:38<+wesdiscordbot> rand=0..wcvariantarray.length 20190201 08:29:57<+wesdiscordbot> That's the code I tried to use, but it seems to not be working... am I just being dumb here? 20190201 08:30:01<+wesdiscordbot> you're missing a dollar sign 20190201 08:30:09<+wesdiscordbot> $wcvariantarray.length 20190201 08:30:17<+wesdiscordbot> rand="0..$(wcvariantarray.length - 1)" 20190201 08:30:35<+wesdiscordbot> OH DUH OKAY THAT'S EMBARRASSING OF COURSE -1 20190201 08:30:38<+wesdiscordbot> The sub by 1 is important because otherwise there's a chance you'll access a nonexistent subscript at the end 20190201 08:30:52<+wesdiscordbot> I'll try this again, thanks! 20190201 08:30:55<+wesdiscordbot> Also what Pent said 20190201 08:31:00<+wesdiscordbot> I forgot the dollar sign too 20190201 08:31:10<+wesdiscordbot> It should be rand="0..$($wcvariantarray.length - 1)" 20190201 08:31:24<+wesdiscordbot> Do you need to at the quotation marks, or are those optional? 20190201 08:31:36<+wesdiscordbot> Cause normally those don't seem to be required. 20190201 08:31:39<+wesdiscordbot> I use them for consistency because you absolutely need them if there's a plus sign in the formula 20190201 08:31:58<+wesdiscordbot> Otherwise the plus sign is interpreted entirely differently by the game 20190201 08:32:30<+wesdiscordbot> ie: 0..$($wcvariantarray.length + 1) would get turned into 0..$($wcvariantarray.length1), which then obviously wouldn't work. 20190201 08:32:47<+wesdiscordbot> Ah, okay then! 20190201 08:33:07<+wesdiscordbot> I've coded with C# and Javascript before, but don't quite get WML yet, as you can plainly see haha 20190201 08:33:28<+wesdiscordbot> It is a bit of a weird language compared to most mainstream ones 20190201 08:34:55<+wesdiscordbot> Okay I swear it's still only grabbing the first variable of the array 20190201 08:35:06<+wesdiscordbot> What I'm trying to do is pick a random zombie type 20190201 08:35:21<+wesdiscordbot> [unit] type=Walking Corpse side=1 variation=$wcvariantarray[randwcvariant].wctype x=$randlocx y=1 moves=2 attacks_left=0 animate=yes [/unit] 20190201 08:35:34<+wesdiscordbot> variation=$wcvariantarray[randwcvariant].wctype 20190201 08:35:39<+wesdiscordbot> Is the important part 20190201 08:35:52<+wesdiscordbot> wctype is the part of the container that says the variant 20190201 08:35:56<+wesdiscordbot> walking corpse type 20190201 08:36:07<+wesdiscordbot> You need to use a dollar sign to obtain the value of the randwcvariant variable too 20190201 08:36:21<+wesdiscordbot> Ah, okay then. Yeah still thinking about it like Javascript haha 20190201 08:36:43<+wesdiscordbot> So basically, every time you reference a variable, you stick in a dollar sign? 20190201 08:37:17<+wesdiscordbot> When what you're trying to do is expand its value into an expression, yes 20190201 08:38:01<+wesdiscordbot> All right! Thanks! 20190201 08:38:06<+wesdiscordbot> It seems to be working now :D 20190201 08:38:46<+wesdiscordbot> So for example: [set_variable] name=foo value=$bar [/set_variable] Sets the variable foo to the value of bar. But [set_variable] name=foo value=$bar [/set_variable] Sets the variable whose name is the value of foo to the value of bar. 20190201 08:38:57<+wesdiscordbot> THere, fo 20190201 08:39:08<+wesdiscordbot> Forgot the first dollar sign in the second example oops 20190201 08:39:32<+wesdiscordbot> Ah, okay then! 20190201 08:40:00<+wesdiscordbot> That'll be good to remember :D 20190201 08:43:19<+wesdiscordbot> Yeah, we have basically completely random undead showing up. It's set up so it's far more likely for defaults and swimmers to show up (cause the map's kinda water heavy) 20190201 08:43:38<+wesdiscordbot> Anyway, thank you! Gonna head off now though. 20190201 08:43:40<+wesdiscordbot> Ba-bye! 20190201 10:39:24< vn971> Pentarctagon: I can't split out what I want from wesnoth turn notification changed then though.. I.e. the problem I'm hitting into is that wesnoth executes events (and all the stuff) consequently. So even though my notification doesn't change any internal state, wesnoth still needs to wait for the user to dismiss it, and only then continue with the rest of the code. 20190201 10:41:30< vn971> Pentarctagon: one out-of-the-box alternative I thought about is allowing to show certain messages only when the user has wesnoth active. But I cannot think of any way to implement it for wesnoth sanely. It's a very tricky edge case apparently. 20190201 10:43:36< vn971> or letting schedule events to when user becomes active. E.g. a special event type "user activated". But that might be seen as not really privacy-respecting, so probably wesnoth should not go this way. Also, it feels like a great way to get more complexity out of nothing, if not even OOS. 20190201 10:44:04< Soliton> your message/pop-up does not cause a notification i guess? 20190201 10:45:05< vn971> Soliton: yes. And, due to the nature of how wesnoth works, turn notification is suppressed as well if my event is in "turn refresh". 20190201 10:45:37< Soliton> how about making it so scenario messages cause a notification then? 20190201 10:46:24< vn971> Soliton: so how it was with PUA: You must make a certain choice at turn start. But when added as a "turn refresh" event, the pop-up will activate and no turn notification will be shown for the user. So even though the intent was to show something to the user when they start their turn, they won't know that the turn started by usual means. 20190201 10:46:40< vn971> Soliton: what is a scenario message? 20190201 10:46:54< Soliton> whatever thing you're talking about. 20190201 10:47:15< vn971> BTW, I think I have a neat idea: what if we introduce a special event type "turn started"? This would trigger when notification is already fired. 20190201 10:47:35< vn971> Soliton: but I can't force a turn notification from Lua, I think.. 20190201 10:48:20< Soliton> ok, no idea why this drifted off into confusion. the message you show that blocks the notification, how about making that cause a notification itself. 20190201 10:48:51< vn971> Soliton: how can I "cause a notification" using wesnoth API? 20190201 10:49:20< vn971> Soliton: especially if user has all sounds disabled except "turn started" one. I do that f.e. 20190201 10:49:24< Soliton> i am proposing a change... something that is not the way it is now. 20190201 10:49:59< Soliton> clearly the user has notifications turned on or your problem would not exist in the first place? 20190201 10:50:08< vn971> Soliton: so users would allowed to force a "turn started" notif? But then it'll get fired twice? 20190201 10:50:22< Soliton> no... 20190201 10:51:05< vn971> Soliton: what kind of notification do you have in mind? I completely don't get it this time. A sound, for when the user switched to another app while waiting for his turn? 20190201 10:51:33< Soliton> a notification with the message you're showing. 20190201 10:54:31< vn971> Soliton: ah, bisically a "notification API" that would independently allow to show certain desktop notifications to the user. 20190201 10:55:20< Soliton> not really a new api just makeing it so message pop-ups cause a notification. 20190201 10:55:25< vn971> I'll try my idea with simple notification/event reordering first though. (I'll fill a feature request soon.) As it seems, the most typical use case where you'd want user attention is when their turn is about to start anyway. 20190201 10:55:49< Soliton> if that makes sense to be configurable that could be done of course. 20190201 10:55:55< vn971> oh, hmm.. That might be a solution as well. :thinking: 20190201 10:57:13< Soliton> it sounds like a useful thing to get a notification about either way. 20190201 10:59:01< Soliton> ideally with the message from the dialog or at least the first part of it or so. 20190201 11:03:07< vn971> interesting. 20190201 11:03:29< vn971> I've already written my proposal as well though, so I'll fill it in anyway (I think it's sane). 20190201 11:03:50< vn971> but a notification for messages is interesting as well. If you'll raise an issue about it, please write so I can subscribe. 20190201 11:06:00< vn971> Ouch. My memory is failing me. The issue was already created in Sep 2018, and I was the one to raise it.. 🙈 20190201 11:06:05< vn971> https://github.com/wesnoth/wesnoth/issues/3565 20190201 11:06:21< Soliton> at least IMO that is the core issue you described. notifications can be blocked by a dialog that requires user interaction. so anything blocking progress because it waits for user actions should cause a notification. 20190201 11:07:01< vn971> Soliton: well I don't see why turn notification would be fired AFTER WML events TBH. 20190201 11:07:09< vn971> if it'd be the other way around, I'd be happy as well. 20190201 11:07:46< vn971> Soliton: but on the other hand you're right as well. 20190201 11:09:49< Soliton> if changing the order fixes this that could be a simpler fix, sure. but the issue of not being notified when user action is required still stands then. 20190201 11:10:34< Soliton> looks like gfgtdf said as much in that issue as well. 20190201 11:12:43< vn971> I guess I should stop raising issues on that then and instead dig into code.. Hopefully not introducing memory leaks and crashes :/ 20190201 11:27:16< Soliton> other people will look over it so it shouldn't be that easy to introduce bad code. :-) 20190201 12:27:04< vn971> ... give up. Lost somewhere between src/playmp_controller.cpp:117 and src/play_controller.cpp:1176 Can't understand where events come from. 20190201 12:50:23-!- gfgtdf [~androirc@134.76.63.8] has joined #wesnoth-umc-dev 20190201 12:51:09< gfgtdf> giving a notification on all blocking messages it actually a good idea, also should not be that hard to implement. 20190201 12:51:57 * vn971 gets his hope a bit up 20190201 12:54:43< gfgtdf> What are yiu currently trying to implemebt adding nitifications to [message] or moving the iorder of notifications at turn start? 20190201 12:58:18< gfgtdf> Are new turn notifications currently mp only? 20190201 12:58:49< gfgtdf> If yes, any reason against adding them in sp? 20190201 13:23:30< Soliton> sounds like a good idea to me. if the ai takes a while you might switch away in sp as well and would want to know when to go back. 20190201 13:33:35-!- mattsc [~mattsc@wesnoth/developer/mattsc] has quit [Quit: So long and thanks for all the fish.] 20190201 13:38:30-!- celmin|sleep is now known as celmin|away 20190201 13:41:46-!- gfgtdf [~androirc@134.76.63.8] has quit [Remote host closed the connection] 20190201 16:15:05<+wesdiscordbot> @Derpy Dev Did you perhaps author 'Home of the Undead'? 20190201 17:37:16-!- gfgtdf [~androirc@134.76.63.8] has joined #wesnoth-umc-dev 20190201 17:41:36<+wesdiscordbot> @Konrad2 Nah, I haven't released any maps or anything yet. I've really just gotten into map making. 20190201 17:43:41<+wesdiscordbot> I'm working on a survival map right now where the players have to fight off undead and stuff. 20190201 17:44:07<+wesdiscordbot> Lots of undead coming from an ancient sunken city. "From The Depths" it's called. 20190201 17:51:20-!- gfgtdf [~androirc@134.76.63.8] has quit [Ping timeout: 272 seconds] 20190201 18:06:22< Ravana> when you have programming experience already, then it makes sense to switch to Lua soon instead of focusing on WML 20190201 18:35:56<+wesdiscordbot> @Derpy Dev In that case looking at said campaign might be helpful to you. The leader in that campaign recruits various walking corpses as well, so they probably solved that problem already. 20190201 19:58:10<+wesdiscordbot> Oh okay, thanks! I'll give it a Google :D 20190201 21:17:37<+wesdiscordbot> @here Um, okay, so quick question, can placing units in the map editor screw up the .cfg file? 20190201 21:23:37<+wesdiscordbot> Yes, it can. The scenario editor isn't designed to preserve custom stuff. 20190201 21:24:43<+wesdiscordbot> Okay, second question, am I allowed to swear here? Because I feel like swearing now. 20190201 21:25:28<+wesdiscordbot> OKAY SO THE GOOD NEWS 20190201 21:25:58<+wesdiscordbot> I happen to be obsessive enough to crack open some of the autosaves I made for testing so that I can basically pull the map data from one of those. 20190201 21:26:17<+wesdiscordbot> It'll take a bit to work that out but I can restore all my code 20190201 21:27:46<+wesdiscordbot> We allow moderate swearing, just don't overdo it and keep rules #1 and #4 in mind 20190201 21:28:25<+wesdiscordbot> kay thanks for the info shadow 20190201 21:28:31<+wesdiscordbot> And thanks Jyrkive for the answer 20190201 21:28:50<+wesdiscordbot> Me having to pull data from save files to fix corrupted map data 20190201 21:28:50<+wesdiscordbot> https://cdn.discordapp.com/attachments/442775044590927873/541007033340657676/Modern2BProblems2BRequire2BModern2BSolutions2B19122018081734.png 20190201 21:30:16<+wesdiscordbot> you see i'm making memes to hide my endless frustration hate and anger about this 20190201 21:30:30<+wesdiscordbot> ALWAYS REMEMBER TO BACK UP FOLKS THAT COULDA BEEN WORSE 20190201 21:45:21<+wesdiscordbot> Yeah okay that's fixed for the most part :D 20190201 21:45:38<+wesdiscordbot> Didn't actually have to copy a gratuitous amount of code. 20190201 21:45:44<+wesdiscordbot> Just a few long events really 20190201 21:46:09<+wesdiscordbot> Ones I didn't have to recreate, but were relatively easy to copy 20190201 21:46:15<+wesdiscordbot> Back to the project then :D 20190201 22:00:12<+wesdiscordbot> oh 20190201 22:26:11<+wesdiscordbot> Default was too short and 24 hours was too long, so I made a custom middle ground for this map. 20190201 22:26:11<+wesdiscordbot> https://cdn.discordapp.com/attachments/442775044590927873/541021466632650872/unknown.png 20190201 23:27:41-!- gfgtdf [~androirc@84.46.53.138] has joined #wesnoth-umc-dev 20190201 23:41:02-!- gfgtdf [~androirc@84.46.53.138] has quit [Read error: Connection reset by peer] --- Log closed Sat Feb 02 00:00:34 2019