--- Log opened Wed Jul 04 00:00:58 2018 20180704 01:54:00-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 01:54:06-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 02:34:14< discordbot1> In a campaign, do you have to keep redefining your leader's unit type if it's consistently the same leader, or do I just need the same ID? I don't want any EXP to be lost from scenario to scenario 20180704 06:02:36-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 06:02:43-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 07:34:37-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 07:34:43-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 13:56:44-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 13:56:50-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 14:06:54-!- hk238 [~kvirc@unaffiliated/hk238] has joined #wesnoth-umc-dev 20180704 14:06:57< hk238> hi 20180704 14:07:03< hk238> can you store lua tables in WML variables? 20180704 14:07:37< hk238> I'm thinking about refactoring this code a bit, there's an event which uses some information as a WML variable namely a number indicates a pool of units from which the spawns are drawn 20180704 14:07:46< hk238> so I was thinking I'd replace the number with the actual pool 20180704 14:08:01< hk238> but I was thinking maybe the reason it's using a number is because it can't be stored into WML or something like that 20180704 14:08:04< discordbot1> Hi 20180704 14:08:12< hk238> hi Choicerer 20180704 14:08:15< discordbot1> Yes, you can convert lua tables to Wml Variables 20180704 14:08:23< discordbot1> and i even wrote a converter 20180704 14:08:28< discordbot1> some time ago 20180704 14:08:31< discordbot1> let me link you to it 20180704 14:08:49< hk238> oh so you can't do it directly? 20180704 14:09:07< discordbot1> what do you mean directly? 20180704 14:09:10< discordbot1> directly? what do 20180704 14:09:14< discordbot1> https://github.com/Choicerer/Wesnoth_Table_Converter/blob/master/table_converter.lua 20180704 14:09:37< hk238> like one moment 20180704 14:09:40< discordbot1> oh yeah 20180704 14:09:46< discordbot1> you can't do it directly 20180704 14:09:53< discordbot1> they are different languages 20180704 14:10:18< discordbot1> there is, the helper.get_variable_array lua function 20180704 14:10:30< discordbot1> but it's tricky to use, hence I wrote this converter 20180704 14:10:32< hk238> okay so that explains why it's using a number 20180704 14:10:40< hk238> https://pastebin.com/JvkmMLTM 20180704 14:10:58< hk238> here's the curreent version of the code. It's still 60% original dark forecast or more and the rest is new "murky weathercast" :D 20180704 14:11:19< discordbot1> you're Eurydike? 20180704 14:11:35< discordbot1> can you give me the line 20180704 14:11:44< discordbot1> that you wanted ot change 20180704 14:12:15< hk238> yes 20180704 14:12:17< hk238> 350 20180704 14:12:20< hk238> and it goes with 20180704 14:13:26< hk238> 266 and 259 20180704 14:13:49< hk238> basically it goes through this trouble generating a table for "spawn numbers" which are essentially indexes to a table which contains actual tables of the spawns 20180704 14:13:58< hk238> I'm sorry pool numbers 20180704 14:14:04< hk238> not spawn numbers 20180704 14:14:42< hk238> so it causes that it's hard to make modifications to it since the process of indicating what unit goes where is subdivided into different places 20180704 14:15:13< hk238> so I'd like to refactor the code so that instead of taking as one of the parameters the "pool number" it would just take the actual pool lua table as an argument 20180704 14:15:39< hk238> but the problem is that it's stored into a WML variable so I was kind of guessing that the reason the author went throug hall that trouble must be that you can't store it directly into WML 20180704 14:18:08< discordbot1> but where 20180704 14:18:28< hk238> what? 20180704 14:18:50< discordbot1> where is the code that takes the index number as a parameter? 20180704 14:18:56< hk238> on line 350 it says "next_spawn.pool_num" 20180704 14:19:15< hk238> the pool_num is stored into a WML variable in the chunk of code, on lines 266 and 259 20180704 14:19:46< hk238> so for an example you could instead store it as "nest_spawn.the_actual_pool_instead_of_some_number" 20180704 14:20:18< hk238> which would make more sense because the process would be more clear cut into what is the function and what is the parameter 20180704 14:20:27< discordbot1> oookay 20180704 14:20:37< discordbot1> i was confused by this syntax, turns out it's part of the LuaAPi module 20180704 14:20:38< discordbot1> https://wiki.wesnoth.org/LuaAPI/wml#wml.variables 20180704 14:20:42< discordbot1> I've never used it 20180704 14:20:42< hk238> and you could for an example change which pool is used simply by using a different parameter 20180704 14:21:12< hk238> where as if you try to change it now 20180704 14:21:18< hk238> you can't do it where it's called 20180704 14:21:32< hk238> and you can't do it where it actually happens without having to create some additional complicated if clause 20180704 14:21:57< hk238> since part of the relevant information comes where it's sort of called.. althoug hthat's not exactly the case since it's not a direct function call anyway it's kind of the sitaution 20180704 14:24:29< discordbot1> bare with me, i'm a bit tired, so i'm gonna take time making sense of this 20180704 14:25:17< hk238> I could add some comment sbut it would be commenting parts I didn't make and also which I'm about to change :D 20180704 14:26:03< hk238> basically on line 341 to 356 there's a function that creates the spawns but it uses information from elsewhere 20180704 14:26:07< hk238> which is basically WML variables 20180704 14:26:20< hk238> and the "random_spawns" table of unit pool tables at the beginning of the page 20180704 14:26:55< hk238> so the units that are spawned are selected from that table.. and which table is indicated by the "pool_num" part what this is all about which is accessing the "random_spawns" table 20180704 14:27:00< hk238> by index 20180704 14:27:17< hk238> but the process that resolve the unit types happens inside a function "get_unit_types" 20180704 14:27:40< hk238> and "place_units" actually places them 20180704 14:27:57< hk238> meanwhile the spawns are created in an atrocious forloopbundle 20180704 14:27:58< hk238> :D 20180704 14:28:02< hk238> which resides at 20180704 14:28:15< hk238> lines 222 to 271 20180704 14:28:19< discordbot1> i see lua table values passed around 20180704 14:28:35< discordbot1> i see very few references to wml variables 20180704 14:28:43< discordbot1> this 20180704 14:28:44< discordbot1> local unit_types = get_spawn_types(next_spawn.units, next_spawn.gold, random_spawns[next_spawn.pool_num]) 20180704 14:29:07< discordbot1> you're asking if you couldn't substitute that with a lua table 20180704 14:29:14< discordbot1> the last parameter 20180704 14:29:21< discordbot1> well, apart form how it all works 20180704 14:29:31< discordbot1> yes, why not. there's no wml here 20180704 14:29:41< hk238> okay so look at 20180704 14:29:50< hk238> line 255 to 259 20180704 14:29:52< hk238> for an example 20180704 14:29:58< hk238> pool num is assigned in that case on line 259 20180704 14:30:06< hk238> and 255 is actually storing it as a WML variable 20180704 14:30:14< discordbot1> yeah, that is a wml array 20180704 14:30:20< hk238> so it could be storing the actual pool, instead of the pool number 20180704 14:30:29< discordbot1> yep 20180704 14:30:40< hk238> so this breaks the process of deciding which units spawn so that it partially occurs in the part looked 350 20180704 14:30:40< discordbot1> it would storing a lot more wml data, but yes 20180704 14:30:43< hk238> and here also 20180704 14:31:01< hk238> yeah now you can't change what spawns by altering this part 20180704 14:31:10< hk238> otherwise you could juts write different spawns into the variable 20180704 14:31:18< discordbot1> yes, you could 20180704 14:31:26< discordbot1> what is the difference, exactly 20180704 14:31:35< discordbot1> you see, guy's already writing some data to wml arrays 20180704 14:31:49< hk238> so you can write it as a lua table? 20180704 14:31:52< discordbot1> could you write the pool data rather than a reference to the pool data? it's the same sort of data 20180704 14:31:54< discordbot1> sure 20180704 14:32:00< hk238> oh 20180704 14:32:01< discordbot1> you convert the lua table to wml 20180704 14:32:11< discordbot1> then you retrieve it again 20180704 14:32:17< discordbot1> but it's basically the same thing 20180704 14:32:21< hk238> well that's what this is all about it would make more sense to store the actual data or a pointer or somethnig, instead of a number 20180704 14:32:41< hk238> yeah but the problem is you if you want to change it, you kind of need to change both parts 20180704 14:32:46< discordbot1> okay, so the random spawns table 20180704 14:32:49< hk238> which is kind of why it's a problem 20180704 14:32:59< discordbot1> i'm really slow atm, cause i'm pretty tired but 20180704 14:33:11< discordbot1> it just randomly draws elements 20180704 14:33:11< hk238> but instead if you refactor it so that the prestart function takes the directly pool 20180704 14:33:25< discordbot1> and stores those elements in lua pools rihgt? 20180704 14:33:30< hk238> then you don't have to touch that part whenever you want to change what happens. instaed you can give it a different argument via the Wml variable path 20180704 14:33:36< discordbot1> err yeah 20180704 14:33:43< discordbot1> i'm kinda wondering though 20180704 14:33:51< hk238> don't worry it took me much longer to figure out what exactly it does 20180704 14:33:52< hk238> :D 20180704 14:33:57< discordbot1> is this savegame safe? 20180704 14:34:04< discordbot1> because lua data doesn't get saved 20180704 14:34:09< hk238> I don't know I have only a couple of hours experience with lua though 20180704 14:34:10< discordbot1> you're saying lua pools 20180704 14:34:17< discordbot1> okay, but 20180704 14:34:24< hk238> so the pool is if you look at the "random_spawns" table 20180704 14:34:34< discordbot1> yep 20180704 14:34:42< hk238> it contains tables, which contain units and information about units. So one of those tables is a pool in this lingo coined by the author 20180704 14:34:56< discordbot1> yeah 20180704 14:35:03< discordbot1> what is really werid though 20180704 14:35:26< hk238> so what I wanted to change is to make it pass that pool around instead, cleaner cut structure 20180704 14:35:37< discordbot1> is that it inserts those random_spawns_numbers into another lua table 20180704 14:35:47< hk238> oh yeah the process is unnecessarily convoluted 20180704 14:35:51< discordbot1> sorry, the other way around 20180704 14:35:57< hk238> but it basically takes the number of tables in random_spawns, that is the pools 20180704 14:36:06< hk238> and then it shuffles them 20180704 14:36:22< hk238> so basically it's just for shuffling 20180704 14:36:29< discordbot1> that's the length of the random_spawns table 20180704 14:36:33< hk238> yeah 20180704 14:36:36< discordbot1> and by the way 20180704 14:36:42< discordbot1> there's an easier way to loop in lua 20180704 14:36:50< hk238> and then it just gives them in order to the "spawn" data defining for loop 20180704 14:37:01< discordbot1> for i,v in ipairs(random_spawns) do 20180704 14:37:04< hk238> I don't even like loops to begin with they're bad structures :D 20180704 14:37:16< hk238> or so I've heard 20180704 14:37:17< discordbot1> it's a lua array 20180704 14:37:27< discordbot1> meaning it has indices for keys 20180704 14:37:37< discordbot1> so you can loop over it with ipairs 20180704 14:37:48< hk238> hmm I guess I should start calling those arrays instead :o 20180704 14:37:50< discordbot1> now, the thing that is very startling, though 20180704 14:37:54< hk238> I was kind of calling everything tables 20180704 14:37:55< hk238> :D 20180704 14:38:03< discordbot1> is that it shuffles that 20180704 14:38:15< hk238> I think it's not very well structured 20180704 14:38:26< hk238> I guessed the reason was that you couldn't store the actual pool into WML 20180704 14:38:31< hk238> but if you can then I don't see why to do it that way 20180704 14:38:35< discordbot1> ah no, 20180704 14:39:00< hk238> it does make sense though to shuffle some tickets that reference the "random_spawns" via index as opposed to shuffling the "random_spawns" array. That would be much worse :D 20180704 14:39:17-!- irker817 [~irker@uruz.ai0867.net] has joined #wesnoth-umc-dev 20180704 14:39:17< irker817> mattsc: mattsc AI-demos:master 990236e9445a / AI-demos/lua/ (ca_zone_control.lua fred_move_leader_utils.lua fred_ops_utils.lua): Fred ops: collect leader and protect objectives in one table https://github.com/mattsc/AI-demos/commit/990236e9445a8a24eeed81e672e39332c74ccce7 20180704 14:39:19< irker817> mattsc: mattsc AI-demos:master 828925572003 / AI-demos/lua/ (fred_config.lua fred_ops_utils.lua): Fred ops: add delayed_actions table https://github.com/mattsc/AI-demos/commit/828925572003a9da8bad16bceb23182699e19b85 20180704 14:39:21< irker817> mattsc: mattsc AI-demos:master c06143682113 / AI-demos/lua/ (fred_move_leader_utils.lua fred_ops_utils.lua): Fred ops: don't add keep to leader objectives if already there https://github.com/mattsc/AI-demos/commit/c061436821133e4774079b282ff2ab081ec1de36 20180704 14:39:23< irker817> mattsc: mattsc AI-demos:master f74f0db7e29d / AI-demos/lua/fred_move_leader_utils.lua: Fred ops: don't force move leader to keep if nothing to recruit https://github.com/mattsc/AI-demos/commit/f74f0db7e29d9814070cc704fcb5c0e6c4d2acfd 20180704 14:39:25< irker817> mattsc: mattsc AI-demos:master b8ddd9583ca4 / AI-demos/lua/fred_ops_utils.lua: Comment out debug output https://github.com/mattsc/AI-demos/commit/b8ddd9583ca4c9030f40a52aa550842efbf7d321 20180704 14:39:27< irker817> mattsc: mattsc AI-demos:master 3c106b5cfebd / AI-demos/lua/ (fred_config.lua fred_ops_utils.lua fred_village_utils.lua): Fred ops: merge village actions into delayed_actions https://github.com/mattsc/AI-demos/commit/3c106b5cfebdfc22f714336be763aa7e2567f1fb 20180704 14:39:46< hk238> the "random_spawn_ numbers" are basically like tickets that are put into a bowl and shuffled around... then the for loop starts that works with the spawns data. Those spawns are then given "a pool num" 20180704 14:39:59< hk238> which is then used to access the random_spawns 20180704 14:40:20< hk238> and they're just dished out in order basically by the for loop counter 20180704 14:40:35< hk238> so you could scrap the entire shuffling process and instead just pass random pools around 20180704 14:40:44< discordbot1> yes 20180704 14:40:51< hk238> which would be much better and easier to read and modify also 20180704 14:40:55< discordbot1> sure 20180704 14:41:16< discordbot1> from what I can understand now, being super-tired is yeah, it's redundant 20180704 14:41:59< hk238> another reason for that is also you don't need to separately make sure the same wave doesn't occur twice 20180704 14:42:23< hk238> but still you could convert it back into an actual pool within this for loop mess :D 20180704 14:43:50< hk238> I mean that reason is favoring this bowl shuffling thing 20180704 14:49:36< discordbot1> yes 20180704 14:49:37< discordbot1> perhaps 20180704 14:50:03< discordbot1> the reason why he didn't do it, is this lua api function has problems with creating wml subarrays withing arrays 20180704 14:50:25< discordbot1> I wouldn't know 20180704 14:50:38< hk238> maybe it would make sense if there was problem passing the information through WML somehow 20180704 14:50:51< discordbot1> converting lua tables to wml is problematic 20180704 14:50:56< discordbot1> but with the converter is easy 😄 20180704 14:51:06< discordbot1> that being said, i've never used that API 20180704 14:51:08< hk238> Mr. Salesman! 20180704 14:51:13< discordbot1> so I wouldn't know if it has any limitations 20180704 14:51:18< hk238> :D 20180704 14:52:20< hk238> My life used to be so hard before the array to WML converter. But then I found WMLMatic, the automatic lua tables into wml arrays converted recommended by 90% of users*..... *: Questionnaire location WMLMatic HQ 20180704 14:52:21< hk238> :D 20180704 14:52:39< discordbot1> hmmmmmmmmm 20180704 14:52:49< hk238> sorry :o 20180704 14:53:03< discordbot1> I forgive you 😮 20180704 14:53:09< hk238> :D 20180704 14:54:34< discordbot1> so yeah, absolutely, insert the pools 20180704 14:54:43< discordbot1> draw a random number 20180704 14:54:51< discordbot1> with helper.rand or whatever 20180704 14:54:59< discordbot1> and insert a random pool into each wml node 20180704 14:55:07< discordbot1> if you like 20180704 14:55:23< discordbot1> the downside is you store more WML 20180704 14:55:58< hk238> So, 20180704 14:56:25< hk238> I'd like to create a wave that consists of one spawn, a goblin, named "Elder" and give him two traits instead of the regular one as an insidejoke 20180704 14:56:30< hk238> :D 20180704 14:56:46< hk238> or actually I was thinking about making that happen as an easter egg with some low probability 20180704 14:57:48< discordbot1> okay 20180704 14:57:50< hk238> mm maybe I shouldn't do that. It does seem kind of rude even if it was a joke 20180704 14:58:04< hk238> but easter egg waves I would like to do, perhaps with a bit more taste 20180704 14:58:26< discordbot1> So yeah the downside to that approach is first you have to declare the pools once 20180704 14:58:28< discordbot1> in lua or whatever 20180704 14:58:41< discordbot1> and then you store them again in wml 20180704 14:58:51< discordbot1> more data to store in the savefile 20180704 14:59:48< discordbot1> that being said 20180704 15:00:02< discordbot1> local random_spawn_numbers = {} for i = 1, #random_spawns do table.insert(random_spawn_numbers, i) end 20180704 15:00:06< discordbot1> 2 lua tables 20180704 15:00:36< discordbot1> it's just that the 2nd one doesn't get stored in the savefile 20180704 15:00:39< hk238> yeah it's basically juts copy pasting the number of indices in random_spawns into another array 20180704 15:01:28< hk238> then shuffling them 20180704 15:01:31< hk238> then dishing them out in order 20180704 15:01:38< hk238> storing them in WML 20180704 15:02:02< hk238> and then at 350 prestart function creates the wave with help of other functions and the WML-stored information 20180704 15:02:17< discordbot1> the prestart event 20180704 15:02:30< discordbot1> it creates all waves 20180704 15:02:33< hk238> so if I wanted to change something about the waves, I can't change just the forloop, the prestart function doesn't know how to deal with.. it's called an event? 20180704 15:02:36< discordbot1> all the waves beforehand 20180704 15:03:09< hk238> oh sorry I was talking wrong 20180704 15:03:12< discordbot1> well, it's a lua function 20180704 15:03:16< hk238> it's not prestart function it's new turn function 20180704 15:03:30< discordbot1> that fires on this wml event 20180704 15:03:32< hk238> from 341 to 356 20180704 15:03:48< hk238> the prestart function is right above that so I accidentally confused it 20180704 15:03:59< discordbot1> yes, okay 20180704 15:04:09< discordbot1> so now you know how to refactor this 20180704 15:05:02< hk238> "with the converter it's easy"? :D 20180704 15:05:56< discordbot1> moderately 20180704 15:07:16< hk238> so how do I use this? Save the code? btw in lua if I want to "load" your function can I put it in another file and run your file first? like can you use stuff in other files? 20180704 15:07:27< discordbot1> yes, this is what you do 20180704 15:07:33< hk238> I have only a few hours of experience with lua 20180704 15:07:38< discordbot1> well, there is the lua.dofile funciton BUT 20180704 15:07:43< discordbot1> wensoth.dofile 20180704 15:07:49< discordbot1> but don't use it, because it's not multiplayer safe 20180704 15:07:53< discordbot1> instead 20180704 15:08:15< discordbot1> save the file, and add wrap it in << >> 20180704 15:08:30< discordbot1> so put those brackets around the rest of the code 20180704 15:08:31< discordbot1> then 20180704 15:08:34< hk238> hm? as a .cfg file? 20180704 15:08:50< discordbot1> ah no wait 20180704 15:09:02< hk238> the current code is using wesnoth.dofile though 20180704 15:09:11< hk238> I was t hinking about juts adding another line like that with your file 20180704 15:09:30< hk238> is there some "require" stuff or something like that? 20180704 15:09:37< discordbot1> wesnoth.dofile breaks if somebody doesn't have the mod 20180704 15:09:46< hk238> I mean there is clearly 20180704 15:10:01< hk238> this scenario has "require scenario" though 20180704 15:10:19< discordbot1> yeah i need to see the rest of the code 20180704 15:10:22< discordbot1> hang on 20180704 15:11:16< hk238> most of the weather stuff is rewritten by me 20180704 15:11:32< hk238> and this is copy paste from a work in progress 20180704 15:11:58< hk238> rest is from original dark forecast 20180704 15:11:58< discordbot1> replace the dofile with 20180704 15:12:32< hk238> gold per wave coefficient is also by me :D it's pretty hideous looking but supposedly does what it's supposed to 20180704 15:12:57< discordbot1> [lua] code = {~add-ons/murky_weathercast/data/2p_murky_weathercast.lua} [/lua] 20180704 15:12:58< discordbot1> sec 20180704 15:13:42< discordbot1> can use triple tick marks for that btw 20180704 15:14:00< discordbot1> [lua] code = {~add-ons/murky_weathercast/data/2p_murky_weathercast.lua} [/lua] 20180704 15:14:21< discordbot1> um where? 20180704 15:14:42< discordbot1> just type the characters 20180704 15:14:58< hk238> huh? :o 20180704 15:15:09< discordbot1> ttriiple tick marks? 20180704 15:15:26< discordbot1> ` 20180704 15:15:30< discordbot1> three of those 20180704 15:15:49< discordbot1> where 20180704 15:16:07< hk238> ``` like this? ``` 20180704 15:16:13< hk238> what do you do with those? 20180704 15:16:14< discordbot1> ah 20180704 15:16:16< discordbot1> on my keyboard at least it's the non-shift of ~ 20180704 15:16:19< discordbot1> yeah 20180704 15:16:23< discordbot1> ooh 20180704 15:16:24< discordbot1> now i get it 20180704 15:16:30< discordbot1> you're commenting on discord 20180704 15:16:33< discordbot1> not on the code 20180704 15:16:37< discordbot1> discord formatting 20180704 15:16:37< discordbot1> oh, yeah 20180704 15:16:39< discordbot1> xD 20180704 15:16:43< discordbot1> blablalb 20180704 15:17:15< discordbot1> hk238: discord has some markdown formatting 20180704 15:17:30< discordbot1> so, dike, do this: 20180704 15:18:02< discordbot1> tick marks can be used for code blocks, asterisks will make text italic, etc 20180704 15:18:33< hk238> in .cfg files? 20180704 15:18:35< discordbot1> [lua] code = {~add-ons/murky_weathercast/data/table_converter.lua} [/lua] [lua] code = {~add-ons/murky_weathercast/data/2p_murky_weathercast.lua} [/lua] 20180704 15:18:41< discordbot1> in the cfg file 20180704 15:18:48< hk238> okay I'll try that 20180704 15:18:52< discordbot1> then in the lua files, put << >> around the whole code 20180704 15:19:00< discordbot1> in both files 20180704 15:19:13< discordbot1> then in your main lua file, call any function from the 1st file 20180704 15:19:49< hk238> okay :o 20180704 15:58:29< Ravana_> even if you want to be mp safe at some point, during development it is not good idea. Developing with loading local Lua is so much faster than reloading wml for each change 20180704 16:03:10< discordbot1> reloading wml? 20180704 16:03:34< Ravana_> https://github.com/ProditorMagnus/OrociaRandomMod/blob/master/utils/lua_init.cfg#L1-L34 20180704 16:03:42< discordbot1> basicallly wesnoth.dofile is broken, if you use it in mp the mod will break for the people who don't have it downloaded 20180704 16:04:07< Ravana_> for me it loads as Lua file, for others loads as Lua string 20180704 16:04:13< discordbot1> nice, but is it much faster? 20180704 16:04:19< discordbot1> i've never noticed any difference 20180704 16:04:21< Ravana_> yes 20180704 16:04:27< Ravana_> you don't need to f5 anymore 20180704 16:04:32< discordbot1> i.e. it takes around 5 secs anyway 20180704 16:04:37< discordbot1> i mean seconds 20180704 16:04:38< discordbot1> milliseconds 20180704 16:04:57< discordbot1> i mean possibly seconds for the whole add-on if it's complex 20180704 16:05:05< discordbot1> to load a single lua file, milliseconds so...? 20180704 16:05:28< discordbot1> f5? 20180704 16:05:37< Ravana_> reload wml 20180704 16:05:55< discordbot1> F5 on the main menu reloads the WML cache 20180704 16:06:10< discordbot1> oh 20180704 16:06:34< discordbot1> i always close my client and reopen it 20180704 16:06:37< discordbot1> 😄 20180704 16:06:41< Ravana_> nice 20180704 16:06:48< Ravana_> so you have even more to gain from this 20180704 16:06:48< discordbot1> but that itself takes a couple of seconds so... 20180704 16:07:16< discordbot1> i honestly haven't noticed a difference, because the whole game loads so quickly 20180704 16:07:45< discordbot1> if it was a difference of 30 seconds, 1 minute, whatever 20180704 16:07:56< discordbot1> but it just loads in the blink of an eye 😄 20180704 16:08:24< discordbot1> but i dunno. maybe? on slower systems? 20180704 16:08:36< discordbot1> doesn't seem to be important here, anyway 20180704 16:15:09< Ravana_> starting wesnoth took slightly under 4min this time 20180704 16:18:11< Ravana_> and around 1min for f5 20180704 16:19:26< discordbot1> I suppose you have a ton of large addons installed? 20180704 16:20:29< Ravana_> lack of ssd is more important than any addons 20180704 16:21:27< discordbot1> 4 MINUTES? 20180704 16:22:01< discordbot1> well 20180704 16:22:04< discordbot1> ageless era 20180704 16:22:09< discordbot1> 😛 20180704 16:26:10< Ravana_> you sound like vultraz 20180704 16:27:39< Ravana_> (https://github.com/wesnoth/wesnoth/issues/3046) 20180704 16:28:24< discordbot1> My game runs off an HDD. 20180704 16:28:48< discordbot1> It takes less than 10 seconds to load even with AE installed. 20180704 16:29:45< discordbot1> The only parts that are on an SSD are the system libraries. 20180704 16:31:14< discordbot1> Ravana_: is this a debug build or something? 20180704 16:31:40< Ravana_> flatpak 20180704 16:32:43< discordbot1> i have ageless installed, as well 20180704 16:32:56< discordbot1> yeah, like 2-5 secs 20180704 16:33:02< discordbot1> then again, i have 12gbram 20180704 16:33:10< discordbot1> hm 20180704 16:33:20< discordbot1> i'm using my integrated gpu atm, though 20180704 16:33:25< Ravana_> ram should actually be more important yes 20180704 16:33:33< discordbot1> i have an 8-core cpu 20180704 16:33:42< discordbot1> so a perfect gaming rig for wesnoth 20180704 16:33:46< discordbot1> well 20180704 16:33:57< discordbot1> 8 core pre-ryzen AMD cpu? 20180704 16:34:03< discordbot1> uhhh? 20180704 16:34:06< discordbot1> no, intel i think 20180704 16:34:09< discordbot1> ok 20180704 16:34:13< discordbot1> intel pentium 5? 20180704 16:34:14< discordbot1> i think 20180704 16:34:15< discordbot1> that's good then 20180704 16:34:22< discordbot1> i don't even know what htat is 20180704 16:34:26< discordbot1> xD 20180704 16:34:27< discordbot1> pre-ryzen 20180704 16:35:03< discordbot1> All Intel's 8-core processors are very expensive. I doubt that you'd actually have one. 20180704 16:35:09< discordbot1> it's AMD's recent architecture. their previous had a tendency to have more cores, but still be lower performing. 20180704 16:35:20< discordbot1> you mean you think I'm poor? 20180704 16:35:27< discordbot1> 😄 20180704 16:35:29< discordbot1> I think it's more likely you just have a quadcore with hyperthreading (8 logical cores). 20180704 16:35:48< discordbot1> let's see 20180704 16:36:23< discordbot1> but no, i'm fairly sure i have an 8th core one 20180704 16:36:30< discordbot1> wasn't that expensive, either 20180704 16:36:35< discordbot1> For example, the Core i7-5960X (eight cores, launched in 2014) costed 999 dollars. 20180704 16:37:42< discordbot1> also wesnoth isn't hugely multithreaded, so more cores won't really get you much 20180704 16:37:54< discordbot1> Hyperthreading provides 8 logical threads. There is a difference between cores and threads that the OS has to take into account for scheduling decisions. Most programs believe they are looking at cores though. 20180704 16:37:55< discordbot1> this : AMD FX(tm)-8320 Eight-Core Processor 20180704 16:38:02< discordbot1> oh, an amd then 20180704 16:38:22< discordbot1> i would never spend a thousand bucks on a cpu, that i can assure you of 20180704 16:38:33< discordbot1> Also yes the parser in particular runs on a single thread and gets no benefit from increased core count whatsoever. 20180704 16:42:24< discordbot1> so yeah, a pre-ryzen CPU then. AMD mostly caught up with intel with ryzen, but before that... 20180704 16:43:24< discordbot1> oh. 20180704 16:43:36< discordbot1> ah, well. 20180704 16:45:36< discordbot1> yeah, but even with an old CPU ... 4 Minutes... CPUs did in the last years not get that much more powerful, rather smaller whille beeing staying as strong 20180704 17:38:16-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 17:38:22-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 17:39:33-!- irker817 [~irker@uruz.ai0867.net] has quit [Quit: transmission timeout] 20180704 17:42:18-!- hk238 [~kvirc@unaffiliated/hk238] has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/] 20180704 18:13:05-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 18:13:12-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 18:47:34-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 18:47:40-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 19:44:00-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 19:44:06-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 20:48:24-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 20:48:30-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 21:07:09-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20180704 21:07:16-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-umc-dev 20180704 21:21:51< discordbot1> Is the [recruit] tag outdated? When I tried using it, it said that the WML wasn't recognized. [command] dependent=no [filter_side] side=3 [/filter_side] [recruit] type=Orcish Grunt, Orcish Archer, Orcish Warrior, Orcish Warrior, Goblin Pillager, Orcish Crossbowman x=43,44,44,43,42,42,41 y=1,1,2,3,2,1 [from] x=43 20180704 21:21:51< discordbot1> y=2 [/from] [/recruit] [/command] 20180704 21:22:36< discordbot1> Not sure what I did wrong here. I'm trying to force the side to recruit units. 20180704 21:22:55-!- irker969 [~irker@uruz.ai0867.net] has joined #wesnoth-umc-dev 20180704 21:22:55< irker969> mattsc: mattsc AI-demos:master df1f3bf8df23 / AI-demos/lua/ca_zone_control.lua: Fred ops: remove need to pass leader_distance in protect_locs https://github.com/mattsc/AI-demos/commit/df1f3bf8df23ac5897de7dd66884336316b7fdf3 20180704 21:22:57< irker969> mattsc: mattsc AI-demos:master 4b9df78c0c72 / AI-demos/lua/ (ca_zone_control.lua fred_ops_utils.lua fred_village_utils.lua): Fred ops: remove/replace the old protect_locs tables https://github.com/mattsc/AI-demos/commit/4b9df78c0c7203edab69990d4206e884c220bdf5 20180704 21:22:57< discordbot1> That's replay code 20180704 21:23:04< discordbot1> you want the [unit] tag 20180704 21:24:18< discordbot1> at least to my knowledge, there is no command than can simultaneously place a unit and remove gold 20180704 21:24:23< discordbot1> So if I wanted it to look like they're being recruited, I'd need to make them with the unit command or macro, and then an animate command? 20180704 21:24:33< discordbot1> no 20180704 21:24:45< discordbot1> [unit] can animate 20180704 21:24:54< discordbot1> or does it always? look it up 20180704 21:25:04< discordbot1> but as far as removing gold, you'd have to add that part manually 20180704 21:25:06< discordbot1> animate= is a key of [unit] 20180704 21:25:06< discordbot1> https://wiki.wesnoth.org/SingleUnitWML 20180704 21:25:11< discordbot1> right 20180704 21:25:23< discordbot1> animate: whether to display the recruitment animation for this unit as if it were being recruited/recalled. Defaults to "no". Irrelevant when the [unit] tag appears inside a [side]. 20180704 21:25:28< discordbot1> unless there's a standard macro that simulates recruitment 20180704 21:25:35< discordbot1> you would need to combine [unit] with 20180704 21:25:45< discordbot1> [gold] 20180704 21:26:37< discordbot1> Cool! 20180704 21:27:08< discordbot1> Does this automatically tie it to the leader? Will the leader still make the recruiting animation? 20180704 21:27:35< discordbot1> Tie it? No, I don't think there will be a recruitment animation. 20180704 21:27:45< discordbot1> Is there a recruitment animation? 20180704 21:27:53< discordbot1> For some units 20180704 21:27:54< discordbot1> I don't pay that much attention to those things 😄 20180704 21:27:57< discordbot1> such as the litch 20180704 21:27:57< discordbot1> some units have 20180704 21:28:07< discordbot1> I think others just face? 20180704 21:28:08< discordbot1> but no 20180704 21:28:25< discordbot1> Ok, great guys. Thanks for the help. 20180704 21:28:32< discordbot1> Np 20180704 21:29:18< discordbot1> also, I recommend if you're getting into complex logic that you use Lua, either embedded (via [lua], could be inline or a separate file) or a custom WML tag 20180704 21:29:48< discordbot1> I would need that to do multiple of these animations simultaneously, correct? 20180704 21:30:15< discordbot1> I think so 20180704 21:32:40< discordbot1> Well, I don't think so 20180704 21:32:57< discordbot1> if you mean animating usings separately 20180704 21:33:02< discordbot1> depends on what exactly you mean 20180704 21:33:04< discordbot1> there's the [animate] tag 20180704 21:33:11< discordbot1> It is possible to tell the AI exactly what to recruit in one turn. But it will probably require deeper reading into how the AI works. 20180704 21:33:18< discordbot1> you mean [animate_unit] 20180704 21:33:22< discordbot1> yeah 20180704 21:34:34< discordbot1> Right, that's actually different. 20180704 21:35:40< discordbot1> On the other hand 20180704 21:35:57< discordbot1> You can't execute commands simulteaneously 20180704 21:36:03< discordbot1> simultaneously 20180704 21:36:08< discordbot1> There exists actually an example on how to do that https://wiki.wesnoth.org/AI_Recruitment#Examples 20180704 21:41:00< discordbot1> (That's the kind of stuff which is one does not put in ad [command], but sth. like for example the [ai] tag in the [side] definition. The [recruit] there is not a real WML tag, besides looking so. This is in a [facet] tag, and what you see there is a syntax which looks like wml but sets a value of something. ) 20180704 21:42:53< discordbot1> Yeah, it's replay code, although you can execute a couple of the replay commands 20180704 21:43:10< discordbot1> in your code, and in this way sync them from an unsynced context 20180704 21:45:01< discordbot1> an unsynced event 20180704 21:45:37< discordbot1> I mean the last link from me contains as well a [recruit], but it's not the same... basically it's not WML, but the syntax how one sets AI aspects... If I were to compare it with WML, it's rather a attribute of a tag. 20180704 21:45:51< discordbot1> ah 20180704 21:52:25< discordbot1> When using custom macros, do you have to define it in each scenario you use it in, you just the once in utils? 20180704 21:52:34< discordbot1> just once 20180704 21:52:38< discordbot1> you can't redefine them, actually 20180704 21:52:41< discordbot1> will throw a warning 20180704 21:53:25< discordbot1> just include the file before everything else 20180704 21:53:28< discordbot1> in your main.cfg 20180704 21:57:10< discordbot1> You have helped tons. I appreciate it! 20180704 22:10:17< discordbot1> I'm happy to help! 20180704 22:39:59< Ravana_> there is [do_command] that can simulate human action in similar syntax as replay 20180704 23:48:35< discordbot1> Oh, right, I mentioned it later,but I thought you couldn't use recruit. Apparently you can. 20180704 23:48:40< discordbot1> earlier* 20180704 23:49:29< discordbot1> https://wiki.wesnoth.org/DirectActionsWML#.5Bdo_command.5D 20180704 23:56:32< discordbot1> That would work best in your case. --- Log closed Thu Jul 05 00:00:26 2018