--- Log opened Mon Aug 10 00:00:21 2015 20150810 00:04:17-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has joined #wesnoth 20150810 00:05:23-!- framling [~user@c-50-186-43-50.hsd1.or.comcast.net] has joined #wesnoth 20150810 00:14:28-!- RodiX [~RodiX@unaffiliated/rodix] has joined #wesnoth 20150810 00:31:12-!- RodiX [~RodiX@unaffiliated/rodix] has quit [] 20150810 00:35:31-!- RodiX_ [uid5578@gateway/web/irccloud.com/x-dgwjduokydaqyukg] has joined #wesnoth 20150810 00:39:02-!- RodiX [~RodiX@unaffiliated/rodix] has joined #wesnoth 20150810 00:46:07-!- RodiX [~RodiX@unaffiliated/rodix] has quit [] 20150810 00:46:07-!- RodiX_ is now known as RodiX 20150810 00:48:50-!- RodiX_ [~RodiX@unaffiliated/rodix] has joined #wesnoth 20150810 00:49:25-!- RodiX_ [~RodiX@unaffiliated/rodix] has quit [Client Quit] 20150810 01:20:52-!- Appleman1234 [~Appleman1@KD036009064203.au-net.ne.jp] has quit [Ping timeout: 260 seconds] 20150810 01:42:03-!- Narrat [~Crebiz@p4FD16BD8.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 20150810 02:18:10-!- ArneBab [~quassel@55d45b3f.access.ecotel.net] has joined #wesnoth 20150810 02:18:52-!- Appleman1234 [~Appleman1@KD036009079216.au-net.ne.jp] has joined #wesnoth 20150810 02:21:22-!- ArneBab_ [~quassel@55d4591c.access.ecotel.net] has quit [Ping timeout: 260 seconds] 20150810 03:20:32-!- Kwandulin [~Miranda@p5B0084D6.dip0.t-ipconnect.de] has joined #wesnoth 20150810 03:22:05-!- RodiX [uid5578@gateway/web/irccloud.com/x-dgwjduokydaqyukg] has quit [Quit: Connection closed for inactivity] 20150810 03:26:37< celticminstrel> Huh. There's an undocumented [effect]apply_to=fearles and [effect]apply_to=healthy. 20150810 03:27:00< celticminstrel> ^fearless 20150810 03:27:36< celticminstrel> Ah, I see those are used by their namesake traits. 20150810 03:36:43-!- Appleman1234 [~Appleman1@KD036009079216.au-net.ne.jp] has quit [Ping timeout: 256 seconds] 20150810 04:17:43< aeth> oh wow I'm finally so close to playable 20150810 04:18:45< aeth> Character selection, inventory, upgrades, shops, chests, gold piles, unit spawning, terrain editing... so much of it is almost working or working. 20150810 04:29:46< ancestral> aeth: Awesome! 20150810 04:30:01-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150810 04:31:29< celticminstrel> Yay! 20150810 04:32:54-!- Appleman1234 [~Appleman1@KD036009073121.au-net.ne.jp] has joined #wesnoth 20150810 04:36:13< aeth> So what's going to happen is that on turn one on certain maps (the intermission or start ones), if your leader is a peasant (i.e. start of campaign or your leader died and was not resurrected) then you can select a unit with a maximum of the perrmited level (perhaps I should make gold cost cost e.g. character points or something to encourage lvl 0s and lvl 1s as a challenge even if the default is lvl 2) 20150810 04:36:48< aeth> (I can't believe IRC didn't cut that off, that was pushing it) 20150810 04:37:27< aeth> Right now the host sets the max level and sets the next map, soon I could add voting for that. Also, potentially voting for maps. 20150810 04:37:44< aeth> I will probably add some shop in the start/intermission too. This is copying a roguelike RPG that was... idk circa 1.8. 20150810 04:37:56< aeth> (Except my RPG doesn't use random maps.) 20150810 04:39:13< aeth> based on playtests I need before the next playtest: character selection, more inventory for shops, a visual indicator for when upgrades are available. 20150810 04:40:07< aeth> Also probably a faster way to stock shops/chests (I'll do this with templates while placing them) and a quick way to e.g. spawn in mobs and NPCs to get a setting up very quickly. 20150810 04:40:23< aeth> Finally, I need to make interacting with a shop or other units its own right click so it's more discoverable. 20150810 04:40:28< aeth> Once all of that is done it's playable. 20150810 04:45:13< aeth> That might sound like a lot but it's not, most of the work was rewriting it to use gui2. Most of this would be just writing new dialogs using existing functions and then doing a one-liner or a few lines to do an effect. 20150810 04:47:42< aeth> What I'll probably do this week is make pre-made selectable stuff for certain maps that will mass-place them when the host selects one, e.g. units (NPC, mobs), chests, gold, shops, etc. 20150810 04:48:20< aeth> The same map could have several entirely different stuff on there, and perhaps different sections instead of whole-map stuff. Eventually, I could randomly choose one, so even though the map is the same, what's on the map is different. 20150810 04:49:17< aeth> And once everything's replaced with random pre-scripted events, once the AI can summon units, and once voting is used in the beginning/intermission instead of the host stuff, then I can make RPGs playable without an omnipotent pseudo-debug-mode host. 20150810 04:50:32< aeth> So, basically I could have a complete RPG MP campaign by next weekend or next month or never, it's hard to tell what's easy and what's hard. 20150810 05:22:14< celticminstrel> ...wait wait wait. Isn't there an else-if now? 20150810 05:22:26< aeth> in...? 20150810 05:22:34< celticminstrel> WML 20150810 05:22:40< celticminstrel> I thought I saw it in the code. 20150810 05:22:43< aeth> idk 20150810 05:22:48< aeth> there's an elseif in Lua 20150810 05:23:08< aeth> If you're doing something complicated enough for conditionals it's so much easier in Lua unless it's some unit/whatever filter. 20150810 05:23:59< celticminstrel> Ah... it's new in 1.13. I see. 20150810 05:24:21< celticminstrel> Sorry, that had nothing whatsoever to do with what you were saying. 20150810 05:24:24< aeth> ah 20150810 05:45:12-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth 20150810 05:54:39-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has joined #wesnoth 20150810 06:02:46-!- oldlaptop [~quassel@50-107-125-36.adr02.mskg.mi.frontiernet.net] has quit [Ping timeout: 244 seconds] 20150810 06:04:40-!- oldlaptop [~quassel@50-107-125-36.adr02.mskg.mi.frontiernet.net] has joined #wesnoth 20150810 06:05:51-!- shurnormal_ [~uprego@unaffiliated/ushiu] has joined #wesnoth 20150810 06:44:28< vultraz> yes, [elseif] is 1.13-only 20150810 06:51:49< aeth> That's probably the most annoying thing about Wesnoth. All the nice features are a long time away from being usable in MP because no one plays on dev versions post-1.3 20150810 06:52:12< aeth> There are afaik some things that would simplify my code in 1.13. 20150810 06:55:26< celticminstrel> Is it impossible to use a custom icon in [editor_group]? 20150810 07:04:03< celticminstrel> ...I'll ask again later. 20150810 07:04:05< ancestral> Could some of the newer WML features be backported? 20150810 07:05:11< zookeeper> no 20150810 07:05:27< ancestral> “Elseif”? All you need are GOTO statements, aeth! 20150810 07:05:50-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has quit [Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] 20150810 07:07:44< vultraz> Just write it [else][if] :P 20150810 07:07:48< vultraz> that does work 20150810 07:08:05< aeth> I try not to write complicated conditionals in WML 20150810 07:08:08-!- [Relic] [~Relic]@2602:306:33a3:6d30:45a3:5df4:2e8b:5c40] has quit [Quit: I press the magic X and all the weirdos go away!] 20150810 07:08:14< vultraz> Doesn't everyone? 20150810 07:08:45< aeth> What's sad is that WML is fairly close to Lisp in syntax, and Lisp has some very powerful conditionals. 20150810 07:09:17< aeth> WML needs [cond] 20150810 07:09:51< aeth> It's similar to if/elseif/else 20150810 07:32:53-!- Appleman1234 [~Appleman1@KD036009073121.au-net.ne.jp] has quit [Ping timeout: 252 seconds] 20150810 07:35:56< vultraz> What would that do 20150810 07:36:54-!- Kwandulin [~Miranda@p5B0084D6.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20150810 07:37:06< aeth> vultraz: the problem with WML's conditionals is that they're conditional statements, not conditional expressions. 20150810 07:38:13< aeth> foo [or] bar [/or] [or] baz [/or] [or] foobar [/or] is more complicated than [or] foo bar baz foobar [/or] 20150810 07:39:21< aeth> With expressions everything just returns something. The [or] [/or] tag would just return t or f. 20150810 07:49:56-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150810 07:51:34< aeth> If you have everything (well everything possible) as expressions, you can embed them within each other and reason about then from the inside out. 20150810 07:56:42-!- Earlo [~Earlo@line-10441.dyn.kponet.fi] has joined #wesnoth 20150810 08:04:35-!- Haudegen [~quassel@85.124.51.57] has quit [Ping timeout: 245 seconds] 20150810 08:07:47-!- Kwandulin [~Miranda@p5B0084D6.dip0.t-ipconnect.de] has joined #wesnoth 20150810 08:12:07-!- Haudegen [~quassel@85.124.51.57] has joined #wesnoth 20150810 08:30:34-!- Appleman1234 [~Appleman1@KD106179120224.au-net.ne.jp] has joined #wesnoth 20150810 08:52:35-!- jemadux [~jemadux@unaffiliated/jemadux] has joined #wesnoth 20150810 08:54:18-!- jimlei [~quassel@164.10.189.109.customer.cdi.no] has quit [Ping timeout: 260 seconds] 20150810 08:55:19-!- Smar [~smar@freenet/translator/finnish/Smar] has quit [Quit: moving] 20150810 09:08:05< nuun> !gn 20150810 09:18:25-!- Kwandulin [~Miranda@p5B0084D6.dip0.t-ipconnect.de] has quit [Ping timeout: 256 seconds] 20150810 09:19:06-!- Smar [smar@freenet/translator/finnish/Smar] has joined #wesnoth 20150810 09:24:21-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has quit [Ping timeout: 252 seconds] 20150810 09:36:24-!- DreadKnight [~DreadKnig@unaffiliated/dreadknight] has joined #wesnoth 20150810 10:03:47-!- lipkab [~the_new_l@host-91-147-210-193.biatv.hu] has joined #wesnoth 20150810 10:22:29-!- Crendgrim [~crend@wesnoth/forum-moderator/crendgrim] has joined #wesnoth 20150810 10:41:15-!- DreadKnight [~DreadKnig@unaffiliated/dreadknight] has quit [Quit: #AncientBeast - Master Your Beasts ( www.AncientBeast.com )] 20150810 10:43:13-!- LuHa [~E330-Mint@119.204.77.86] has quit [Quit: Leaving.] 20150810 11:36:51-!- salluc69 [~lucky@host73-195-dynamic.48-82-r.retail.telecomitalia.it] has quit [Quit: Sto andando via] 20150810 11:57:14-!- RodiX [uid5578@gateway/web/irccloud.com/x-tlgiypsmhiwdczcn] has joined #wesnoth 20150810 11:59:02-!- salluc69 [~lucky@host73-195-dynamic.48-82-r.retail.telecomitalia.it] has joined #wesnoth 20150810 12:10:28-!- Appleman1234_ [~Appleman1@KD036009072036.au-net.ne.jp] has joined #wesnoth 20150810 12:12:24-!- Appleman1234 [~Appleman1@KD106179120224.au-net.ne.jp] has quit [Ping timeout: 264 seconds] 20150810 12:23:59-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has joined #wesnoth 20150810 12:27:19-!- Kwandulin [~Miranda@p5B0084D6.dip0.t-ipconnect.de] has joined #wesnoth 20150810 12:51:14-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150810 13:03:36-!- Appleman1234_ is now known as Appleman1234 20150810 13:31:10-!- lipkab [~the_new_l@host-91-147-210-193.biatv.hu] has quit [Quit: Leaving] 20150810 13:44:34-!- Appleman1234 [~Appleman1@KD036009072036.au-net.ne.jp] has quit [Ping timeout: 260 seconds] 20150810 13:46:26-!- Haudegen [~quassel@85.124.51.57] has quit [Ping timeout: 260 seconds] 20150810 13:52:54-!- Haudegen [~quassel@85.124.51.57] has joined #wesnoth 20150810 14:40:16-!- Kwandulin [~Miranda@p5B0084D6.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20150810 14:41:51-!- Appleman1234 [~Appleman1@KD036009071226.au-net.ne.jp] has joined #wesnoth 20150810 14:59:17-!- Yaiyan [~Yaiyan@46.101.48.31] has quit [Read error: Connection reset by peer] 20150810 15:01:34-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has joined #wesnoth 20150810 15:04:43-!- [Relic] [~Relic]@2602:306:33a3:6d30:18c2:8741:8b3d:56e9] has joined #wesnoth 20150810 15:05:42< celticminstrel> Is it possible to use a custom icon in [editor_group]? 20150810 15:22:05-!- RodiX [uid5578@gateway/web/irccloud.com/x-tlgiypsmhiwdczcn] has quit [Quit: Connection closed for inactivity] 20150810 15:38:45-!- Appleman1234 [~Appleman1@KD036009071226.au-net.ne.jp] has quit [Ping timeout: 246 seconds] 20150810 16:14:28-!- Smedles [~quassel@58.160.136.199] has quit [Ping timeout: 272 seconds] 20150810 16:22:37-!- Earlo [~Earlo@line-10441.dyn.kponet.fi] has quit [Remote host closed the connection] 20150810 16:27:53< janebot> Tweet (by @Wesnoth) .@hroncok You're right, the link isn't in the most obvious place. Will fix. (It's here, if you still need it: https://github.com/wesnoth/wesnoth) [ https://twitter.com/Wesnoth/status/630777598222544896 ] 20150810 16:28:46-!- Falcon` [falcon@hell.kolosowscy.pl] has quit [Quit: I'll be back!] 20150810 16:29:02< vultraz> celticminstrel: you can use different colored crosses, but i think that's it 20150810 16:29:04< vultraz> not sure 20150810 16:29:43< celticminstrel> Right, but the crosses aren't custom icons. 20150810 16:30:25< vultraz> why don't you just try putting in an image path and see what happens 20150810 16:32:06< celticminstrel> The icon= key doesn't seem to be an image path. 20150810 16:32:21< celticminstrel> It's an identifier like group_all or something. 20150810 16:32:58< celticminstrel> I can't tell from the documentation whether the actual image path is somehow built from that or it's just looked up in a fixed list. 20150810 16:33:38< celticminstrel> Given that the icons appear to be in images/ rather than data/core/images/, I wouldn't be surprised if it's the latter. 20150810 16:35:20< vultraz> Seems they're all relative to images/icons/terrain 20150810 16:35:21-!- Appleman1234 [~Appleman1@KD036009068098.au-net.ne.jp] has joined #wesnoth 20150810 16:35:25< celticminstrel> What's minimap unit coding mean? 20150810 16:35:41< vultraz> See if you can hack the system by making a folder with that path in your addon and sticking an icon in there 20150810 16:35:58< vultraz> celticminstrel: whether to color unit dots on the map by team, or just groups of allies and enemies 20150810 16:36:54< celticminstrel> Are you sure? 20150810 16:37:10< celticminstrel> ...oh, it appears to colour them based on the orb. 20150810 16:38:04< celticminstrel> So red=enemy, green/orange=own with moves left, black=no moves left, and I'd guess blue=ally. 20150810 16:38:14< celticminstrel> (But this map has no allies so I can't tell.) 20150810 16:38:48-!- aeth [~Michael@wesnoth/umc-dev/developer/aethaeryn] has quit [Ping timeout: 264 seconds] 20150810 16:39:37< vultraz> It's not a very good feature 20150810 16:39:46< celticminstrel> The zoom scrollbar isn't very useful in 1.12... it's basically impossible to get to any precise zoom level... 20150810 16:40:12-!- aeth [~Michael@wesnoth/umc-dev/developer/aethaeryn] has joined #wesnoth 20150810 16:40:24< celticminstrel> It'd probably better if it went by 5's. 20150810 16:41:08< vultraz> Or some other step, yes 20150810 16:41:12< vultraz> It was discussed 20150810 16:41:19< vultraz> But I can't remember now why it wasn't implemented... 20150810 16:41:37< celticminstrel> It wasn't implemented? 20150810 16:42:50< vultraz> No, it's still a step size of 1 20150810 16:44:27< vultraz> The scale algorithm looks a lot better in 1.13, though 20150810 16:45:21< vultraz> But our performance when scaled still sucks horribly 20150810 16:45:25 * celticminstrel just randomly thought of something that would require an event fired when attacking a unit but before choosing which attack... 20150810 16:46:56-!- Falcon` [falcon@hell.kolosowscy.pl] has joined #wesnoth 20150810 16:49:05< celticminstrel> "Attack" a ship and the unit is stored on the ship. 20150810 16:49:57< celticminstrel> I suppose a different method is necessary. Having the ship be an "enemy" is extremely weird. 20150810 16:56:51< zookeeper> i'm randomly thinking that a right-click menu item would be a good alternative :p 20150810 16:57:33< celticminstrel> Yeah, you'd probably have to do something like "right-click while adjacent, select Board". 20150810 16:58:16< celticminstrel> The next problem is disembarking. The ideal way would be "right-click, select unit to disembark, select adjacent location to disembark to", but that won't work. 20150810 16:59:18< zookeeper> right-click on where to disembark, choose which unit 20150810 16:59:39< celticminstrel> Ah, that could work. 20150810 17:00:01< celticminstrel> A bit less intuitive in my opinion, but workable. 20150810 17:00:23< celticminstrel> I wonder if the Lua API is good enough to show a list of units currently on board when it's selected... 20150810 17:00:59< zookeeper> it is 20150810 17:01:33< celticminstrel> I kind of want to try this now. 20150810 17:02:01< celticminstrel> Maybe I could do it as an era. 20150810 17:02:18< celticminstrel> Actually, I wonder if someone else has done it already. 20150810 17:06:47< celticminstrel> I don't see anything on the add-ons server. 20150810 17:09:12< Ravana_> EoHS has way to select nearby hexes from menu, like with 5 radius 20150810 17:10:48-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has joined #wesnoth 20150810 17:11:10< celticminstrel> How does that work? 20150810 17:12:16< vultraz> I'd say menu item on all hexes within a radius of 20150810 17:12:18< vultraz> 5 20150810 17:12:19< vultraz> But I'm not sure 20150810 17:16:52-!- wario [~wario_@unaffiliated/wario] has joined #wesnoth 20150810 17:18:04< Ravana_> exactly how I have no idea, even though I have tried to recreate different things from it several times, but it looks like http://vgy.me/r5BtrI.png 20150810 17:20:02< celticminstrel> That thing on the right? 20150810 17:20:18< Ravana_> yes 20150810 17:20:28< celticminstrel> What do the arrows do? 20150810 17:20:39< Ravana_> scroll map 20150810 17:20:58< celticminstrel> There's two of each arrow... they're the same function? 20150810 17:21:21< vultraz> ok DAYUMN 20150810 17:21:22< Ravana_> no, there are 8 directions how you can scroll 20150810 17:21:26< vultraz> that is complex 20150810 17:21:42< celticminstrel> Yeah, probably some major GUI2 stuff. 20150810 17:21:53< celticminstrel> How are their 8 directions to scroll? 20150810 17:21:56< celticminstrel> ^there 20150810 17:21:59< vultraz> the interface could use a lot of cleanup but, wow 20150810 17:22:17< celticminstrel> Diagonals? 20150810 17:22:20< Ravana_> ah no, they are same indeed 20150810 17:22:25< celticminstrel> Ah, okay. 20150810 17:22:38< Ravana_> haven't played EoHS, only observed it 20150810 17:22:48< vultraz> I really have no idea how you could even... 20150810 17:22:52< vultraz> where's the bloody grid! 20150810 17:22:54< celticminstrel> Doesn't that screenshot indicate you playing it? 20150810 17:23:05< Ravana_> not really 20150810 17:23:07< celticminstrel> Anyway, it's impressive, but a bit much for transport ships. 20150810 17:23:12< Ravana_> you can open the menu as observer too 20150810 17:23:19< celticminstrel> Really? That's weird. 20150810 17:23:34< Ravana_> I managed to partially replicated that for ageless changelog 20150810 17:23:49< Ravana_> but instead of hover like EoHS I need select 20150810 17:26:38< aeth> celticminstrel: I just solved a similar problem, if you want to deal with adjacencies without right click 20150810 17:26:48< celticminstrel> Oh? 20150810 17:26:57< celticminstrel> How did you do it? 20150810 17:27:21< aeth> one second let me look it up 20150810 17:27:43< aeth> In Lua I use wesnoth.get_locations, feed it an x, y, radius 20150810 17:27:49< aeth> Then in lua I loop over the radius 20150810 17:28:01< aeth> I can do whatever I want to anything in that radius 20150810 17:28:12< celticminstrel> Hmm... 20150810 17:28:28< aeth> Any radius, any thing, I just need the x and y (and that will probably be through right click though in my particular case but doesn't have to be in yours) 20150810 17:28:54< celticminstrel> I'm not quite sure how that would be applicable to disembarking a unit from a transport ship. 20150810 17:28:56< aeth> So if you want to attack a ship and the unit stored on a ship, then on attack trigger a Lua, put a radius right in the middle of the ship, etc. 20150810 17:30:01< aeth> so you can e.g. cover the ship with one or more radiuses, and have the units take damage (even using the safe Wesnoth helper random) 20150810 17:30:31< celticminstrel> The attack idea is problematic because you can't attack your own units. Right-clicking a unit to store it makes sense, the only tricky part would be if there's more than one adjacent ship. Thre real problem is disembarking. 20150810 17:30:41< aeth> As for boarding, what I do for menu items is that I often make "dumb" menu items and do the logic in Lua again, and if there's no valid action they just turn up empty. That way I keep the filters mostly simple. 20150810 17:31:12< aeth> You can make one Interact menu item (useful anyway because there's a limit on the number) and then do everything through there 20150810 17:31:20< celticminstrel> Ugly! 20150810 17:31:22< aeth> In a call to a Lua function in [code] 20150810 17:31:50< celticminstrel> Did you have any ideas for disembarking? 20150810 17:31:52< Ravana_> the limit should be gone by now? 20150810 17:32:05< aeth> Ravana_: I'm assuming this is being done on 1.12, where all the players are 20150810 17:32:29< aeth> I guess I'm wrong and missed context 20150810 17:33:49< aeth> celticminstrel: give your ships a role, give them a radius in the filter for the role 20150810 17:34:25< aeth> make the unit be on a certain location to disembark, I think that's what The High Seas required 20150810 17:34:43< aeth> There was at least one hex used for entrances and exits 20150810 17:34:57< aeth> If there's ambiguity (more than one way on and off) then just make the user choose, but there will be much less ambiguity if there's a required location 20150810 17:35:38< celticminstrel> You're not wrong. 20150810 17:35:43< aeth> Imo the way discussed to select units from a menu after selecting the hexes is easier than selecting the hex from a menu after selecting the unit. 20150810 17:35:51< aeth> I thought about which way makes more sense for my Interact menu. 20150810 17:36:11< aeth> There will in general be fewer units available to interact than possible hexes they could interact on afaik. 20150810 17:36:21< celticminstrel> Is it possible to do this without having to redefine all the factions? 20150810 17:36:39< celticminstrel> There's a "modification" add-on type now, I think. 20150810 17:37:33< aeth> What I do in my add-on is I don't care about factions, but I do set everyone to peasant because I can do that. I then let them select their units within the game on round one if they are a Peasant. (I'm still working on it.) 20150810 17:37:48< aeth> Factions are irrelevant, you can clear and/or change recruit lists. 20150810 17:38:25-!- Yaiyan [~Yaiyan@46.101.48.31] has joined #wesnoth 20150810 17:38:39< aeth> It's not particularly user-friendly to allow people to select factions and then do nothing with it, but I'm not sure there's a no-download safe way around that. 20150810 17:40:59< aeth> The only issues I currently have with character selection are limitations in the gui2 dialog I defined, mostly that they can close the window (and thus not transform), do not have a back button (and thus can make a bad decision and not go back), and cannot select a gender. i.e. it's all possible but I need to write a new dialog rather than recycling an old one, and that will take more time. 20150810 17:41:21< celticminstrel> I don't care about being no-download. 20150810 17:41:46< aeth> celticminstrel: you should if you're doing anything really elaborate because then you can't test it without putting it up for public download 20150810 17:42:16< aeth> Your add-on is probably complex enough that the final release probably doesn't matter, but it's the testing that's an issue ime. 20150810 17:42:51< aeth> Basically, if you require download you always have to test the add-on "in production" by pushing an update to the add-on server, instead of e.g. having a separate version you work with separate from what's on the add-on server. 20150810 17:43:17< aeth> (Unless of course you only do local tests) 20150810 17:44:07< Ravana_> just using custom faction selection does not require download, custom unit types do 20150810 17:44:24< aeth> interesting 20150810 17:44:54< aeth> It might still discourage people from joining, e.g. every time I go to a custom era I do get booted for missing a unit. 20150810 17:45:07< Ravana_> indeed, unit, not factions 20150810 17:45:09< aeth> Even though it doesn't forbid me from joining 20150810 17:45:26-!- claymore2 [~hexchat@host109-154-204-244.range109-154.btcentralplus.com] has joined #wesnoth 20150810 17:45:30< aeth> Right, but if every custom faction selection usually kicks someone, then people might not join games with custom factions 20150810 17:45:48< Ravana_> generally they don't kick 20150810 17:45:59< Ravana_> there is require_era=yes 20150810 17:46:12< aeth> hah, that requires people to code their era properly 20150810 17:46:25< aeth> That's maybe half of the eras in use ime 20150810 17:46:52< aeth> The problem with Wesnoth custom MP right now (and it would probably go away if Wesnoth got released on Steam) is that it's really, really hard to get people to join a custom game as-is. 20150810 17:47:29< aeth> A lot of my decisions are based on doing things that aren't as elegant, but makes finding games easier. 20150810 17:49:02< celticminstrel> Do modifications use the [era] root tag? 20150810 17:49:35< Ravana_> no 20150810 17:49:42< Ravana_> both are toplevel 20150810 17:50:13< celticminstrel> So there's a [modification] toplevel tag? 20150810 17:50:18< Ravana_> yes 20150810 17:50:35< celticminstrel> Is its content the same as [era]? 20150810 17:50:39< aeth> I'm guessing that you can do [modification], [era], [campaign], etc. all within one add-on 20150810 17:50:47< celticminstrel> Of course. 20150810 17:50:56< Ravana_> mostly, [event] is most important part and that is same 20150810 17:50:57< aeth> I think if you want to require an era there's a require era thing 20150810 17:51:09< aeth> Bob the Mighty requires the Galactic Empire era in the Galactic Empire maps 20150810 17:51:20< celticminstrel> I mean, I don't see documentation for the [modification] toplevel tag on the wiki. 20150810 17:51:30< aeth> http://wiki.wesnoth.org/ModificationWML 20150810 17:51:34< celticminstrel> Oh, duh. 20150810 17:51:43< celticminstrel> The wiki's search bar doesn't have autocomplete. 20150810 17:51:56< aeth> it takes forever to find all the documentation, and the search is bad because there's so much on the wiki that's not documentation 20150810 17:51:57< celticminstrel> Okay. 20150810 17:52:16< aeth> search for some common word and you have to scroll through 2 pages of campaign walkthroughs 20150810 17:52:33< Ravana_> http://wiki.wesnoth.org/index.php?title=Template:WML_Tags 20150810 17:52:42< Ravana_> I just search this 20150810 17:52:49< Ravana_> ctrl+f 20150810 17:52:54< aeth> Ravana_: that works for the WML tags but nothing else you might want to search for 20150810 17:52:57< aeth> e.g. Lua 20150810 17:53:05< celticminstrel> Some WML tags are also missing from that, I think. 20150810 17:53:16< aeth> Lua has http://wiki.wesnoth.org/LuaWML but that afaik doesn't have everything 20150810 17:53:21< aeth> unless I'm misreading the source 20150810 17:53:44< celticminstrel> aeth: If you can, please add more Lua documentation to the wiki. 20150810 17:54:08< Ravana_> I don't know enough about lua to understand if that documentation is lacking, for my use it has been enough 20150810 17:54:26< Ravana_> though for lua I first look if EoHS has already done it... 20150810 17:55:40< aeth> celticminstrel: I can know something's in the source code without knowing what it actually does, Wesnoth's code is huge 20150810 17:56:56 * celticminstrel points at "If you can". 20150810 18:01:40< Ravana_> I think I did find one tag missing there, and I added it 20150810 18:02:25< Ravana_> yes, (Added vision_costs) 20150810 18:04:06< celticminstrel> Clicking the active selection in a listbox on Create Game doesn't update the description area. 20150810 18:11:37< celticminstrel> It'd be nicer to accept [menu_item] within [modification[, rather than adding them at prestart. 20150810 18:35:46-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150810 18:56:26-!- jimlei [~quassel@164.10.189.109.customer.cdi.no] has joined #wesnoth 20150810 19:07:57-!- patwotrik [~patwotrik@nl118-172-202.student.uu.se] has joined #wesnoth 20150810 19:08:32< celticminstrel> My menuitem isn't appearing. 20150810 19:16:36< celticminstrel> Oh, there it is. 20150810 19:17:51< celticminstrel> How can I show it only if the selected unit is yours? 20150810 19:19:13< celticminstrel> "If you really need to have more than 7 menu items, try combining some of them in a submenu." There doesn't seem to be a way to actually do that (barring a use of [message]). 20150810 19:19:32-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has joined #wesnoth 20150810 19:19:34< celticminstrel> (Those two are unrelated.) 20150810 19:22:34-!- claymore2 [~hexchat@host109-154-204-244.range109-154.btcentralplus.com] has quit [Quit: Leaving] 20150810 19:24:53< vultraz> celticminstrel: in 1.13, the limit is removed 20150810 19:25:16< celticminstrel> I know, but for this, making a submenu makes sense anyway. 20150810 19:27:10< celticminstrel> Can I use [lua] in [modification], or does it have to go in an event? 20150810 19:34:39< vultraz> I dunno 20150810 19:35:01-!- ancestral [~ancestral@75-161-229-81.mpls.qwest.net] has quit [Quit: i go nstuf kthxbai] 20150810 19:38:36-!- shadowm_desktop [ignacio@wesnoth/developer/shadowm] has joined #wesnoth 20150810 19:43:30< celticminstrel> Looks like I can't. 20150810 19:47:16< celticminstrel> So I have a unit and need to get a variable from it. 20150810 19:47:59< celticminstrel> I guess I need helper.child_range. 20150810 19:49:03< celticminstrel> Not quite sure if that's right. (It's an array variable.) 20150810 19:51:49-!- Elouin_ [~Elouin@p2003004544150200CA6000FFFED11D67.dip0.t-ipconnect.de] has joined #wesnoth 20150810 19:54:22< celticminstrel> So far it's not looking like that works. 20150810 19:57:29-!- Appleman1234 [~Appleman1@KD036009068098.au-net.ne.jp] has quit [Ping timeout: 250 seconds] 20150810 20:06:32< celticminstrel> It says it returns an iterator, but it seems like it doesn't work as one... 20150810 20:11:47-!- Smedles [~quassel@58.160.136.199] has joined #wesnoth 20150810 20:14:53< celticminstrel> Looks like it was a matter of how Lua iterators work. 20150810 20:23:55< aeth> Lua often requires odd idioms to get things to work. 20150810 20:24:06< aeth> Just slightly off, too. 20150810 20:24:29< celticminstrel> Well, the counting works, at least. However I can continue to add units above capacity, so something's still not right. 20150810 20:24:58< celticminstrel> Also, getting the name of the stored unit seems to not work. 20150810 20:25:17< aeth> it gets complicated 20150810 20:25:31< aeth> Perhaps try looking at my source code 20150810 20:25:37< celticminstrel> It's stored to variable=ship.variables.occupant, and I'm trying to reference it as $ship.variables.occupant[$ship.variables.occupant.length].name 20150810 20:25:58< aeth> no $ in Lua 20150810 20:26:05< celticminstrel> That's WML. 20150810 20:26:14< aeth> oh 20150810 20:26:45< aeth> It's WML? That looks so much like Lua 20150810 20:27:13< celticminstrel> I only showed the important bits. 20150810 20:27:25< aeth> Is there a .length? 20150810 20:27:39< celticminstrel> The variable= is in a [store_unit] and the $ stuff is in a text= in [unstore_unit]. 20150810 20:27:44< celticminstrel> I thought there was, let me check. 20150810 20:28:11< aeth> That would be the easy fix. 20150810 20:28:21< aeth> Otherwise the next guess would be it's off by one somehow 20150810 20:28:26< celticminstrel> http://wiki.wesnoth.org/VariablesWML#Variables 20150810 20:28:35< celticminstrel> ...ah. Yes, that would be why. Duh. 20150810 20:29:33< celticminstrel> Okay, works now. 20150810 20:29:54< celticminstrel> Next step is to get disembarkment working, then I can fix up all the filters so the menuitem doesn't appear when it shouldn't and such. 20150810 20:30:33< aeth> The filters are the most annoying part imo :-P 20150810 20:31:04< aeth> I think it's in part because filters fail silently, so write a bad filter and it doesn't complain. 20150810 20:31:27< celticminstrel> I want "Board" to only appear if the unit can still do something, ie it has not attacked on this turn. 20150810 20:31:39< aeth> hmm 20150810 20:31:42-!- Panda_ [~IMO@2a01:e35:8aae:fcb0:a6fd:e761:fbcd:cbc2] has joined #wesnoth 20150810 20:31:52< aeth> Definitely possible. 20150810 20:32:02< aeth> I think I used to do that. 20150810 20:33:30< aeth> I think it's just a line in the unit filter 20150810 20:33:56< celticminstrel> It's easier to test without that though. :P 20150810 20:34:28< celticminstrel> (Newly recruited units should also not be able to board.) 20150810 20:34:35< aeth> Yes, I might add that back in later, i.e. version 2.0 :P 20150810 20:34:53< aeth> I even have newly spawned units start with full MP atm 20150810 20:35:01< aeth> Just easier to deal with for now 20150810 20:35:24< celticminstrel> Oh, move points. 20150810 20:35:31< celticminstrel> For a moment I thought that meant magic points. 20150810 20:36:12< aeth> I would have to call it mana or something if I added it, for disambiguation 20150810 20:36:32< aeth> The problem with magic is, if I added it, why would you want to play as any other unit? 20150810 20:36:54< aeth> Sure maybe they won't e.g. get the good items, but they will get spells 20150810 20:38:33-!- ancestral [~ancestral@161.sub-70-197-192.myvzw.com] has joined #wesnoth 20150810 20:51:22-!- ancestral [~ancestral@161.sub-70-197-192.myvzw.com] has quit [Quit: Smell ya later!] 20150810 20:54:57-!- Appleman1234 [~Appleman1@KD036009090029.au-net.ne.jp] has joined #wesnoth 20150810 21:05:08< aeth> oh wow the filter thing is horrible 20150810 21:05:16< aeth> So I filter_location x = 5, y = 5 20150810 21:05:45< aeth> Then I T["filter_adjacent_location"] { T["filter"] { side = "$side_number" }} 20150810 21:05:55< aeth> everything's fine, it will only show up on 5,5 if there's something adjacent. 20150810 21:06:12< celticminstrel> All the elements are appearing on the same line. :( 20150810 21:06:34< aeth> But if I then add a ["filter"] { side = "$side_number" } to try to get it to also show up if something is on 5,5... 20150810 21:06:50< aeth> If I put it before the adjacent filter, then suddenly the menu shows up for anything adjacent to the unit that's adjacent 20150810 21:07:01< aeth> and if I put it after the adjacent filter, it shows up both for the adjacent unit and on 5,5 20150810 21:07:56< aeth> (In an or tag, obviously) 20150810 21:09:09< aeth> filter WML is just unreadable guess-and-check garabage as soon as more than one thing is being filtered. 20150810 21:10:13< aeth> It would be great if [or] could go outside of [filter_location] i.e. [or] [filter_location] foo [/filter_location] [filter_location] foo [/filter_location] [/or] 20150810 21:10:24< aeth> Then at least I could combine two simple filters that both work individually in a predictable way. 20150810 21:10:54< celticminstrel> Um... it can, can't it? 20150810 21:11:04< celticminstrel> SUF and SLF both support [or]. 20150810 21:11:25< aeth> [or] does not work in a sane way 20150810 21:11:32< aeth> [or] works *inside* SUF and SLF 20150810 21:11:47< aeth> and it's foo [or] bar [/or] [or] baz [/or] 20150810 21:13:05< aeth> I can compose two things that work perfectly fine if individual in a [filter_location] that combined in an or statement behave together unpredictably 20150810 21:14:08< aeth> T["filter_location"] x = 5, y = 5, T["filter"] { side = "$side_number" } } -- right click menu shows up if there's a unit of your side on 5,5; only on 5,5 20150810 21:14:56< aeth> T["filter_location"] x = 5, y = 5, T["filter_adjacent_location"] { T["filter"] { side = "$side_number" }}} -- right click menu shows up if there's a unit of your side next to 5,5; only on 5,5 20150810 21:15:36< aeth> Now I try to combine this with an [or] and the ordering of the two produces different results, neither what I want (a menu only on 5,5) 20150810 21:16:28< aeth> If I put the simple filter first then the menu appears on every adjacent location to the adjacent unit. If I put the adjacent filter first, the menu appears both on 5,5 and on the adjacent unit. 20150810 21:17:48< celticminstrel> If your Pango markup is invalid, your text is replaced with an error message. I'd say that's kind of stupid. 20150810 21:18:04< aeth> This is a [set_menu_item]. What I'd like to do is [or] [filter_location] [/filter_location] [filter_location] [/filter_location] [show_if] [/show_if] [/or] 20150810 21:18:18< aeth> Because I have three small filters that all should trigger a menu item, and are all very different. 20150810 21:19:15< celticminstrel> Oh. 20150810 21:19:47< aeth> I guess I'll try to define three separate menu items with the same ID and hope it works properly 20150810 21:19:57< aeth> The same ID and same action 20150810 21:21:42< celticminstrel> What stats should I show for units on a ship? 20150810 21:21:50< celticminstrel> Currently I have HP, XP, level, race. 20150810 21:26:10< aeth> and of course they can't all have the same ID because that would be too easy of a way to work around the worst conditional system I have ever used in my life in any programming language 20150810 21:28:53< aeth> So now I have two [filter_location]s that cannot be combined without making the menu item show up somewhere else, and a third filter that's [show_if] that cannot be combined because [set_menu_item] I think assumes an and instead of an or for filters 20150810 21:30:02< celticminstrel> Maybe you can get the [filter_location] inside the [show_if[ somehow. 20150810 21:30:18< celticminstrel> Like with [have_location] or something. 20150810 21:30:30< aeth> possibly 20150810 21:31:07< celticminstrel> I guess you have no opinion on my question? 20150810 21:31:51< aeth> too busy trying to get one of the simplest and least important parts of my program ([set_menu_item]) to work 20150810 21:32:25< aeth> celticminstrel: If I put it inside of a [show_if] [have_location] [/have_location] [/show_if] it shows up *everywhere* if have_location evaluates to true 20150810 21:33:00-!- Panda_ [~IMO@2a01:e35:8aae:fcb0:a6fd:e761:fbcd:cbc2] has quit [Remote host closed the connection] 20150810 21:34:18< celticminstrel> Oh. 20150810 21:36:03< celticminstrel> Well then, I'll work on disembark. 20150810 21:36:53< aeth> T["filter_location"] { x = 5, y = 5, T["filter"] { side = "$side_number" }} should be equivalent to... 20150810 21:37:17< aeth> T["show_if"] { side = "$side_number", T["filter_location"] { x = 5, y = 5 }} 20150810 21:37:18< aeth> afaik 20150810 21:37:20< aeth> but it's not 20150810 21:37:34< aeth> The latter apparently just makes the menu item show up everywhere. 20150810 21:38:43< aeth> but I guess x = 5, y = 5 works, but then that only works in my trivial example and does not let me use a fancier location filter 20150810 21:39:33< aeth> oh wait, have_unit 20150810 21:40:34< aeth> hmm, nope, if I do this: T["show_if"] { T["have_unit"] { side = "$side_number", T["filter_location"] { x = 5, y = 5 }}} 20150810 21:40:45< aeth> then it will show up everywhere when it evaluates to true 20150810 21:42:31< celticminstrel> Is there any easy way in WML to delete element 0 of an array and move the rest down? 20150810 21:42:49< celticminstrel> Or any arbitrary element, for that matter. 20150810 21:43:02< aeth> Easy? WML? 20150810 21:43:03< shadowm> {CLEAR_VARIABLE array[0]} 20150810 21:43:20< celticminstrel> Does that automatically shift the rest down, then? 20150810 21:44:29< shadowm> Yes. 20150810 21:44:59< celticminstrel> Excellent! 20150810 21:47:10< aeth> In case you're wondering how I finally fixed it: T["show_if"] { T["have_unit"] { side = "$side_number", x = "$x1", y = "$y1", T["filter_location"] { x = 5, y = 5 }}} 20150810 21:47:18< celticminstrel> ...is it bad or good to have variable substitutions in translateable strings? 20150810 21:47:39< shadowm> It can be bad, it can be good. 20150810 21:48:44< shadowm> There's a fair number of engine (!) strings that are translatable and use variable substitutions. Generally you want to structure them in such a way the translator won't have much difficulty with understanding how to rearrange the text if needed. 20150810 21:49:59< celticminstrel> So, the translation lookup will occur before the variable substitution, then? 20150810 21:50:30< shadowm> There are still a few languages which will encounter difficulties with localizing variable substitutions in a correct and natural-sounding fashion regardless, so if there is a reasonable way you can avoid variable substitutions without making the code unnecessarily large or unmaintainable, you should prefer that. 20150810 21:51:03< shadowm> Yes, which means translators may also remove or rearrange variables from the substitution. 20150810 21:51:42< shadowm> e.g. "$name|'s Bridge" (en) -> "Puente de $name" (es) 20150810 21:52:13< shadowm> What you absolutely must not use in translatable strings is macro or file substitutions. 20150810 21:52:29< celticminstrel> [clear_variable]name=thing,stuff,array[0][/clear_variable] did not work. 20150810 21:52:36< shadowm> You also want to avoid concatenating multiple translatable strings. 20150810 21:52:42< celticminstrel> That is to say, the array still has its first element. 20150810 21:53:05< shadowm> The second element becomes the first. 20150810 21:53:07< celticminstrel> Don't all the built-in unit types concatenate translateable strings? 20150810 21:53:17< celticminstrel> No, I mean, it still has the same element there. 20150810 21:53:23< shadowm> Yes, but they do so in a block-wise fashion. 20150810 21:53:40< shadowm> That's not as problematic as if you did char or word-wise concatentation. 20150810 21:53:45< celticminstrel> Ah, right, of course. 20150810 21:54:30< shadowm> I can't say anything to that [clear_variable] issue other that you did something wrong. :p 20150810 21:56:34-!- ancestral [~ancestral@161.sub-70-197-192.myvzw.com] has joined #wesnoth 20150810 21:56:54< celticminstrel> I don't see what could be wrong. :| 20150810 21:58:50 * celticminstrel can show code if someone feels like looking. 20150810 21:59:21< shadowm> Sure. 20150810 22:00:21< celticminstrel> http://pastebin.com/rgY9d5p2 20150810 22:00:43< celticminstrel> (It's in a [command] in [set_menu_item], if that's relevant.) 20150810 22:01:30< shadowm> Does the ship get stored again before it gets unstored? 20150810 22:01:41-!- ancestral [~ancestral@161.sub-70-197-192.myvzw.com] has quit [Quit: Smell ya later!] 20150810 22:01:47< celticminstrel> Ah. 20150810 22:01:51< celticminstrel> That would make sense. 20150810 22:02:07< aeth> aaaaaaaand... I almost have the filter thing working, more than one hour later 20150810 22:02:25< aeth> There has to be some easier API than [set_menu_item] 20150810 22:02:49< shadowm> I.e. the action in line 35 has no net effect if the ship gets re-stored before it gets committed with the new state of ship.variables.ocuppant.. 20150810 22:02:54< shadowm> *occupant. 20150810 22:04:43< aeth> This is way harder than it looks: https://github.com/Aethaeryn/wesnoth-umc/blob/05c9af2a0cc1f4635eb67d252130b05c43a34d0e/Aethaeryns_Mod/lua/filter.lua#L40 20150810 22:09:07< celticminstrel> Okay, it works now. 20150810 22:09:17-!- jemadux [~jemadux@unaffiliated/jemadux] has quit [Remote host closed the connection] 20150810 22:09:18< celticminstrel> Next would be to let you choose which unit disembarks... 20150810 22:18:27< aeth> FINALLY it works 20150810 22:18:44< aeth> celticminstrel: do you still need some help? 20150810 22:23:20< celticminstrel> Not sure. 20150810 22:48:23< celticminstrel> ...I'm guessing there's no way to interface with the recall list dialog in Lua... 20150810 22:49:48-!- RodiX [uid5578@gateway/web/irccloud.com/x-onzbstyvtyzqgtdj] has joined #wesnoth 20150810 22:53:55-!- wario [~wario_@unaffiliated/wario] has quit [Quit: Leaving] 20150810 22:54:02-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 260 seconds] 20150810 22:56:03< Ravana_> [heals] cumulative=yes doesn't seem to work 20150810 23:01:18< Ravana_> seems I have done false advertisement for last few months 20150810 23:01:26< Ravana_> isn't cumluative currently 20150810 23:04:35-!- Appleman1234 [~Appleman1@KD036009090029.au-net.ne.jp] has quit [Ping timeout: 265 seconds] 20150810 23:05:03< Ravana_> no matter, 6 different abilities with different value and [affect_adjacent][filter] might be even better way 20150810 23:17:34-!- Haudegen [~quassel@85.124.51.57] has quit [Ping timeout: 250 seconds] 20150810 23:20:26< aeth> Do abilities require download in MP? 20150810 23:20:30< aeth> Or is it just units that do? 20150810 23:21:02< Ravana_> unit_types do 20150810 23:21:03< celticminstrel> There shouldn't be any reason for abilities to require download. 20150810 23:21:22< celticminstrel> Because abilities are defined by macros. 20150810 23:21:35< celticminstrel> The entire code of the ability appears anywhere the ability is used. 20150810 23:21:49< Ravana_> abilities are defined by code more generally, no need for it to be macro 20150810 23:22:29< Ravana_> but you can dynamically create abilities during game, so there is also no need to require downloads for that 20150810 23:23:29< celticminstrel> Yes, I realize it's not necessary for it to be a macro. 20150810 23:24:41< aeth> ENABLE_ANCIENT_LICH, ENABLE_DEATH_KNIGHT, etc., are all done during extra_defines in [campaign] 20150810 23:24:53< aeth> Is there another way to run this or do I essentially have to reinvent the wheel to do this? 20150810 23:25:20< aeth> The most important one is actually ENABLE_WOLF_ADVANCEMENT, it's kind of sad that that has to be done 20150810 23:25:20< celticminstrel> Well, you could manually adjust advances_to in certain events... 20150810 23:25:24-!- Elouin_ [~Elouin@p2003004544150200CA6000FFFED11D67.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 20150810 23:25:28< aeth> yes, that's reinventing the wheel 20150810 23:25:54< aeth> The problem is if e.g. mainline changes the xp level I will have to check for that stuff, or will run out of sync with mainline 20150810 23:26:00< celticminstrel> I don't know of another way. 20150810 23:26:36< Ravana_> most actions in synced events will not cause oos 20150810 23:26:40-!- Haudegen [~quassel@85.124.51.57] has joined #wesnoth 20150810 23:27:10< Ravana_> if your event decides certain xp is good then whatever mainline has is not used 20150810 23:27:26< celticminstrel> How can I alter a WML table in Lua? 20150810 23:27:56< aeth> There's a million ways to do it. 20150810 23:28:10< aeth> The main thing to keep in mind is that you need to get access to it somehow 20150810 23:28:34< celticminstrel> Basically I want to do table.insert, but have a WML table rather than a Lua table. 20150810 23:28:36< aeth> When all else fails you can store it with [literal] into a variable e.g. that's what I do to read in a macro 20150810 23:28:58< aeth> celticminstrel: what kind of table? 20150810 23:29:12< aeth> WML is many different things in many different contexts 20150810 23:29:27< celticminstrel> table.insert(cfg, ...) 20150810 23:29:41< celticminstrel> "bad argument #1 to 'insert' (table expected, got userdata)" 20150810 23:29:50< aeth> yes, it's not a table, it's userdata 20150810 23:29:58< celticminstrel> Exactly, so how do I do that. 20150810 23:30:15< Ravana_> what userdata IS in lua? I have got similar messages before 20150810 23:30:24< aeth> celticminstrel: it depends on the context 20150810 23:30:37< celticminstrel> Ravana_: I think it basically means "any type defined by Wesnoth". 20150810 23:30:38< aeth> celticminstrel: There are a million ways to do it and the easiest way depends on the exact context. 20150810 23:30:51< aeth> Ravana_: userdata = C or C++ data structure instead of Lua data structure 20150810 23:30:57< aeth> Ravana_: It can only do what you're allowed to do to it 20150810 23:31:49< aeth> celticminstrel: e.g. in some contexts it's probably easier to just literally define the WML in Lua rather than modify WML 20150810 23:32:39< celticminstrel> Eh, sure, I suppose I can do it that way. 20150810 23:33:05< aeth> You just do T.foo { } or T["foo"] { } and it's not that different from WML 20150810 23:33:25< celticminstrel> I don't understand that syntax. 20150810 23:33:33< celticminstrel> I mean, I know what it means. 20150810 23:33:40< celticminstrel> Or wait. 20150810 23:33:42< aeth> T.foo { } is [foo] [/foo] 20150810 23:33:45< celticminstrel> No, I don't get it. 20150810 23:33:54< celticminstrel> First of all, what's T? 20150810 23:33:58< aeth> T.foo { T.bar { } } is [foo] [bar] [/bar] [/foo] 20150810 23:34:19< celticminstrel> Second of all, I feel like there should be an = but there isn't. 20150810 23:34:23< aeth> http://wiki.wesnoth.org/LuaWML#Skeleton_of_a_preload_event 20150810 23:34:40< celticminstrel> Ah, okay. 20150810 23:35:02< aeth> First thing about Lua, the ()s are optional, usually meaning that you can use {}s instead of ()s for functions or whatever with just one argument. 20150810 23:35:12< aeth> So I'm guessing T.foo{} is really T.foo({}) 20150810 23:35:31< celticminstrel> Yes, I was aware of that much. 20150810 23:35:41< aeth> That's why there's no need for an equal 20150810 23:35:48-!- Haudegen [~quassel@85.124.51.57] has quit [Ping timeout: 246 seconds] 20150810 23:36:00< aeth> You only need equals when you're doing e.g. T.foo { x = 1, y = 2, T.bar { ... } } 20150810 23:36:19< aeth> That's because WML is two parts, it's either key/value or it's subtags 20150810 23:36:28< aeth> So each part has to have different syntax 20150810 23:36:40< aeth> You can't say bar = {} because you can have more than one bar 20150810 23:37:05< aeth> e.g. T.event { name = preload, first_time_only = no, T.lua { code = ... }, T.lua { code = ... } } 20150810 23:37:20< celticminstrel> ...why would you even do that. 20150810 23:37:22< aeth> (obviously you can't do that particular WML in Lua) 20150810 23:37:46< aeth> That's just the only syntax example off of the top of my head where there's lots of [bar] in one [foo], in this case lots of [lua] in [event] 20150810 23:38:07< aeth> You would want to do this (obviously not in Lua) because you can then make each code = a macro call that stores the Lua as strings 20150810 23:38:29< aeth> [lua] code = {SOME_LUA} [/lua] [lua] code = {SOME_MORE_LUA} [/lua] 20150810 23:38:44< aeth> And those macros would begin and end with <>s but otherwise be regular lua (probably in .lua files) 20150810 23:38:55< celticminstrel> ...set_wml_tag_metatable() seems to have caused an error. :( 20150810 23:38:55< aeth> And that's why WML can't map to Lua tables. Tables have to have unique keys. 20150810 23:39:13< aeth> celticminstrel: did you require lua/helper.lua first? 20150810 23:39:26< aeth> helper.lua is the library, I'm not sure why it's separate, a lot of stuff is either wesnoth. or helper. 20150810 23:39:40< aeth> I'm guessing helper is written in Lua and wesnoth is just the API 20150810 23:40:08< shadowm> No, it's written in Python. :p 20150810 23:40:11< celticminstrel> The error is something about setmetatable (table expected, got nil). 20150810 23:40:16< celticminstrel> And yes it's written in Lua. 20150810 23:40:19< aeth> shadowm: who knows 20150810 23:40:49< aeth> shadowm: you could write libraries to Lua code in Python if you find a way to get both Python and Lua to talk to each other through their intermediate talking to C 20150810 23:41:05< aeth> Why you'd want to do that, idk 20150810 23:41:14< shadowm> I thought my joke was bad. 20150810 23:41:18< celticminstrel> According to the source, it needs an argument. 20150810 23:41:30< celticminstrel> Why does the example you linked not have that? 20150810 23:41:48< aeth> helper = wesnoth.require "lua/helper.lua" 20150810 23:41:50< aeth> T = helper.set_wml_tag_metatable {} 20150810 23:41:54< aeth> That's what I use in my source. 20150810 23:42:02< aeth> Also, the code examples on the wiki are pretty bad 20150810 23:42:08< celticminstrel> Ohh, {} instead of (). Subtle. 20150810 23:42:34< aeth> The only way to know that something works for sure is to look at the code of a working add-on 20150810 23:42:44< celticminstrel> Or try it. :P 20150810 23:42:46< aeth> The wiki might be out of date or contain some other error or bad style 20150810 23:43:02< aeth> celticminstrel: well yes but if you try it it suddenly becomes part of a working add-on :-p 20150810 23:43:11< celticminstrel> XD True. 20150810 23:43:23< celticminstrel> Sometimes units get weirdly ridiculously long names. 20150810 23:43:30< aeth> My point is, you can't automatically trust the wiki because not everyone is going to update the wiki right away as they patch the engine. 20150810 23:43:34< celticminstrel> Aethareoddry 20150810 23:43:41< celticminstrel> ^ one that I just got 20150810 23:43:48< aeth> tell me if you get any named Aethaeryn 20150810 23:43:54< celticminstrel> Heh. 20150810 23:44:42< aeth> oh, also the way that the wiki will tell you to write your Lua isn't MP safe, the way I do it (each .lua file is really a macro) is MP safe. 20150810 23:45:00< aeth> well, it's MP safe, but reuqires download 20150810 23:45:01< aeth> wrong issue 20150810 23:45:25< celticminstrel> The way I'm doing it currently requires download. 20150810 23:45:34< aeth> Unless you're using custom units you should try to adjust your code. 20150810 23:45:46< aeth> It's really hard to organize games that require download 20150810 23:45:48< celticminstrel> Does >> exist as a Lua operator? 20150810 23:46:04< aeth> No (afaik) 20150810 23:46:10< aeth> You use << >> to wrap your Lua 20150810 23:46:12< celticminstrel> No bitshifts, then? 20150810 23:46:17< celticminstrel> Yes, I'm aware. 20150810 23:46:44< aeth> You can do this: #defmacro FOO\n<<\nblah()\n>>\n#enddef 20150810 23:46:49< celticminstrel> Currently it's wrapping a dofile call, but I don't know of any reason to not macron-include the Lua instead. 20150810 23:47:00< aeth> Just macro-include it 20150810 23:47:22< celticminstrel> I just did it the same way as in my campaign. 20150810 23:47:37< aeth> If you do anything non-trivial in [lua] you probably want to put it in a separate .lua as a macro so you can use syntax highlighting at the very least 20150810 23:48:08< aeth> e.g. https://github.com/Aethaeryn/wesnoth-umc/blob/master/Aethaeryns_Mod/lua/terrain_editor.lua 20150810 23:48:11< celticminstrel> Yes, putting it in .lua is important for the syntax highlighting. 20150810 23:48:28< aeth> You also want Github (or whatever other source control) you wind up using to recognize it as whatever language it is 20150810 23:48:46< aeth> Those sites tend to be stupid and just go off of the extension (only really caring if the extension conflicts between multiple languages) 20150810 23:49:00< celticminstrel> I just got a fencer named "Add". 20150810 23:49:07< aeth> I got Add the other day 20150810 23:49:20< aeth> I wonder if short names are more likely to collide 20150810 23:49:46< celticminstrel> There's probably no unit portrait for the ship, right... 20150810 23:50:04< aeth> No. 20150810 23:50:20< aeth> Most units don't have portraits if they're not in the Default six. 20150810 23:50:26< aeth> There's not even a fire dragon portrait. 20150810 23:50:37< aeth> There's only one Khalifate portrait. 20150810 23:51:08< Ravana_> Aethaennyn is closest I can find in the game I currently observe 20150810 23:51:41< aeth> I think it does random variations on the name, rather than just taking names from the file 20150810 23:51:51< aeth> Aethaeryn is actually in the name file itself, so it might be very unlikely 20150810 23:52:14< celticminstrel> It uses the names in the file to power a Markov chain generator, I believe. 20150810 23:52:35< shadowm> Correct. 20150810 23:52:41< Ravana_> yes, means if one name gets contaminated it breaks many names 20150810 23:53:05< celticminstrel> Contaminated? 20150810 23:53:27< Ravana_> > primeval names have got corrupted with AE_ AE_artarc_kh - hopefully fixed 20150810 23:53:37< celticminstrel> ? 20150810 23:53:58< Ravana_> replace all affected one entry in names 20150810 23:54:17-!- Haudegen [~quassel@85.124.51.57] has joined #wesnoth 20150810 23:54:22< celticminstrel> I'm not sure what you're saying. 20150810 23:55:01< aeth> celticminstrel: I'm guessing that Ravana_ means that something got in the name list that's unlike the others in style 20150810 23:55:09< aeth> so if you have @#$@ as a name it will mess up a lot of names 20150810 23:56:07< Ravana_> yes 20150810 23:59:38< celticminstrel> The TC didn't work. --- Log closed Tue Aug 11 00:00:45 2015