AMLA tree troubles for Mountain_King

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Mountain_King
Translator
Posts: 569
Joined: May 31st, 2010, 7:54 pm

AMLA tree troubles for Mountain_King

Post by Mountain_King »

So, I was messing around and making some edits to a custom AMLA file in BfW 1.11. This caused the scenarios I was working on to stop working. So I I thought, "no big deal, I'll just undo the changes I made and everything will be fine." Not so. Once the scenario had been reloaded again, the original custom AMLA no longer worked, and the unit that was attached to it just got default AMLAs. Checking the stderr, this message was found at the end:

Code: Select all

Battle for Wesnoth v1.11.0
20120918 13:20:36 warning gui/event: distributor mouse button left [wml_message_left]: SDL left button up. The mouse button is already up, we missed an event.
20120918 13:20:36 warning gui/event: distributor mouse button left [wml_message_left]: SDL left button up. The mouse button is already up, we missed an event.
20120918 13:20:36 warning gui/event: distributor mouse button left [wml_message_left]: SDL left button up. The mouse button is already up, we missed an event.
Said error did not show up previously, nor did it show up when trying the same code in 1.10.
Spoiler:
Any suggestions here? Thanks in advance.
Attachments
Japhel2.cfg
Here is the code.
(12.71 KiB) Downloaded 74 times
Last edited by Mountain_King on September 20th, 2012, 7:44 pm, edited 1 time in total.
Projects: Ice Age Fun, Japhel's Journey (same link), Shameless Crossover Excuse (Maintainer), and Age of Dinosaurs!
Is cothabhálach an aistriúcháin Gaeilge mé.
EXTERMINATE!!!!

User avatar
Pentarctagon
Forum Administrator
Posts: 4319
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: SDL error and experimenting with AMLA trees

Post by Pentarctagon »

You can ignore that error message.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
Mountain_King
Translator
Posts: 569
Joined: May 31st, 2010, 7:54 pm

Re: SDL error and experimenting with AMLA trees

Post by Mountain_King »

Wonderful. That means I have exactly no leads on where to isolate the problem. :augh:
Projects: Ice Age Fun, Japhel's Journey (same link), Shameless Crossover Excuse (Maintainer), and Age of Dinosaurs!
Is cothabhálach an aistriúcháin Gaeilge mé.
EXTERMINATE!!!!

User avatar
Pentarctagon
Forum Administrator
Posts: 4319
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: SDL error and experimenting with AMLA trees

Post by Pentarctagon »

If you have the exact same code that you had before, and its suddenly not working now, I'm not really sure what to tell you. You could try deleting the cache manually, removing the add-on, reloading Wesnoth, then re-add your add-on. Its how I fix Wesnoth when one of my things errors and suddenly wesnoth stops "seeing" the add-on, so maybe this is something similar.

Sorry I can't be more helpful :(
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: SDL error and experimenting with AMLA trees

Post by Max »

have you looked at the resulting wml for this unit in a save game?

User avatar
Mountain_King
Translator
Posts: 569
Joined: May 31st, 2010, 7:54 pm

Re: AMLA tree troubles for Mountain_King

Post by Mountain_King »

Spoiler:
I have looked over the code (now) and here are the couple things that stand out to me:
I used "hitpoints" in a lot of places where I should have used "max hitpoints" :doh: and there are one or two spots where a textdomain shows up where it doesn't quite make sense to me.

Well, I tried deleting the cache and removing the add-on, etc. but it still (non) works the same as before. That's the most curious thing to me. It works in 1.10, and it did work in 1.11. But upon messing with the code, it no longer works in 1.11 even upon reverting back to the original code which did work before. :hmm:
Maybe I should rewrite the code from scratch. Any WML veterans want to give some advice on how exactly all this works?

Thanks,
Mountain_King
Projects: Ice Age Fun, Japhel's Journey (same link), Shameless Crossover Excuse (Maintainer), and Age of Dinosaurs!
Is cothabhálach an aistriúcháin Gaeilge mé.
EXTERMINATE!!!!

JaMiT
Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: AMLA tree troubles for Mountain_King

Post by JaMiT »

Mountain_King wrote:This caused the scenarios I was working on to stop working.
Stop working how? Was there an error message when you tried to start your campaign/scenarios? (If so, what is the message?) Did the scenarios load, but no units appeared? Was it none of your events firing? There are a lot of things that could be called "stop working"; which "stop working" are you experiencing?

User avatar
Mountain_King
Translator
Posts: 569
Joined: May 31st, 2010, 7:54 pm

Re: AMLA tree troubles for Mountain_King

Post by Mountain_King »

It was that standard "Unknown scenario" error. IIRC the stderr claimed it was because a nonexistent macro is called upon in the last few lines {JAPHEL_FIGHTER}. Correcting the error by removing that macro as I recall just resulted in the same do-nothing code with the only new error message being that sdl error I mentioned earlier.
Projects: Ice Age Fun, Japhel's Journey (same link), Shameless Crossover Excuse (Maintainer), and Age of Dinosaurs!
Is cothabhálach an aistriúcháin Gaeilge mé.
EXTERMINATE!!!!

JaMiT
Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: AMLA tree troubles for Mountain_King

Post by JaMiT »

Hmmm... when I copied the file you attached earlier into a test scenario, I did get the error for {JAPHEL_FIGHTER}, but commenting that line out allowed the scenario to load. You're getting no message other than "Unknown scenario"? That should only happen if the scenario you specified (in the _main.cfg, I suppose) does not match what you called it when you defined the scenario (in the [scenario] tag). Double check that?

If not, maybe attach a portion of the add-on that includes a scenario to (try to) load? There could very well be a typo of some sort "surrounding" this file, so to speak.

User avatar
Mountain_King
Translator
Posts: 569
Joined: May 31st, 2010, 7:54 pm

Re: AMLA tree troubles for Mountain_King

Post by Mountain_King »

Ah, no. Unknown scenario showed up once before removing the line. Then the scenario worked but the AMLA still didn't.
This folder contains one scenario, one map, a main .cfg, and the unit file in question. Expect some missing images.
Attachments
Japhel's_Journey.zip
(4.75 KiB) Downloaded 72 times
Projects: Ice Age Fun, Japhel's Journey (same link), Shameless Crossover Excuse (Maintainer), and Age of Dinosaurs!
Is cothabhálach an aistriúcháin Gaeilge mé.
EXTERMINATE!!!!

JaMiT
Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: AMLA tree troubles for Mountain_King

Post by JaMiT »

Mountain_King wrote:Then the scenario worked but the AMLA still didn't.
OK, so different type of problem. Not looking for syntactical errors, but semantical ones. Let's see...

Your AMLA trees basically look something like (by id):

Code: Select all

staff   -> staff2   -> staff1   -> leadership, stun
missile -> missile2 -> missile1 -> missile3 -> hardiness, camouflage
with an additional "merge" branch:

Code: Select all

staff1,missile1 -> swordbeam, swordbeam2
So everything would work if the unit had the "staff" and "missile" (and "missile2") advancements. So try adding those advancements to your unit type -- macros JAPHEL_SWORD, JAPHEL_BOW, and JAPHEL_BOW2. Without those first advancements, the later ones cannot occur.

(Also missing from the unit definition: JAPHEL_BOW3, JAPHEL_ARMOR, JAPHEL_STUN, JAPHEL_CAMOUFLAGE, JAPHEL_BEAM2. Maybe those are not supposed to be there, though?)

User avatar
Mountain_King
Translator
Posts: 569
Joined: May 31st, 2010, 7:54 pm

Re: AMLA tree troubles for Mountain_King

Post by Mountain_King »

:doh: It seems so obvious in retrospect. That did the trick; Now it works exactly as expected. Thanks!

Best Regards,
Mountain_King
Projects: Ice Age Fun, Japhel's Journey (same link), Shameless Crossover Excuse (Maintainer), and Age of Dinosaurs!
Is cothabhálach an aistriúcháin Gaeilge mé.
EXTERMINATE!!!!

Post Reply