--- Log opened Fri Jun 29 00:00:51 2018 20180629 00:59:32-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180629 00:59:39-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180629 02:57:25-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180629 02:57:32-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180629 03:32:31-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180629 03:32:37-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180629 10:20:57-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180629 10:21:04-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180629 11:43:03-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180629 11:43:13-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180629 16:09:49-!- Netsplit *.net <-> *.split quits: discordbot3 20180629 16:14:11-!- 21WAANAI7 [~discordbo@baldras.wesnoth.org] has joined #wesnoth-umc-dev 20180629 16:42:49-!- hk238 [~kvirc@unaffiliated/hk238] has joined #wesnoth-umc-dev 20180629 16:44:25-!- JyrkiVesterinen [~JyrkiVest@85-23-197-3.bb.dnainternet.fi] has joined #wesnoth-umc-dev 20180629 16:44:34-!- JyrkiVesterinen [~JyrkiVest@85-23-197-3.bb.dnainternet.fi] has left #wesnoth-umc-dev ["Closing Window"] 20180629 16:45:18< 21WAANAI7> hk238: It's indeed a perfectly reasonable choice to leave the iteration order unspecified. 20180629 16:45:19< 21WAANAI7> https://nathanleclaire.com/blog/2014/04/27/a-surprising-feature-of-golang-that-colored-me-impressed/ 20180629 16:48:12< hk238> also you can use a function to sort the keys into an array or number indexed table rather, as numbers typically are ordinal 20180629 16:48:41< hk238> but if you use a non-transitive function then it can also occur that the order is still random 20180629 16:49:00< 21WAANAI7> If you're using numeric indices, you can use ipairs(), which is guaranteed to use the numeric order. 20180629 16:49:36< hk238> right :o 20180629 16:50:10< hk238> for an example in javascript (blasphemy) the operators don't have transitive comparison 20180629 16:50:22< hk238> as in you don't have transitivity for "a < b" or similar things 20180629 16:50:49< hk238> which results to that if you sort an array using an operator like that, the order is random or dependent on the initial order 20180629 16:54:16< hk238> which I guess a lot of people haven't realized but it's easy to demonstrate 20180629 17:00:21< hk238> oh well should try and get this weather thing done 20180629 17:00:22< hk238> :D 20180629 17:37:16< hk238> yay.. I managed to concentrate enough to make another version of this 20180629 17:37:21< hk238> but I'm 100% sure it's not going to work 20180629 17:37:25< hk238> so let's test :D 20180629 17:37:39< hk238> also I still ended up with a loop structure, albeit much simpler 20180629 17:38:51< hk238> https://pastebin.com/gPbb7ZNE 20180629 17:38:52< hk238> :D 20180629 17:42:35< 21WAANAI7> 👍 20180629 18:00:06< hk238> I still don't have this table syntax right it keeps returning errors with all the variants I've tried with strings as keys 20180629 18:00:59< 21WAANAI7> Can you pastebin the error messages you get? 20180629 18:06:22< hk238> yes sorry I'm fixing them with thelp of console it's mind-boggling how many syntax errors there are :D 20180629 18:06:55< hk238> by the way I got the table syntax right i think since the error went away 20180629 18:07:44< hk238> https://pastebin.com/TR8tsQm5 20180629 18:07:48< hk238> here's current of the code 20180629 18:08:07< hk238> and current error is a missing brace on line 491 20180629 18:08:34< hk238> or missing counter part for a brace on that line 20180629 18:08:46< 21WAANAI7> You sent the same link twice. 20180629 18:08:59< 21WAANAI7> Now three times. 20180629 18:09:40< hk238> sorry sorry 20180629 18:09:51< hk238> I just updated it that's why 20180629 18:10:25< 21WAANAI7> Uh... Lua doesn't use braces(except in table constructors). 20180629 18:12:14< hk238> function parameters? 20180629 18:12:31< 21WAANAI7> Function parameter list uses regular parentheses. 20180629 18:12:37< hk238> '(' is called brace ? 20180629 18:12:55< hk238> at least i've ran into that but maybe it's not common 20180629 18:13:14< 21WAANAI7> pretty sure that's a parenthesis 20180629 18:13:40< hk238> { curly bracket/brace [ bracket ( brace that's the terminology I've run into 20180629 18:13:49< hk238> but okay maybe I got that wrong :D 20180629 18:14:59< 21WAANAI7> {bracket} [brace] (parentheses) for me, at least 20180629 18:15:33< 21WAANAI7> For me it's (parentheses) [bracket] {brace}. 20180629 18:15:40< hk238> :D 20180629 18:16:06< hk238> but I've also run into () being called parentheses 20180629 18:16:20< hk238> we could try google and see whose right 20180629 18:16:25< hk238> although it's probably not me :D 20180629 18:16:45< hk238> ahh so now it went from syntax error to lua error 20180629 18:16:57< hk238> I think it might mean that I actually got a logic mistake in the program rather than syntax error 20180629 18:18:14< hk238> I probably didn't even say that right... I went from having an error in console, to error on the screen, and no error in console 20180629 18:18:24< hk238> it seems that function was expecting a table but got nil instead 20180629 18:18:43< hk238> but since there's only 1 call for that function it must mean that call is not sending table out :D 20180629 18:19:42< hk238> and although that's great I still have no idea what's actually wrong 8) 20180629 18:20:01< hk238> I honestly thought I'd get to play this add-on today 20180629 18:20:16< 21WAANAI7> The error message should give you the exact line number where it occurs. 20180629 18:20:36< hk238> yes 20180629 18:20:40< hk238> but well 20180629 18:21:12< hk238> 466, that' sline 73 on the pastebin 20180629 18:21:29< hk238> but the error message is that it's expecting a table 20180629 18:21:49< hk238> there's a call to that function on line 78 20180629 18:22:15< hk238> and it's calling it with the argument that' sthe input parameter of the function on line 77 20180629 18:22:39< hk238> 77 is being called on line 93 20180629 18:22:41< 21WAANAI7> Yes, I see. It must have been returned by get_next_weather_table(). 20180629 18:22:54< hk238> right 20180629 18:23:07< hk238> so I think there's still a problem in my table syntax or there's something wrong with that :o 20180629 18:23:51< 21WAANAI7> Specifically, get_next_weather_table() doesn't return anything if previous_weather is none of "clear", "drought", "rain", "heavy rain", "snowfall", "heavy snowfall" or "heavier snowfall". 20180629 18:24:25< hk238> right I was actually thinking about including a check for that for debugging purposes but I didnt kno whow to do that 20180629 18:25:01< hk238> hmm so... uhm 20180629 18:25:31< hk238> darn 20180629 18:25:47< hk238> there's also a for loop waiting at the bottom of this in the weather prestart thing 20180629 18:25:47< hk238> :D 20180629 18:27:51< 21WAANAI7> Your code fails if weathertable_to_random_weather() fails to return a suitable weather at any point (even if multiple calls to it succeed). 20180629 18:28:48< 21WAANAI7> I'd be most suspicious of that function. If sum never exceeds dice_roll, it will return an empty string. 20180629 18:29:27< hk238> right it can be equal? 20180629 18:30:28< 21WAANAI7> Yes. The single-parameter version of wesnoth.random() can return a number as large as the given parameter. 20180629 18:32:05< hk238> I jtus tried =< but there's a new error now so that's probably the wrong order, <= instead? 20180629 18:32:18< 21WAANAI7> Yes, <= is correct. 20180629 18:33:17< hk238> okay I changed that and now there's a new instance of a nil value, but it's not the same, so Iguess that fixed something :D 20180629 18:33:34< hk238> also I added a fail safe return table to the.. table returning function 20180629 18:34:24< hk238> now it's line 502 that's 108 in the pastebin 20180629 18:34:38< hk238> it's probably that weather_arrays is not a table 20180629 18:34:59< hk238> 'attempt to index a nil value' iterator something like that 20180629 18:35:05< 21WAANAI7> For the record, in situations which aren't supposed to happen, experienced programmers usually explicitly raise an error instead. 20180629 18:35:06< 21WAANAI7> http://www.lua.org/pil/8.3.html 20180629 18:35:21< 21WAANAI7> That way you get to know that the condition is actually possible. 20180629 18:36:03< 21WAANAI7> Ah, right. Your sequence_generator() function doesn't return the table. 20180629 18:36:25< hk238> yeah that's what i was thinking but i dont know how to do that but I guess it's the error("function") in question :o 20180629 18:36:50< hk238> darn 20180629 18:36:51< hk238> :D 20180629 18:37:12< 21WAANAI7> Yes, error("No weather was chosen") would be a way to raise an error. 20180629 18:37:17< hk238> there has been some kind of error almost everywhere :D 20180629 18:37:23< hk238> yeah I'll try that 20180629 18:37:55< 21WAANAI7> It's perfectly normal. Even I often make typos and simple errors at work. 20180629 18:38:27< 21WAANAI7> The difference is just that I'm used to them, know how to detect them immediately, and also have better tools which warn me about them earlier. 20180629 18:38:37< hk238> unbelievable after adding the return statement.. there are no more errors :D 20180629 18:39:01< hk238> yes I'm just a beginner with programming I have like 1œ years experience total 20180629 18:39:52< hk238> basically well this is unnecessary but I quit programming when I got this mental health problem that I thought someone was trying to intimidate me online 20180629 18:40:10< hk238> but this code might actually work now let's see if it does what it's supposed to 20180629 18:40:20< hk238> so you're a professional programmer? coding for living? :o 20180629 18:40:43< 21WAANAI7> Yes, that's right. I'm a mobile game programmer. 20180629 18:40:52< hk238> I think this might work, at least I got clear weather not sure if it changes yet 20180629 18:41:15< hk238> I think that's pretty cool. In fact I'd kind of wish I was cut for that, but I'm not sure if I would be 20180629 18:41:38< hk238> but it's nice that you manage at least :D 20180629 18:41:44< hk238> the weather works 20180629 18:41:46< hk238> it's great 20180629 18:41:47< hk238> :D 20180629 18:41:55< hk238> suddenly after so many errors.. it works :D 20180629 18:41:57< 21WAANAI7> Great. 👍 20180629 18:42:44< hk238> thanks for help it would've taken a lot longer for me to figure those things out on my own :D 20180629 18:48:06< hk238> by the way jyrkive are you from Finland also? : ) 20180629 18:48:16< 21WAANAI7> Yes. 20180629 18:48:18< hk238> Jyrki is a Finnish name so 20180629 18:48:25< hk238> no onneksi keskustelimme englanniksi :D 20180629 18:48:40< 21WAANAI7> HyödyllistĂ€ sekin 😛 20180629 18:49:35< hk238> Jyrki, ajattelin ettĂ€ jos kirjoittaisin tĂ€hĂ€n jotain mainitsisin Ravanan nimimerkin siitĂ€ seuraisi kiusallinen epĂ€ilys 20180629 18:49:47< hk238> 8) 20180629 18:50:03< 21WAANAI7> KonekÀÀnnökset on keksitty... 20180629 18:50:21< hk238> on toki mutta silloinhan se toivon mukaan ymmĂ€rtĂ€isi huumoriksi :D 20180629 18:50:44< hk238> Ravana kiusasi meitĂ€ yhdessĂ€ pelissĂ€ leikkimĂ€llĂ€ adminin oikeuksilla niin tĂ€mĂ€n on ihan sopiva vastaisku :D 20180629 18:51:12< hk238> sorry just joking.. : ) 20180629 19:00:28< hk238> hmm my connection weirdly hangs on the server quite a lot 20180629 19:00:37< hk238> I wonder if people are trying to join while I get disconnected silently 20180629 19:16:21-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180629 19:16:27-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180629 19:54:40-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180629 19:54:46-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180629 20:01:05-!- hk238 [~kvirc@unaffiliated/hk238] has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/] 20180629 20:48:11< 21WAANAI7> I'm trying to create a weapon special that makes the unit hit harder the more hurt it is, but I can't seem to get the multiply key to accept something like "(2 - (self.hitpoints / self.max_hitpoints))". It seems to default to simply muliply=2 whenever the unit's hitpoints is below max 20180629 20:49:51< Ravana_> compare to https://github.com/ProditorMagnus/Ageless-for-1-14/blob/master/units/EotF_units/Nordhris/Oathsworn.cfg#L35 20180629 20:50:14< 21WAANAI7> Thanks, Ravana! 😃 20180629 20:51:28< 21WAANAI7> Will try something like that out 20180629 21:06:23< 21WAANAI7> This is pretty peculiar, to me. I tried using that exact line that you link, multiply="(1 + ((((1.099999 * max_hitpoints) + 0.0) - hitpoints) / max_hitpoints))", and it works, but I can't understand why multiply="(2 - (hitpoints / max_hitpoints))" won't work đŸ€” 20180629 21:07:56< 21WAANAI7> maybe try 2.0? 20180629 21:08:09< 21WAANAI7> multiply="(2.0 - (.... 20180629 21:08:51< 21WAANAI7> I'll try that 20180629 21:08:56< Ravana_> in wfl / is integer division 20180629 21:09:15< Ravana_> use 0.0 20180629 21:09:16< 21WAANAI7> yah that would do it 20180629 21:14:03< 21WAANAI7> Ah. Yeah. 20180629 21:14:16< 21WAANAI7> Adding 0.0 to multiply="(2 - ((hitpoints + 0.0) / max_hitpoints))" did it 20180629 21:14:20< 21WAANAI7> Thanks 😃 20180629 22:02:45-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180629 22:02:51-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev --- Log closed Sat Jun 30 00:00:52 2018