--- Log opened Mon Nov 26 00:00:58 2018 20181126 00:05:36< celticminstrel> status=not_living does the same thing as your [filter_wml] block in less lines and more efficiently. 20181126 00:06:21< celticminstrel> Your store unit filter looks like it's correct if you want to store all units that are adjacent to a unit with the jubokko ability. 20181126 00:07:30< celticminstrel> Geh, still using {FOREACH}... 20181126 00:07:56< celticminstrel> You're missing your $'s on lines 40 and 52. 20181126 00:08:18< celticminstrel> Should be $adjacent_units in all four cases. 20181126 00:08:28< celticminstrel> (But not on line 57, of course.) 20181126 00:09:17< celticminstrel> Sounds like youre store unit filter may not be correct for what you actually want. 20181126 00:09:21< celticminstrel> ^your 20181126 00:22:02< hk238> I wouldn't want to use foreach if I knew how not to :D 20181126 00:22:20< hk238> thanks I'll try and look into that again 20181126 00:29:05< celticminstrel> [foreach] 20181126 01:42:52< hk238> I'm having trouble making sense out of this 20181126 01:43:12< hk238> It's not clear what the context of the 'filter_adjacent' thing is and what the conditions apply to 20181126 01:44:22< celticminstrel> [filter_adjacent] means "match units who are adjacent to a unit matching this filter". 20181126 01:45:29< hk238> okay so if I get units like that how can filter the filtered units? 20181126 01:45:46< hk238> can I apply a second filter block? 20181126 01:46:43< celticminstrel> Um. 20181126 01:46:51< hk238> https://pastebin.com/evAZR8Ee 20181126 01:46:52< hk238> like this? 20181126 01:46:53< celticminstrel> Well, first of all, you can put multiple conditions in a filter. 20181126 01:47:22< celticminstrel> Yeah, like that. That will match any unit who has the jubokko ability and is adjacent to a unit with the not_living status. 20181126 01:47:30< hk238> okay 20181126 01:47:43< celticminstrel> I assume that's... not quite what you want, but much closer certainly. 20181126 01:47:45< hk238> but this is now multiple units, how are they stored or what is the this that they're contained in? 20181126 01:48:13< celticminstrel> If multiple units match the store_unit filter, you get an array of units. 20181126 01:48:33< celticminstrel> Your previous example was handling that correctly, I think. 20181126 01:49:11< hk238> but I guess they need to be adjacent to the unit that dies in the die event 20181126 01:49:24< hk238> so I need to also include the 'this unit' into the filter? 20181126 01:49:45< hk238> id=$this.unit.id ? 20181126 01:49:47< hk238> something like that? 20181126 01:49:58< celticminstrel> No. 20181126 01:50:30< celticminstrel> $this_unit in a filter refers to the "current unit being filtered on", which basically means it could be any unit. 20181126 01:50:40< celticminstrel> For the unit involved in the event, you want just $unit 20181126 01:51:33< hk238> okay 20181126 01:51:59< hk238> so I need to put all this inside a store_unit clause so that I can store array into something? 20181126 01:52:43< celticminstrel> Something like that. 20181126 01:53:04< hk238> https://pastebin.com/3w9i7fuB 20181126 01:53:47< celticminstrel> That will match units with the jubokko ability who are adjacent to the unit who died, but only if that unit is undead. 20181126 01:54:31< hk238> right so living I guess it's then instead of not_living? 20181126 01:54:54< celticminstrel> No. 20181126 01:54:59< celticminstrel> There is no "living" status. 20181126 01:55:32< hk238> so.. not not_living? 20181126 01:55:36< celticminstrel> Basically. 20181126 01:57:13< hk238> it should work now thanks I'll get to debugging later if it doesn't 20181126 02:18:31< hk238> hmm since there's no defense WML Tag, what would seem like the most straightforward approach to achieve essentially the same? 20181126 02:19:58< hk238> I'm out of ideas and was thinking the vampire elf would have extra defense at night, thus I'd need to make an ability like that.. But probably requires some tinkering 20181126 02:20:21< hk238> but since it would be a good idea that the solution was generalizable, so for future use could use the same template with defense related abilitiies 20181126 02:21:27< hk238> I mean there's chance_to_hit, but then I'd need to apply it to all attacks on the unit 20181126 02:21:37< hk238> and if the unit doesn't have a ranged or a melee attack, then that doesn't work 20181126 02:22:23< hk238> maybe I should try the register option 20181126 02:22:50< hk238> also one possibility is to make an event that changes the chance to hit of an attacker if the defender has the ability 20181126 02:22:58< hk238> but I wonder if that messes up with magical & the like 20181126 02:24:09-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has quit [Ping timeout: 252 seconds] 20181126 02:24:48-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has joined #wesnoth-umc-dev 20181126 02:28:07< hk238> hmm how do I write a condition in WML tags like [if] unit has ability, then? 20181126 02:30:01< hk238> It kind of feels like using the unit filters might make the code unnecessarily heavy, it would be straightforward to use propositional logic and check if, then, to avoid having to process and store units a lot. Maybe? I'm not sure if it makes sense 20181126 02:44:05< hk238> okay I think I should do that using objects 20181126 02:45:40< hk238> I'll just add an object with duration "turn" if it's chaotic tod.. although this solution clearly doesn't generalize 20181126 04:18:12< hk238> hmm where are the races defined? 20181126 04:19:09< hk238> nvm found it 20181126 04:20:18< hk238> hmm is it possible to use the default race definition but remove quick trait? 20181126 04:20:49< hk238> like I have 2 elf units in this vampire thing, but I was wondering that they wouldn't get the quick trait, so I probably have to define a new race juts for that? 20181126 04:24:58< celticminstrel> hk238: To alter defense, the closest thing is the [chance_to_hit] weapon special. 20181126 04:25:29< celticminstrel> For "if unit has ability", something like [if][have_unit]id=... ability=... 20181126 04:26:04< celticminstrel> FTR, "there's no defense WML tag" is misleading. There is such a tag, in fact, just not in the context you want it. 20181126 04:26:10< celticminstrel> (In movetypes) 20181126 05:18:12-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has quit [Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] 20181126 05:42:26< hk238> yeah 20181126 05:43:06< hk238> Well celtricminstrel left but this seems like the kind of functionality I might want to use in the future with various abilities, so should setup a framework to that via some kind of event or something 20181126 06:27:56-!- hk238 [~kvirc@unaffiliated/hk238] has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/] 20181126 08:09:54<+wesdiscordbot> it is possible like https://github.com/ProditorMagnus/Ageless-for-1-14/blob/master/lua/preload.lua#L59-L113 20181126 08:38:30-!- vn971 [~vasilii@office.zivver.org] has joined #wesnoth-umc-dev 20181126 09:23:02-!- Soliton_ [~Soliton@wesnoth/developer/soliton] has joined #wesnoth-umc-dev 20181126 09:25:22-!- Netsplit *.net <-> *.split quits: Soliton 20181126 09:25:37-!- Soliton_ is now known as Soliton 20181126 10:42:25-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20181126 12:37:15-!- vn971 [~vasilii@office.zivver.org] has quit [Ping timeout: 264 seconds] 20181126 12:54:17-!- vn971 [~vasilii@office.zivver.org] has joined #wesnoth-umc-dev 20181126 15:20:53-!- hk238 [~kvirc@unaffiliated/hk238] has joined #wesnoth-umc-dev 20181126 17:02:15-!- vn971 [~vasilii@office.zivver.org] has quit [Quit: Leaving.] 20181126 17:42:43-!- gfgtdf [~Daniel@x4d085b18.dyn.telefonica.de] has joined #wesnoth-umc-dev 20181126 17:42:54-!- gfgtdf [~Daniel@x4d085b18.dyn.telefonica.de] has quit [Client Quit] 20181126 21:04:23< hk238> hi 20181126 21:11:59< hk238> hm I think I decided on the solution for this defense ability thing 20181126 21:12:30< hk238> I'll make some piece of script that adds a weaponspecial to all attacks of all units 20181126 21:12:44< hk238> but I wonder what's the most straightforward way to do that 20181126 21:13:28< hk238> also if I use an event for that it messes up both human and AI calculations, if I do it at beginning of combat.. So I guess it woudl need to be a permanent addition, upon recruit 20181126 21:13:58< hk238> yeah I think that should work 20181126 21:16:25< hk238> how can I get all the attacks of a unit.. Is it an array called attacks? Probably is? 20181126 21:25:30< zookeeper> daze and formation in UtBS work by giving all units' all attacks weapon specials. 20181126 21:25:55<+wesdiscordbot> you dont need to add them to each attack separately 20181126 21:26:19<+wesdiscordbot> though you can, if you need it to not stick around after unit levels up 20181126 21:26:58< zookeeper> doing it in a unit placed event should cover almost everything, although you might want to consider whether there are any corner cases it wouldn't. 20181126 21:29:37< hk238> yea I just made a version but I dont know if it works 20181126 21:29:50< hk238> https://pastebin.com/i4ZfcXRQ 20181126 21:30:20< hk238> so now if I want to make an ability that gives defense to a unit 20181126 21:30:21<+wesdiscordbot> it wont 20181126 21:30:26< hk238> Why not? :o 20181126 21:30:38<+wesdiscordbot> effect is not actionwml 20181126 21:30:43< zookeeper> since when is [effect] an Ac... yeah 20181126 21:31:12< hk238> hmm :D so I need to write object clauses around it or something? 20181126 21:31:42< zookeeper> and after you turn that into an [object] which is probably what you want, that unit placed event will keep adding the same object to every unit all the time (once per scenario at the very least). 20181126 21:32:03< hk238> right so I should check if it already has it? 20181126 21:32:20< hk238> that would be tricky 20181126 21:32:31< hk238> for even if it won't work correctly in campaigns is not a major concern 20181126 21:32:43< hk238> and can't I use duration tag in object to avoid campaign problems? 20181126 21:32:58< zookeeper> it's not tricky to look how it's done when you already know where to look 20181126 21:33:38< hk238> right :d 20181126 21:33:51< hk238> so utbs.. okay I'll look into that 20181126 21:35:13<+wesdiscordbot> wardrums keeps track of it by using status 20181126 21:35:15< hk238> okay so I'll just filter and check it doesn't have the special already? 20181126 21:35:28< zookeeper> yes 20181126 21:36:43< hk238> I guess I can put the filte rin the effect :p 20181126 21:37:12< zookeeper> ... 20181126 21:38:26< hk238> ? 20181126 21:38:37< hk238> https://pastebin.com/hjAixe30 20181126 21:39:11< hk238> I think this should work, no? Also even if I add more  [chance_to_hit] or other tags on the {BLOODLEGACY_DUMMY_WEAPONSPECIAL} macro, it will apply them all? 20181126 21:39:58< zookeeper> i can only repeat by previous warning 20181126 21:40:04< zookeeper> s/by/my 20181126 21:40:28< hk238> because.. Well there's another ability that does almost the same 'Circle of suspicion' which increases the defense of units adjacent to the unit :d 20181126 21:40:31< zookeeper> and the last time i checked, special= sure wasn't a SUF key 20181126 21:41:35< zookeeper> heck, according to the wiki [filter_location] isn't even a weapon special tag 20181126 21:43:28< hk238> https://pastebin.com/sfeEb4mR like this? 20181126 21:43:32< hk238> oh 20181126 21:44:07< hk238> but UTBS uses "special" key so that's where I got that 20181126 21:46:31< hk238> however there are weaponspecials like "chaotic" they must be using filter_location or some equivalent 20181126 21:46:40< hk238> I think Ghype's addon had that shadow-hit which I'm going to check now 20181126 21:47:17< hk238> oh it needs to be inside filter_opponent or filter_self tags? 20181126 21:48:10< hk238> hmm I think this should work but we'll see I think it's testable 20181126 21:53:17< hk238> nope it's not working 20181126 21:53:24< hk238> but there's no errors either hmm 20181126 21:56:30< hk238> oh it might have been because I tested it on the leader unit 20181126 21:56:39< hk238> maybe the events don't cover them? 20181126 21:59:06< hk238> no I just forgot to add the ability to the unit I was testing.. darn 20181126 22:00:25< hk238> also for some reason one of the units has an erroneous movetype but I don't know why 20181126 22:01:26< hk238> oh wait does the movetype.cfg file need to be contained exactly in the units/ subfolder? Since Igot that in the wml/ no wait obviously it cant be that since some movetypes are working 20181126 22:03:34< hk238> or maybe it's working but it just doesn't show up in the damage calc.. but it should like any other chancetohit 20181126 22:04:00<+wesdiscordbot> all WML is put into single file before it is evaluated 20181126 22:04:15<+wesdiscordbot> folder structure is only for your own understanding 20181126 22:09:31< hk238> the speaman's icon is all over the place in the game.. got to fix that I guess :D 20181126 22:10:24< hk238> neither of these defense abilities are working currently, for I don't know what reason 20181126 22:11:14< hk238> are they treated as separate specials when they're under the same macro? 20181126 22:11:30< hk238> I don't see why they wouldn't so that's probably not the source of this problem 20181126 22:12:58<+wesdiscordbot> again, by the time wml is evaluated, no macros remain 20181126 22:16:06<+wesdiscordbot> show your current code 20181126 22:17:13< hk238> I think I may have figured it one second 20181126 22:17:25< hk238> I had [filter] inside [effect] and not inside  [object]  20181126 22:18:08<+wesdiscordbot> personally I dont use raw [object], only with modify_unit 20181126 22:18:37< hk238> https://pastebin.com/xYS9qJ5A 20181126 22:18:44< hk238> alright that didn't fix it so I don't what's wrong 20181126 22:20:48< zookeeper> unsurprisingly, ability= filters for abilities 20181126 22:21:33< zookeeper> besides, you're not even saying whether it's your event, object, effect or just the specials that aren't working and how 20181126 22:23:35< hk238> yeah I have abilities separately they're just dummies though. Wait maybe that's the reason, does [dummy] coun't as an ability? 20181126 22:23:56< hk238> I probably need to use an actual tag? 20181126 22:24:24<+wesdiscordbot> if it is under abilities, then it is ability 20181126 22:24:29< hk238> https://pastebin.com/z374pch0 20181126 22:24:38< hk238> this is the dummy abilities file 20181126 22:24:58< hk238> They're included on the units and show up in game 20181126 22:25:09< hk238> so I think the problem should be contained in that event file 20181126 22:25:23< zookeeper> oh, right, sure 20181126 22:28:17<+wesdiscordbot> it would help to find out at what point it fails to work as you would want it to 20181126 22:31:41<+wesdiscordbot> something like: unit has ability -> unit has special (-> special without filter works) -> first part of special filter matches -> second part of special filter matches 20181126 22:31:53< hk238> yeah I'll test it now by giving names to the specials to determine if they're getting applied or not 20181126 22:33:20< hk238> they're not being applied so the event is somehow erroneous 20181126 22:33:38< hk238> do these events consistently have $unit as the unit that is being recruited? 20181126 22:34:16<+wesdiscordbot> most of those events are not about recruiting 20181126 22:35:26< Ravana> but yes, primary unit is unit 20181126 22:41:18-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 272 seconds] 20181126 22:48:01< hk238> Ahh I don't know what the problem is 20181126 22:48:02< hk238> :D 20181126 22:48:48< hk238> https://pastebin.com/E79HAwTu 20181126 22:48:57< hk238> might this _main.cfg be somehow inccorrect? 20181126 22:52:37< Ravana> no 20181126 22:52:50< Ravana> problems there would be visible before you could load it 20181126 22:55:51< hk238> id=$unit.id is this correct though? Can unit.id actually return the 'type' id? 20181126 22:56:15< hk238> I'll change it to coordinates but don't think that's the problem 20181126 22:56:49< Ravana> you don't even need that filter 20181126 22:58:31< hk238> hm 20181126 22:58:47< hk238> can you use a macro that's defined within the same file? 20181126 22:58:58<+wesdiscordbot> Yes 20181126 22:59:10<+wesdiscordbot> As long as it's substituted after it was defined 20181126 22:59:54< hk238> oops I made the previous edit to wrong file (in the addons) 20181126 23:00:01< hk238> so i have to do that again 20181126 23:02:06< hk238> nope still don't know what's wrong --- Log closed Tue Nov 27 00:00:01 2018