--- Log opened Fri Mar 15 00:00:00 2013 20130315 00:04:17-!- ancestral [~ancestral@75-168-48-55.mpls.qwest.net] has joined #wesnoth-umc-dev 20130315 00:04:17-!- ancestral [~ancestral@75-168-48-55.mpls.qwest.net] has quit [Client Quit] 20130315 00:33:57-!- trewe [~trewe@87-196-222-246.net.novis.pt] has quit [Quit: Quit] 20130315 01:11:18-!- irker761 [~irker@ai0867.net] has joined #wesnoth-umc-dev 20130315 01:11:18< irker761> wesnoth-umc-dev: shikadilord * r17594 /trunk/After_the_Storm/episode2/scenarios/03_01_Unrest_in_Raelthyn.cfg: 20130315 01:11:19< irker761> wesnoth-umc-dev: AtS E2S3.1: fix side 1 units facing the wrong direction at the beginning 20130315 01:42:09-!- loonybot [~loonybot@wesnoth/bot/loonybot] has quit [Remote host closed the connection] 20130315 02:19:59-!- un214 [~un214@2602:304:37b8:de69:224:8cff:fed2:ef57] has joined #wesnoth-umc-dev 20130315 02:20:22< un214> what would it take to keep people from uploading addons that depend on case insensitive filesystem? 20130315 02:21:49< Espreon> A lot. 20130315 02:22:27-!- Octalot [~noct@host86-147-144-75.range86-147.btcentralplus.com] has quit [Remote host closed the connection] 20130315 02:25:36< un214> one outrageous possability is to open all files with FILE_FLAG_POSIX_SEMANTICS or check the actual file case even on Windows 20130315 02:29:21< shadowm> Patches welcome. 20130315 02:29:48< un214> I /said/ outrageous for a reason. It's a terrible idea. 20130315 02:32:10< shadowm> Patches are still welcome given a better idea. 20130315 02:41:13< irker761> wesnoth-umc-dev: vultraz * r17595 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 02:41:14< irker761> wesnoth-umc-dev: NX E1S1: little tweaks to starting cutscene 20130315 02:42:10< irker761> wesnoth-umc-dev: vultraz * r17596 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 02:42:10< irker761> wesnoth-umc-dev: NX E1S1: removed condition that can only ever be false 20130315 02:51:13< irker761> wesnoth-umc-dev: vultraz * r17597 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 02:51:14< irker761> wesnoth-umc-dev: NX E1S1: got rid of some extraneous dialog in the encounter with Yerar 20130315 03:06:34-!- un214 [~un214@2602:304:37b8:de69:224:8cff:fed2:ef57] has quit [Read error: Connection reset by peer] 20130315 03:35:00< irker761> wesnoth-umc-dev: shikadilord * r17598 /trunk/After_the_Storm/episode2/scenarios/03_02_Revelations.cfg: 20130315 03:35:01< irker761> wesnoth-umc-dev: AtS E2S3.2: minor dialogue line revisions from myself and the ad-hoc prose team 20130315 03:35:39< irker761> wesnoth-umc-dev: shikadilord * r17599 /trunk/After_the_Storm/episode2/scenarios/04_Shifting_Allegiances.cfg: 20130315 03:35:39< irker761> wesnoth-umc-dev: AtS E2S4: move Anya without her turning her back on Elynia during the initial cutscene 20130315 03:35:54< irker761> wesnoth-umc-dev: shikadilord * r17600 /trunk/After_the_Storm/episode2/scenarios/04_Shifting_Allegiances.cfg: 20130315 03:35:54< irker761> wesnoth-umc-dev: AtS E2S4: use LOCK_VIEW during the initial cutscene, and scroll to units as necessary 20130315 03:38:06< irker761> wesnoth-umc-dev: vultraz * r17601 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 03:38:06< irker761> wesnoth-umc-dev: NX E1S1: small dialog change from 8680 20130315 03:39:43< irker761> wesnoth-umc-dev: vultraz * r17602 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 03:39:44< irker761> wesnoth-umc-dev: NX E1S1: removed health potion after use. The event still needs refactoring 20130315 03:57:18< irker761> wesnoth-umc-dev: vultraz * r17603 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 03:57:19< irker761> wesnoth-umc-dev: NX E1S1: fixed/improved the skeleton flee event 20130315 04:31:47< irker761> wesnoth-umc-dev: vultraz * r17604 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 04:31:47< irker761> wesnoth-umc-dev: NX E1S1: all starting enemy units (save the Giant Rat) are supposed to be guardians 20130315 04:38:57< irker761> wesnoth-umc-dev: vultraz * r17605 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 04:38:57< irker761> wesnoth-umc-dev: NX E1S1: reduced enemy starting gold. Again. 20130315 04:50:52< irker761> wesnoth-umc-dev: vultraz * r17606 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 04:50:53< irker761> wesnoth-umc-dev: NX: replaced item fleeing skeleton drops with a regen amulet instead of a health potion 20130315 04:55:22< irker761> wesnoth-umc-dev: vultraz * r17607 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 04:55:22< irker761> wesnoth-umc-dev: NX E1S1: fixed broken imagepath and description for the amulet 20130315 05:03:32< irker761> wesnoth-umc-dev: vultraz * r17608 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 05:03:32< irker761> wesnoth-umc-dev: NX E1S1: used macro definition of the regen ability 20130315 05:06:57< irker761> wesnoth-umc-dev: vultraz * r17609 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 05:06:58< irker761> wesnoth-umc-dev: NX E1S1: removed invalid defeat condition 20130315 05:22:32< irker761> wesnoth-umc-dev: vultraz * r17610 /trunk/NX-RPG/lua/gui/transient_message.lua: 20130315 05:22:32< irker761> wesnoth-umc-dev: NX: corrected error in function name causing [transient_message] to be invalid 20130315 05:25:03< irker761> wesnoth-umc-dev: vultraz * r17611 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 05:25:03< irker761> wesnoth-umc-dev: NX E1S1: fixed wrong unit saying Revekal's attack line 20130315 05:27:10< irker761> wesnoth-umc-dev: vultraz * r17612 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 05:27:10< irker761> wesnoth-umc-dev: NX E1S1: allowed only side 1 unit to pick up the key 20130315 05:34:30-!- mattsc [~mattsc@d154-20-34-165.bchsia.telus.net] has quit [Quit: bye] 20130315 05:34:46< vultraz> shikadibot: !log 17533 20130315 05:35:13< irker761> wesnoth-umc-dev: vultraz * r17613 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 05:35:14< irker761> wesnoth-umc-dev: E1S1: fixed an imagepath 20130315 05:39:05< vultraz> shikadibot: log 17533 20130315 05:39:08<+shikadibot> vultraz: Revision 17533 (shikadilord) on Tue Mar 12 08:23:33 2013: 20130315 05:39:12<+shikadibot> vultraz: AtS E1S11.2: fix spurious "retrieving member of non-existent WML container" warning on victory 20130315 05:39:12< irker761> wesnoth-umc-dev: vultraz * r17614 /trunk/NX-RPG/lua/NX-RPG.lua: 20130315 05:39:12< irker761> wesnoth-umc-dev: NX: fixed typo in color code 20130315 05:39:15<+shikadibot> vultraz: 20130315 05:39:18<+shikadibot> vultraz: The warning in question: 20130315 05:39:20<+shikadibot> vultraz: (+23 discarded lines) 20130315 05:39:22<+shikadibot> vultraz: Web interface URL: http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev?view=rev&revision=17533 20130315 05:44:56< irker761> wesnoth-umc-dev: vultraz * r17615 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 05:44:57< irker761> wesnoth-umc-dev: NX E1S1: removed all 'turns run out' defeat conditions, since we have unlimited turns. I'm an idiot. 20130315 06:59:24-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20130315 06:59:48< irker761> wesnoth-umc-dev: vultraz * r17616 /trunk/NX-RPG/ (lua/gui/character_development.lua macros/mana_sys.cfg): 20130315 06:59:48< irker761> wesnoth-umc-dev: NX: fixed some variables being substituted wrong 20130315 07:03:00< irker761> wesnoth-umc-dev: vultraz * r17617 /trunk/NX-RPG/rpg_systems/base_rpg_utils.cfg: 20130315 07:03:00< irker761> wesnoth-umc-dev: NX: don't initiate arrays for characters that won't be used 20130315 07:12:58< irker761> wesnoth-umc-dev: vultraz * r17618 /trunk/NX-RPG/macros/unit_deaths.cfg: 20130315 07:12:59< irker761> wesnoth-umc-dev: NX: don't have death messages for units that won't be used 20130315 07:34:55< irker761> wesnoth-umc-dev: vultraz * r17619 /trunk/NX-RPG/macros/unit_deaths.cfg: 20130315 07:34:56< irker761> wesnoth-umc-dev: NX: removed death messages from the A death macro for units that won't be used unto B deaths 20130315 07:38:59< irker761> wesnoth-umc-dev: vultraz * r17620 /trunk/NX-RPG/macros/unit_deaths.cfg: 20130315 07:39:00< irker761> wesnoth-umc-dev: NX: removed some useless variables 20130315 07:41:09< irker761> wesnoth-umc-dev: vultraz * r17621 /trunk/NX-RPG/macros/unit_deaths.cfg: 20130315 07:41:10< irker761> wesnoth-umc-dev: NX: accidentally deleted the 3rd arg of a macro in r17619 20130315 07:47:58< vultraz> shikadibot: log 17620 20130315 07:48:01<+shikadibot> vultraz: Revision 17620 (vultraz) on Fri Mar 15 06:38:45 2013: 20130315 07:48:02<+shikadibot> vultraz: NX: removed some useless variables 20130315 07:48:02<+shikadibot> vultraz: Web interface URL: http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev?view=rev&revision=17620 20130315 07:51:02< irker761> wesnoth-umc-dev: vultraz * r17622 /trunk/NX-RPG/macros/unit_deaths.cfg: 20130315 07:51:03< irker761> wesnoth-umc-dev: NX: apparently, unstoring the victim variable in necessary 20130315 07:53:33< irker761> wesnoth-umc-dev: vultraz * r17623 /trunk/NX-RPG/episode1/scenarios/01_Awakening_part_1.cfg: 20130315 07:53:36< irker761> wesnoth-umc-dev: NX E1S1: added a period 20130315 09:19:26-!- noy [~Noy@wesnoth/developer/noy] has quit [Read error: No route to host] 20130315 09:49:06-!- shadowm_desktop [ignacio@wesnoth/developer/shadowmaster] has quit [] 20130315 11:54:48< irker761> wesnoth-umc-dev: shikadilord * r17624 /trunk/After_the_Storm/ (5 files in 3 dirs): 20130315 11:54:49< irker761> wesnoth-umc-dev: AtS: remove ABILITY_GLAMOUR and SPECIAL_NOTES_GLAMOUR macros 20130315 11:54:49< irker761> wesnoth-umc-dev: The plan to use these was aborted for the sake of pacing and reducing 20130315 11:54:50< irker761> wesnoth-umc-dev: production costs, so they no longer serve any purpose other than 20130315 11:54:50< irker761> wesnoth-umc-dev: wasting two preprocessor symbol table entries. 20130315 12:43:51-!- Blueblaze [~Blueblaze@adsl-99-158-47-208.dsl.hstntx.sbcglobal.net] has quit [Quit: Blueblaze] 20130315 13:27:05-!- loonybot [~loonybot@wesnoth/bot/loonybot] has joined #wesnoth-umc-dev 20130315 13:27:08-!- mode/#wesnoth-umc-dev [+v loonybot] by ChanServ 20130315 13:30:55< irker761> wesnoth-umc-dev: shikadilord * r17625 /trunk/After_the_Storm/episode3/scenarios/05_Pass_of_Sorrows.cfg: 20130315 13:30:56< irker761> wesnoth-umc-dev: AtS E3S5: remove trailing blank 20130315 14:07:57-!- trewe [~trewe@87-196-197-35.net.novis.pt] has joined #wesnoth-umc-dev 20130315 14:18:36-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20130315 15:06:48-!- trewe [~trewe@87-196-197-35.net.novis.pt] has quit [Quit: Quit] 20130315 15:35:10-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20130315 16:31:16-!- irker761 [~irker@ai0867.net] has quit [Quit: transmission timeout] 20130315 16:34:44-!- mattsc [~mattsc@d154-20-34-165.bchsia.telus.net] has joined #wesnoth-umc-dev 20130315 16:39:32-!- skyfaller [~skyfaller@c-75-67-154-18.hsd1.ma.comcast.net] has joined #wesnoth-umc-dev 20130315 16:39:32-!- skyfaller [~skyfaller@c-75-67-154-18.hsd1.ma.comcast.net] has quit [Changing host] 20130315 16:39:32-!- skyfaller [~skyfaller@wikipedia/Skyfaller] has joined #wesnoth-umc-dev 20130315 16:43:55< vultraz> oh hey mattsc 20130315 16:43:56< vultraz> around? 20130315 16:46:00< mattsc> Hi vultraz. On and off. 20130315 16:46:48< mattsc> What's up? 20130315 16:46:49< vultraz> would you happen to know how to properly write a variable to a unit's [variables] node and get it written in WML via lua? 20130315 16:47:56< mattsc> Not off the top of my head. I assume that you tried and it's not just writeable? 20130315 16:48:20< vultraz> I don't even know how to start 20130315 16:48:41< vultraz> whether you need get_unit and put_unit 20130315 16:48:56< vultraz> or set_variable... 20130315 16:49:04< mattsc> Oh, I see. So, the wiki says this: 20130315 16:49:13< mattsc> "variables: proxy associative table (read only, read/write fields, including variables.__cfg), only toplevel named fields are proxied" 20130315 16:49:35< mattsc> That's from here: http://wiki.wesnoth.org/LuaWML:Units 20130315 16:49:55< vultraz> I read that and I have no idea what it means 20130315 16:50:15< mattsc> It means that you should be able to write to the variables field of the units. 20130315 16:50:22< mattsc> Give me a sec, I'll try something. 20130315 16:51:48< vultraz> see, shadowm told me I should be storing variables related to a unit specifically in its [variables] node and not an array named after its id 20130315 16:52:43< mattsc> Well, that makes sense. I just don't remember if I have ever done that in lua or not (I've done it using WML) 20130315 16:53:42< vultraz> yeah, in WML I could just do [store_unit] 20130315 16:53:59< mattsc> Oh, I have. It's a simple as: 20130315 16:54:00< mattsc> unit.variables.goal_x, unit.variables.goal_y = locs[rand][1], locs[rand][2] 20130315 16:54:41< vultraz> and unit is acquired how? 20130315 16:54:53< vultraz> that's that part that confuses me 20130315 16:55:17< mattsc> You use wesnoth.get_unit() or wesnoth.get_units() for that 20130315 16:55:29< vultraz> and do you need put_unit afterwords? 20130315 16:55:35< vultraz> afterwards* 20130315 16:55:38< mattsc> The first gives you a singe unit (if you know the coordinates), the later an array of units. 20130315 16:55:57< mattsc> No, the unit gets modified directly (if the fields is writeable, which variables is) 20130315 16:56:06< vultraz> ahh 20130315 16:56:20< vultraz> I only know the id, does that mean I need get_units? 20130315 16:56:29< mattsc> yes 20130315 16:56:43< mattsc> local unit = wesnoth.get_units { id = 'whatever' }[1] 20130315 16:57:15< vultraz> someone suggested I use rawset(). Is that relevant is any way? 20130315 16:57:23< vultraz> like rawset("unit_being_developed.variables", "class", class_var.id) 20130315 16:57:49< mattsc> Uh, I have no idea what that does ... 20130315 16:58:11< vultraz> mk 20130315 16:58:17< vultraz> I'll use your way 20130315 16:58:19< mattsc> The line up there is copy/paste out of some of my code, so it obviously works. 20130315 16:59:03< mattsc> "obviously" is supposed to mean that I wouldn't have used it if it didn't work, not that it should be obvious that it works. :) 20130315 16:59:24< mattsc> You can always use :inspect to see if things got set/changed correctly. 20130315 17:02:35< vultraz> local u_id = wesnoth.get_variable("unit.id") 20130315 17:02:37< vultraz> local main_unit = wesnoth.get_units {id = u_id}[1] 20130315 17:02:39< vultraz> main_unit.variables.class = class_var.id 20130315 17:03:22< vultraz> that right? 20130315 17:03:35< mattsc> Assuming that WML variable unit is defined, it should work 20130315 17:04:12< mattsc> oh, and class_var needs to be defined and have a field id as well, of course 20130315 17:05:41< vultraz> local class_var = wesnoth.get_variable(string.format("character_development.class[%d]", wesnoth.get_variable("class_index"))) 20130315 17:06:25< vultraz> mk, now to convert some code and then see if this workds 20130315 17:31:09< vultraz> mattsc: is it possible to use "$()" to calculate 4 times a variable ? 20130315 17:31:26< vultraz> or do you have to do it separately with VARIABLE_OP 20130315 17:31:55< mattsc> That should work 20130315 17:32:57< vultraz> {VARIABLE_OP mana_xp_temp.variables.xp add "$(mana_xp_temp.level * 4)"} ? 20130315 17:33:46< mattsc> you need a second $ just after the ( 20130315 17:34:29< vultraz> ah, yeah 20130315 17:39:18< vultraz> ok..something is still generating a nameless array 20130315 17:39:29< vultraz> I think that's what corrupting the saves 20130315 17:41:52< vultraz> 20130316 03:38:30 error engine: Formula in WML string cannot be evaluated due to Illegal unary operator: '*' 20130315 17:41:54< vultraz> --> "* " 20130315 17:41:56< vultraz> :S 20130315 17:42:06< vultraz> mattsc: ^ 20130315 17:45:02< mattsc> vultraz: here's a line from one of my scenarios: 20130315 17:45:04< mattsc> {VARIABLE S2.money_for_rats "$($S2.rats_to_sell*$Money.rat_pay)"} 20130315 17:45:28< mattsc> Maybe formulas don't like spaces? 20130315 17:45:33< vultraz> maybe 20130315 17:45:44< mattsc> That sounds weird though 20130315 17:46:41< vultraz> still trying to figure out what;s generating this nameless, empty array 20130315 17:46:57< mattsc> vultraz: I'll be away for a while. I'll stay logged in though. 20130315 17:47:02< vultraz> ok 20130315 17:57:01-!- irker195 [~irker@ai0867.net] has joined #wesnoth-umc-dev 20130315 17:57:01< irker195> wesnoth-umc-dev: vultraz * r17626 /trunk/NX-RPG/ (4 files in 3 dirs): 20130315 17:57:01< irker195> wesnoth-umc-dev: NX: rewrote the variable system to store it in units' [variables] node and not an array named after their IDs. In the process, the mana system got some improvements. 20130315 18:00:53< vultraz> interesting... 20130315 18:24:23< vultraz> mattsc: ok honestly, all this lua variable crap is confusing me too much 20130315 18:32:25< mattsc> vultraz: well, you don't have to use them. :) Anything specific I can help with? 20130315 18:34:35< vultraz> well, ug 20130315 18:34:37< vultraz> uh* 20130315 18:35:01< vultraz> for some reason, this function: http://pastebin.com/dGspJcJd throws a huge number of errors in stdrr 20130315 18:35:18< vultraz> even before the wml event using the tag is encountered 20130315 18:35:32< vultraz> 20130316 03:53:47 warning engine: variable_info: retrieving member of non-existent WML container, killer.id 20130315 18:35:47< vultraz> $killer.id is what I had as the filter 20130315 18:36:45< mattsc> Well, what that say is that variable killer does not exist in the environment where you're trying to access that. 20130315 18:37:28< mattsc> Which, btw, in WML still works. It's just a warning. 20130315 18:37:37< mattsc> In Lua it would crash the execution 20130315 18:37:44-!- trewe [~trewe@87.196.171.196] has joined #wesnoth-umc-dev 20130315 18:39:05< vultraz> ah 20130315 18:39:06< vultraz> ok 20130315 18:39:13< vultraz> and...GAH 20130315 18:39:22 * vultraz flips table 20130315 18:40:20< mattsc> Actually, I might be off by a little: you're trying to access a field of container variable 'killer.id', but 'killer.id' does not exist. That's what that error message says, I think. 20130315 18:41:03< mattsc> But still, in WML you just get a warning (and the result will be an empty variable), while in Lua you get an error. 20130315 18:41:20< vultraz> main_unit.variables.inventory[i_index].id = cfg.id 20130315 18:41:20< vultraz> for some reason, that does not work 20130315 18:41:48< vultraz> attempt to index field 'inventory' (a nil value) 20130315 18:41:59< vultraz> yeah..I wanted it to create it if it didn't exist 20130315 18:44:54< mattsc> main_unit.variable.inventory = {} 20130315 18:45:07< mattsc> or if you want to do it in one step: 20130315 18:45:52< vultraz> http://pastebin.com/T7EMCdxG 20130315 18:46:00< mattsc> Ah, no, never mind. That's probably not good in this case... 20130315 18:46:41< vultraz> I can't use main_unit.variable.inventory = {} 20130315 18:46:49< vultraz> or else all items would be erased every time 20130315 18:46:56< vultraz> since the array would be cleared 20130315 18:47:00< mattsc> So before line 20, you put: 20130315 18:47:29< mattsc> if (not main_unit.variable.inventory) then main_unit.variable.inventory = {} end 20130315 18:47:32< mattsc> and 20130315 18:47:56< mattsc> if (not main_unit.variable.inventory[i_index]) then main_unit.variable.inventory[i_index] = {} end 20130315 18:48:53< mattsc> Btw, you also don't need separate lines for all that, you can do it like this: 20130315 18:49:17< mattsc> whatevervariable = { id = cfg.id, name = cfg.name, ... } 20130315 18:49:55< mattsc> Or about a million other permutations of something like that :) 20130315 18:53:41< vultraz> mattsc: http://pastebin.com/YZqdTLyD 20130315 18:55:48< vultraz> and somehow, I can't find the source of this empty, nameless array... 20130315 18:56:31< mattsc> well, eliminate code until it is gone ... 20130315 18:57:26< vultraz> it could be anywhere... 20130315 18:57:58< vultraz> before, it was created by a die event 20130315 18:58:14< vultraz> now, at appears immediately at scenario start... 20130315 19:00:15< vultraz> mattsc: er, getting this, now https://dl.dropbox.com/u/95558676/luaerror.JPG 20130315 19:04:57< vultraz> (65 is: if (not main_unit.variables.inventory) then main_unit.variables.inventory = {} end 20130315 19:06:05< mattsc> Hmm, try changing the {} to a number, just to see what happens. 20130315 19:09:05< vultraz> mattsc: https://dl.dropbox.com/u/95558676/luaerror2.JPG 20130315 19:10:12< mattsc> Ok, so that means assigning a number worked. 20130315 19:10:18-!- bumbadadabum [~bumbadada@d155109.upc-d.chello.nl] has joined #wesnoth-umc-dev 20130315 19:10:27< mattsc> I just noticed though that you have 'variable' there, singular. 20130315 19:11:00< vultraz> in the paste? I've changed that 20130315 19:11:01< mattsc> oh, maybe that was only in your pastebin 20130315 19:11:04< mattsc> ok 20130315 19:12:23< mattsc> Hmm, maybe that's what this means in the wiki: "only toplevel named fields are proxied" 20130315 19:12:35< mattsc> So, try this: 20130315 19:13:53< mattsc> Change variables to variables.__cfg everywhere. 20130315 19:14:09< mattsc> That's 2 underscores 20130315 19:15:02< vultraz> so it looks like variables.__cfg.inventory[]? 20130315 19:15:11< mattsc> yes 20130315 19:15:45< mattsc> I'm not quite sure how to interpret what the wiki says about this, so this might or might not work. (and I don't have time to try it out myself right now) 20130315 19:17:17< vultraz> now we're back to 'inventory' being a nil value 20130315 19:17:40< mattsc> Hmm, I don't know right now then. 20130315 19:17:52< mattsc> I can do some tests later, but I need to be off again right now. 20130315 19:18:01< vultraz> mk 20130315 19:18:05< vultraz> I need to get some slep 20130315 19:18:07< vultraz> sleep 20130315 19:18:17< vultraz> been up all night trying to make this work 20130315 19:18:33< mattsc> Sorry that I'm not more help ... 20130315 19:19:24< vultraz> you've been extreme help 20130315 19:19:30< vultraz> :) 20130315 19:19:47< vultraz> anyway, current code: http://pastebin.com/cRemExsE 20130315 19:19:51< mattsc> Well, good then. :) 20130315 19:20:18< mattsc> If I have time, I'll see if I can figure out what is going on later. Check the logs tomorrow. 20130315 19:20:25< vultraz> mk 20130315 19:20:54< mattsc> I've just never assigned anything but scalars to unit variables from lua, so don't know if there's a "trick" of some sort. 20130315 19:22:08< bumbadadabum> lua tag opening is confusing 20130315 19:22:27< bumbadadabum> I have to manually count how many }s I have to place at the end of my stuff 20130315 19:25:34-!- Octalot [~noct@host86-147-144-75.range86-147.btcentralplus.com] has joined #wesnoth-umc-dev 20130315 19:25:48< mattsc> bumbadadabum: systematic and consistent indenting helps: http://pastebin.com/e8dDKWCp 20130315 19:28:28< mattsc> and you can make that "even easier" to read by adding a few more lines and indents. 20130315 19:30:11< bumbadadabum> mattsc: It crashes my game.. 20130315 19:30:11< bumbadadabum> I am really bad at luaai 20130315 19:30:15< bumbadadabum> http://pastebin.com/NZvQRddr 20130315 19:38:33< mattsc> bumbadadabum: are you going to be around for a bit. I can't look at this right now. 20130315 19:38:37< bumbadadabum> yes 20130315 19:46:41-!- jieverson [c8a91476@gateway/web/freenode/ip.200.169.20.118] has joined #wesnoth-umc-dev 20130315 19:46:49-!- trewe_ [~trewe@87.196.171.196] has joined #wesnoth-umc-dev 20130315 19:49:57-!- trewe [~trewe@87.196.171.196] has quit [Ping timeout: 240 seconds] 20130315 20:10:12< mattsc> bumbadadabum: are the wesnoth.get_units calls the problem? 20130315 20:13:47< bumbadadabum> mattsc: I have no idea 20130315 20:14:03< bumbadadabum> the game crashes immediately 20130315 20:14:17-!- jieverson [c8a91476@gateway/web/freenode/ip.200.169.20.118] has quit [Quit: Page closed] 20130315 20:14:26< mattsc> well, there are missing commas in the get_units tables. 20130315 20:14:44< mattsc> A suggestion: strip down wesnoth.get_units to something very simple. 20130315 20:14:45< bumbadadabum> does that usually crash the game? 20130315 20:15:01< bumbadadabum> mattsc: That's not very simple 20130315 20:15:04< mattsc> What version of Wesnoth again? 20130315 20:15:14< bumbadadabum> 1.11/1 20130315 20:15:16< bumbadadabum> *. 20130315 20:16:04< mattsc> bumbadadabum: what's not very simple? 20130315 20:16:11< mattsc> Just use this as a test: 20130315 20:16:21< bumbadadabum> oh yeah as a test 20130315 20:16:33< mattsc> local acolytes = wesnoth.get_units { type = "Elvish Acolyte } 20130315 20:16:51< mattsc> and the same in all other places where you have complicated tables, and see if it still crashes 20130315 20:17:14< mattsc> It won't do what you want it to do, of course, but at least you can find out whether that's the source of your problem 20130315 20:17:30< mattsc> oops, there's a missing " in there ^ 20130315 20:20:27< bumbadadabum> mattsc: they weren't the problem 20130315 20:21:01< mattsc> bumbadadabum: ok. Could you paste the entire [side] definition then and I'll have a look. 20130315 20:21:15< bumbadadabum> mattsc: sure 20130315 20:22:34< bumbadadabum> http://pastebin.com/3mjb3ens 20130315 20:22:37< bumbadadabum> mattsc: ^ 20130315 20:26:40< mattsc> bumbadadabum: give me a few minutes, I need to finish something else first. 20130315 20:35:10-!- Blueblaze [~Blueblaze@adsl-99-158-47-208.dsl.hstntx.sbcglobal.net] has joined #wesnoth-umc-dev 20130315 20:41:10< mattsc> bumbadadabum: it is the wesnoth.get_units calls. All three of them. 20130315 20:41:37< mattsc> There's also a 'then' missing in the if statement 20130315 20:46:10< mattsc> I'd also strongly recommend that you put the AI code into a file and set up a right-click testing option. It's a bit more work up front, but it will save you a lot of time in the long run. 20130315 20:50:31< bumbadadabum> mattsc: What's wrong with the get_unit calls 20130315 20:51:26< mattsc> The syntax/structure's wrong. 20130315 20:56:50< bumbadadabum> mattsc: I copied it from LoW 20130315 20:57:02< bumbadadabum> It might be wrong 20130315 20:58:46< mattsc> It is wrong. :) 20130315 20:59:02< mattsc> So, do you want to try to figure it out yourself, or do you want me to fix it for you? 20130315 20:59:15< mattsc> You'll need to learn how to do it eventually anyway ... 20130315 20:59:21-!- irker195 [~irker@ai0867.net] has quit [Quit: transmission timeout] 20130315 21:00:23< bumbadadabum> mattsc: You fix it 20130315 21:00:35< bumbadadabum> then I have some reference for the future 20130315 21:00:39< bumbadadabum> and know how stuff works 20130315 21:00:51< bumbadadabum> learning a new language is tricky 20130315 21:01:11< mattsc> Ok, let me have a look then (so far I've only confirmed what the problems are, not how to fix them) 20130315 21:06:59< mattsc> bumbadadabum: here's enemy: http://pastebin.com/YQ5ATip9 20130315 21:07:53< mattsc> Besides restructuring it to make it more readable, the } and , in line 4 were missing to close filter_location and separate it from filter_side 20130315 21:09:31< bumbadadabum> }, 20130315 21:09:31< bumbadadabum> { "filter_side", 20130315 21:09:38< bumbadadabum> the comma there is needed? 20130315 21:09:41< bumbadadabum> I didn't know that 20130315 21:09:42< bumbadadabum> thanks 20130315 21:09:54< mattsc> yes - and the closing } was missing too 20130315 21:10:17< bumbadadabum> I might try to make it more readable then 20130315 21:10:36< bumbadadabum> because I already have a hard time spotting where closing tags are missing in WML 20130315 21:11:06< mattsc> for the acolytes, the only problem is that missing comma 20130315 21:11:23< mattsc> More readable version: http://pastebin.com/hp2Y13Lx (without all the tabs) 20130315 21:11:41< mattsc> Besides that, there's the 'then' missing that I already mentioned. 20130315 21:12:19< mattsc> and 'ai.attack(p, acolytes)' won't work, because acolytes is a unit table and ai.attack() wants a single unit 20130315 21:12:36< bumbadadabum> ok 20130315 21:12:45< bumbadadabum> I'm going to write something to find the best target then 20130315 21:12:54< mattsc> To be more precise: acolytes is an array of unit tables, and the attack wants a single unit table 20130315 21:13:41< mattsc> Seriously though, set up that right-click testing mechanism. You won't regret it (if you want to do any more than what you have here already) 20130315 21:14:12< mattsc> I have not tested at all whether your code does what you want it to do. I've only looked for errors that make it crash. 20130315 21:19:31-!- zookeeper2 [~lmsnie@87-100-211-108.bb.dnainternet.fi] has joined #wesnoth-umc-dev 20130315 21:20:17< bumbadadabum> mattsc: How do you make it so it checks for the lowest value in an array 20130315 21:20:17-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 255 seconds] 20130315 21:21:00< bumbadadabum> I'm trying to make it so it selects the closest one to attack 20130315 21:22:00< mattsc> you can either use table.sort or loop over the array with 'for' 20130315 21:28:54< bumbadadabum> mattsc: What's the syntax for table.sort? 20130315 21:32:46< mattsc> Here's and example: 20130315 21:32:52< mattsc> table.sort(wolves, function(a, b) return a.moves < b.moves end) 20130315 21:33:32< mattsc> It takes 2 argument, the array to be sorted, and a sorting function. 20130315 21:34:10< bumbadadabum> so... 20130315 21:34:16< mattsc> This example sorts array wolves in order of increasing MP 20130315 21:35:13< bumbadadabum> table.sort(distance, function(a, b) return a < b end) 20130315 21:35:15< bumbadadabum> like this? 20130315 21:35:30< mattsc> That would work. 20130315 21:38:07-!- skyfaller [~skyfaller@wikipedia/Skyfaller] has quit [Remote host closed the connection] 20130315 21:38:33< mattsc> bumbadadabum: btw, ai_helper.lua in AI-demos has a function get_closest_enemy() 20130315 21:38:52< bumbadadabum> mattsc: Thanks! 20130315 21:38:59< bumbadadabum> if it does what I think 20130315 21:39:17< bumbadadabum> that makes my entire thing useless 20130315 21:39:42< bumbadadabum> so get_closest_enemy(SUF)? 20130315 21:40:13< mattsc> No, not that sophisticated, it just takes a location as argument. 20130315 21:40:35< mattsc> There's also a get_closest_location and a bunch of other things that might be useful. 20130315 21:40:48< mattsc> Just have a look through the functions in the file. 20130315 21:40:53< bumbadadabum> it won't work for this 20130315 21:41:13< mattsc> I could make it work... 20130315 21:41:49< mattsc> But beside that point, you could have a look through and steal whatever code you need. That's generally easier than writing it yourself. IMO, at least. 20130315 21:42:00< bumbadadabum> yes indeed 20130315 21:42:23< bumbadadabum> mattsc: Can you use ai.attack with an x,y after the attacker? 20130315 21:43:09< mattsc> I believe so. IIRC both the attacker and defender can be either a unit table or coordinates 20130315 21:43:47< bumbadadabum> http://pastebin.com/zPUrT23Y 20130315 21:44:01< bumbadadabum> I got this to select the target now 20130315 21:53:05< mattsc> Does that work? Lua tables start at index 1, not 0 20130315 21:53:16< bumbadadabum> ok 20130315 21:53:23< bumbadadabum> then it probably won't 20130315 21:53:24< bumbadadabum> :p 20130315 21:53:58< mattsc> Also, you probably want to store q in lines 3 and 4, not p 20130315 21:54:38< mattsc> And, if you're using a 4 loop anyway, you might as well use that for sorting, rather than doing a table.sort separately. 20130315 21:55:03< mattsc> Uh, s/4/for - funny how the fingers do things like that ... 20130315 21:55:17< bumbadadabum> lol 20130315 21:55:36< bumbadadabum> but how do I find the closest acolyte then? 20130315 21:57:14< mattsc> can you look at ai_helper.lua ? 20130315 21:57:19< mattsc> easily enough, I mean 20130315 21:57:43< bumbadadabum> ok 20130315 21:58:18< mattsc> lines 575-582 in my version (the last code block in get_closest_enemy; in case I've changed it since the last release) 20130315 21:59:33< bumbadadabum> ok will check 20130315 22:00:27< bumbadadabum> aaand.... it crashed 20130315 22:01:44< bumbadadabum> I'll work on it later 20130315 22:09:25< mattsc> bumbadadabum: it takes a while getting used to these things 20130315 22:09:42< bumbadadabum> mattsc: I know 20130315 23:05:23-!- shadowm_desktop [ignacio@wesnoth/developer/shadowmaster] has joined #wesnoth-umc-dev 20130315 23:09:39-!- zookeeper2 [~lmsnie@87-100-211-108.bb.dnainternet.fi] has quit [Ping timeout: 276 seconds] 20130315 23:29:56-!- trewe_ [~trewe@87.196.171.196] has quit [Remote host closed the connection] 20130315 23:34:33-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20130315 23:39:45-!- pydsigner [~Thunderbi@unaffiliated/pydsigner] has joined #wesnoth-umc-dev 20130315 23:40:16< pydsigner> bumbadadabum: Heya 20130315 23:40:24< bumbadadabum> pydsigner: Hello 20130315 23:42:28-!- trewe [~trewe@87.196.171.196] has joined #wesnoth-umc-dev --- Log closed Sat Mar 16 00:00:04 2013