<Lua> Unknown condition, ignoring
Moderator: Forum Moderators
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.
- revansurik
- Posts: 604
- Joined: October 17th, 2012, 11:40 pm
- Location: Brazil
- Contact:
<Lua> Unknown condition, ignoring
Hi again folks; I've stumbled on a strange problem while testing a scenario: as it started, the message '<Lua> Unknown condition, ignoring' appeared on a corner of the screen, repeated three times. It doesn't seem to have affected the game, as everything worked just fine, but still I thought I should fix it to avoid problems in the future.
Here is the code of the first scenario where it occurred; it's happened on the following scenario too:
Here is the code of the first scenario where it occurred; it's happened on the following scenario too:
Code: Select all
#textdomain wesnoth-Aria_of_the_Dragon_Slayer
[scenario]
id=02_Tenma_Versus_Aetheryon
name= _ "Tenma versus Aetheryon"
next_scenario=03_Haunted_By_The_Past
map_data="{~add-ons/Aria_of_the_Dragon_Slayer/maps/Tenma_House.map}"
{TURNS 39 35 31}
{TWO_SUNS_DEFAULT_SCHEDULE}
{SCENARIO_MUSIC knolls.ogg}
{EXTRA_SCENARIO_MUSIC battle.ogg}
{EXTRA_SCENARIO_MUSIC the_city_falls.ogg}
{EXTRA_SCENARIO_MUSIC Etherea.ogg}
{WEAPON_SPECIALS_EVENTS}
[event]
name=prestart
[objectives]
side=1
[objective]
description= _ "Defeat Prince Aetheryon"
condition=win
[/objective]
[objective]
description= _ "Death of Tenma"
condition=defeat
[/objective]
[objective]
description= _ "Death of Olokun"
condition=defeat
[/objective]
[objective]
description= _ "Death of Kenshiro"
condition=defeat
[/objective]
note= _ "Both Tenma and Olokun can recruit from the hexes they're standing at the start of the battle."
{TURNS_RUN_OUT}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[/event]
{STARTING_VILLAGES 1 10}
[side]
{TENMA}
recruit=
{GOLD 220 190 160}
{INCOME 2 5 8}
team_name=teamtenma
user_team_name=_"Kuroi Village"
{FLAG_VARIANT ragged}
[/side]
[side]
no_leader=yes
recruit=Heavy Infantryman,Bowman,Cavalryman,Sword Walker
side=2
team_name=wesnothians
user_team_name=_"Empire of Wesnoth"
{GOLD 300 330 360}
{INCOME 5 10 15}
[ai]
recruitment_pattern=fighter,fighter,archer,scout,scout
passive_leader=yes
aggression=0.75
caution=0.25
[/ai]
{FLAG_VARIANT loyalist}
[/side]
[event]
name=prestart
[unit]
{NATSU}
side=1
x,y=6,2
[/unit]
[unit]
{OLOKUN}
side=1
x,y=5,3
[/unit]
{PLACE_IMAGE items/dinnertable.png 2 3}
{PLACE_IMAGE items/chair-sw.png 2 2}
{PLACE_IMAGE items/chair-se.png 3 3}
{PLACE_IMAGE items/bed-sw.png 7 3}
{PLACE_IMAGE items/bed-sw.png 7 2}
[/event]
[event]
name=start
[message]
speaker=Tenma
message= _ "Ouch... What happened... You..."
[/message]
[message]
speaker=Olokun
message= _ "Please keep resting, Tenma. I'll answer any question you may have, but do not overexert yourself."
[/message]
[message]
speaker=Natsu
message= _ "(nervous) Indeed you will! What just happened there? Tenma has always been a normal girl, why did she suddenly become capable of doing that?"
[/message]
[message]
speaker=Olokun
message= _ "First of all, don't worry; what she did there is called, by those capable of doing it, magic. As for the creatures she summoned, even I can't tell for sure, but they look very like a type of beings called Elementals, which some amongst my people – me included – can summon."
[/message]
[message]
speaker=Tenma
message= _ "And who are you after all? I thought only Wesnothians could use magic."
[/message]
[message]
speaker=Olokun
message= _ "Many people other than Wesnothians can do it. My people, the Maat'Karians, have been proficient at it long before Wesnoth even existed. By the way, I think I haven't introduced myself: my name's Olokun Maahes, and I've travelled this world searching for a girl who, according to a prophecy of my people, would be our greatest heroine, Myra of Hiera'Shirsha, reborn. And I'm fairly certain that this girl is you, Tenma."
[/message]
[message]
speaker=Natsu
message= _ "Wait, what... (suddenly angry) Do you really expect us to believe that? Don't listen to what this outsider says, Tenma, probably he's just trying to abduct you to some slave trade!"
[/message]
[message]
speaker=Olokun
message= _ "Think about it, Tenma: when you felt that surge of power, did you feel like yourself? Didn't you feel, let's say, another presence near you?"
[/message]
[message]
speaker=Tenma
message= _ "Now that you're saying, I did hear some voices, and... from the moment I exploded those soldiers to when I defeated Beoc, I didn't feel like myself... I mean, I was myself, but at the same I wasn't... Do you understand what I mean?"
[/message]
[message]
speaker=Olokun
message= _ "I think I do. Those voices must have been spirits of nature. In all our recorded history, only one person could communicate with them, and it was Myra. If you really are her reincarnation, that would explain not only those voices, but also that strange feeling you had: during that fight, you'd have awakened your soul's memories as Myra and, thus, you felt 'yourself and not yourself' at the same time."
[/message]
[message]
speaker=Tenma
message= _ "Eh, I think I get what you're saying, but..."
[/message]
[unit]
{KENSHIRO}
side=1
x=4
y=1
[/unit]
[message]
speaker=Natsu
message= _ "My son...!"
[/message]
[message]
speaker=Kenshiro
message= _ "(panting) Hello, mother... Sorry, but I have no second to waste: Tenma, you must flee this village at once, I'll find a way to give you provisions later, but now you have to go, that Lord Aetheryon is coming for you!"
[/message]
[sound]
name=explosion.ogg
[/sound]
[delay]
time=400
[/delay]
[message]
speaker=Tenma
message= _ "Um, well, too late, I think, but thanks for you the intention..."
[/message]
[message]
speaker=Olokun
message= _ "Please stay here, Tenma, I'll go out and see what I can do..."
[/message]
[message]
speaker=Tenma
message= _ "You don't need to risk yourself, this isn't your fight, but mine. And besides, I somehow feel a lot better already."
[/message]
[message]
speaker=Olokun
message= _ "If you say so, fine, but it is my fight as well. I've crossed the entire world looking for you, I can't allow you to get hurt."
[/message]
[message]
speaker=Tenma
message= _ "(blushing) Er, well, if that's how it is, then come with me; we'll continue our talk later..."
[/message]
[message]
speaker=Kenshiro
message= _ "(whisper) Who is the foreigner?"
[/message]
[message]
speaker=Tenma
message= _ "He's a friend, don't worry. Now, let's deal with those Wesnothians..."
[/message]
{FADE_TO_BLACK}
[hide_unit]
[/hide_unit]
[remove_item]
[/remove_item]
[replace_map]
map="{~add-ons/Aria_of_the_Dragon_Slayer/maps/Kodakuni.map}"
expand=yes
shrink=yes
[/replace_map]
[teleport]
[filter]
id=Tenma
[/filter]
x,y=43,19
animate=no
[/teleport]
[teleport]
[filter]
id=Olokun
[/filter]
x,y=44,18
animate=no
[/teleport]
[teleport]
[filter]
id=Kenshiro
[/filter]
x,y=43,20
animate=no
[/teleport]
[unit]
{AETHERYON}
side=2
x=32
y=4
[/unit]
[unit]
id=Toushiro
name= _"Toushiro"
type=Ken Warrior
side=2
ai_special=guardian
x=34
y=3
[modifications]
{TRAIT_STRONG}
{TRAIT_LOYAL}
[/modifications]
[/unit]
[kill]
id=Natsu
[/kill]
{SCATTER_IMAGE (terrain=Rb^Gvs) 4 "items/straw-bale1.png"}
{SCATTER_IMAGE (terrain=Rb^Gvs) 3 "items/straw-bale2.png"}
{SCATTER_IMAGE (terrain=Rb^Gvs) 5 "items/grain-sheaf.png"}
[redraw][/redraw]
[unhide_unit]
[/unhide_unit]
{FADE_IN}
[message]
speaker=Aetheryon
message= _ "Tenma Yozora, daughter of Yusuke and Motoko, I have come to arrest you for the killing of Wesnothians and for inciting rebellion in a Wesnothian province. Step forward, and I promise I shall spare your village."
[/message]
[message]
speaker=Tenma
message= _ "Oh my, Your High Graceful Lord has come in person to arrest me! Not only that, but even the Ken-ningen are here, I think I've never felt so important in my life!"
[/message]
[message]
speaker=Toushiro
message= _ "You watch out how you talk to your betters, Yasai girl! Though it's always an honour to fight alongside Lord Aetheryon, we're not here for you, but for that traitor standing next to you!"
[/message]
[message]
speaker=Tenma
message= _ "Kenshiro is not a traitor, he's just..."
[/message]
[message]
speaker=Aetheryon
message= _ "If he's standing next to you when he should be standing next to his fellow Ken-ningen, then he's a traitor – unless, of course, he takes advantage of his closeness to you to take your head."
[/message]
[message]
speaker=Kenshiro
message= _ "I... I've killed many people for you, Lord Aetheryon, even my own countrymen, and I've always followed your orders dutifully, even though that made me and my mother hated amongst our people. But I will not kill my friend, and if that means becoming a traitor, then be it!"
[/message]
[message]
speaker=Aetheryon
message= _ "I see... In this case, you leave us no choice. Soldiers, bring me the rebel Tenma, dead or alive – but do no harm to villagers and their homes, unless they attack first; they haven't rebelled against us so far. And do not kill the traitor Kenshiro; his fate is Lord Aeldhoryan's to decide..."
[/message]
[terrain]
x=42,42,43,44,44,45,45
y=19,18,18,17,19,18,19
terrain=Gg^Cov
[/terrain]
[terrain]
x=43,44
y=19,18
terrain=Gg^Kov
[/terrain]
[/event]
[event]
name=turn 2
[unit]
id=Midori
name= _"Midori"
type=Sogen Huntress
side=1
x=41
y=18
[modifications]
{TRAIT_DEXTROUS}
{TRAIT_LOYAL}
[/modifications]
[/unit]
[unit]
id=Akane
name= _"Akane"
type=Sogen Huntress
side=1
x=42
y=17
[modifications]
{TRAIT_QUICK}
{TRAIT_LOYAL}
[/modifications]
[/unit]
[unit]
id=Kai
name= _"Kai"
type=Sword Walker
side=1
x=41
y=19
[modifications]
{TRAIT_STRONG}
{TRAIT_LOYAL}
[/modifications]
[/unit]
[unit]
id=Yusuke
name= _"Yusuke"
type=Sword Walker
side=1
x=41
y=20
[modifications]
{TRAIT_RESILIENT}
{TRAIT_LOYAL}
[/modifications]
[/unit]
[message]
speaker=Olokun
message= _ "Tenma, watch out!"
[/message]
[message]
speaker=Kai
message= _ "Wait, we're not foes! Veteran Kenshiro, your words have struck us, and made us realise how wrong we were, to fight our own people on orders by tyrants. From now on, we'd like to follow you."
[/message]
[message]
speaker=Midori
message= _ "Your courage too, Tenma, has reached me and Akane. We no longer want to just bow submissively to these tyrants, they have no right to exploit us like this."
[/message]
[message]
speaker=Tenma
message= _ "(smiling) Thank you, girls; I feel really reassured seeing more friends supporting me."
[/message]
[/event]
[event]
name=recruit
[filter]
race=elemental
[or]
race=trueelemental
[/or]
[/filter]
[message]
speaker=Aetheryon
message= _ "*(shocked) What are those beings they've just summoned?! I've never read anything in our scrolls describing anything similar to that!*"
[/message]
[/event]
[event]
name=last breath
[filter]
id=Toushiro
[/filter]
[message]
speaker=Toushiro
message= _ "I'm truly ashamed for having failed you, Lord Aetheryon..."
[/message]
[message]
speaker=Aetheryon
message= _ "You have shown dedication, honour and loyalty in all your years serving the Wesnothian banner, Toushiro. Rest in peace, that no shame shall be brought upon your school and clan by your fall."
[/message]
[/event]
[event]
name=last breath
[filter]
id=Aetheryon
[/filter]
[if]
[have_unit]
id=Toushiro
[/have_unit]
[then]
[message]
speaker=Toushiro
message= _ "Lord Aetheryon has been wounded! Cover him as he falls back!"
[/message]
[/then]
[else]
[role]
type=Bowman,Heavy Infantryman,Spearman
role=Soldier
[/role]
[message]
role=Soldier
message= _ "Lord Aetheryon has been wounded! Cover him as he falls back!"
[/message]
[/else]
[/if]
[message]
speaker=Aetheryon
message= _ "(astonished) I have underestimated you, Tenma Yozora; never would I have anticipated that you'd know such strange and powerful magic... But rest assured that this shall not be the last time we meet on battlefield... *That foreign man knew strange magic too, and he doesn't look like any people living inside our empire's sphere of influence; such an unknown man, who wields such unknown magic, could easily know many things that Wesnothian lore never knew...*"
[/message]
[kill]
side=2
[/kill]
[unit]
{NATSU}
side=1
x,y=46,17
[/unit]
[store_locations]
[filter]
id=Tenma
[/filter]
radius=1
variable=possible_tenma_locations
[/store_locations]
{VARIABLE tenma_location.x $possible_tenma_locations[$tenma_location_i].x}
{VARIABLE tenma_location.y $possible_tenma_locations[$tenma_location_i].y}
{MOVE_UNIT id=Natsu $tenma_location.x $tenma_location.y}
{CLEAR_VARIABLE possible_tenma_locations,tenma_location_i}
[message]
speaker=Tenma
message= _ "We did it! Haven't I always said that we could beat them? If we manage to convince more Ken-ningen, more Yasai-ningen and all of the Uma-ningen to rebel too, we could finally free Kodakuni from Wesnothian rule!"
[/message]
[message]
speaker=Olokun
message=_ "I understand that you want to free your people, Tenma, but don't get carried away in the joy of this victory. The Wesnothians will return, with more men and more equipment, next to which this troop brought by Aetheryon will look like a tiny raiding band. You must flee Kodakuni, and follow me to my country; we have the power to help your people find their freedom, and to help you find your destiny."
[/message]
[message]
speaker=Tenma
message= _ "Wait a minute, Olokun, I'm really thankful for all your help, and I understand that you may need my help too, but I can't just leave my people, my home and my friends behind now! As for their armies, let them come! We know this land better than them, I'm sure we could use this to our advantage!"
[/message]
[message]
speaker=Olokun
message= _ "You don't understand who you're fighting against, Tenma. Wesnoth isn't the largest empire this world has ever known for nothing: they have vast steelclad armies with centuries-old experience in warfare; not only that, but they have mages capable of incinerating entire cities, and dark mages who can raise undead legions from all past eras to fight for them. If you doubt what I'm saying about their power, just look at the heavens. See those two suns up in the sky? I'm sure you've already been told that one of them was placed there by Wesnothians."
[/message]
[message]
speaker=Olokun
message= _ "As hard as it is, you must face the fact that there's simply no way for you Sogen to win against them now. If you follow me to my land, however, not only will you be able to hone your powers, but, also, you'll be able to bring powerful Maat'Karian armies to help your people. And, what's more, if you stay here, Aetheryon will keep sending armies after you, and I don't think he'll spare your fellow villagers for long."
[/message]
[message]
speaker=Tenma
message= _ "(sulking) Well, I have to admit that your arguments do sound convincing..."
[/message]
[message]
speaker=Kenshiro
message= _ "If you're going, then I'm following you. I'm wanted by the Wesnothians just like you, and besides... I still don't trust this outsider completely, and so I won't leave you alone with him."
[/message]
[message]
speaker=Olokun
message= _ "(raising eyebrows) Do as you wish, then..."
[/message]
[message]
speaker=Natsu
message= _ "Wait, wait, by the Great Kami, are you really serious about that? Following an unknown man in an errand throughout a world full of Wesnothians, wild beasts and dangerous places?!"
[/message]
[message]
speaker=Tenma
message= _ "Olokun is right, Natsu; if I stay here, I'll only give Aetheryon reasons to keep attacking our village. Besides... I really want to better understand who, or what, I am, and Olokun's people seems to be the ones who can help me on that."
[/message]
[message]
speaker=Natsu
message= _ "Still, I... I'll be left alone here...?"
[/message]
[message]
speaker=Kenshiro
message= _ "You won't be alone, mother, everyone in the village will help you. They may dislike the fact that you had me with a Wesnothian, but they won't leave one of them completely helpless either. And I know that Lord Aetheryon won't allow any harm to reach you, much less Lord Aeldhoryan..."
[/message]
[message]
speaker=Natsu
message= _ "Kenshiro...! (after a while) Well, I shouldn't be hindering you anyway, you're grown-ups already; please, forgive me for treating like children, I just find it so hard to accept that you've grown already..."
[/message]
[message]
speaker=Tenma
message= _ "(hugging Natsu) It's fine, we understand that. And don't worry about Kenshiro, I promise I'll bring him back to your arms safe and sound."
[/message]
[message]
speaker=Kenshiro
message= _ "(frowning) Tsc!"
[/message]
[message]
speaker=Olokun
message= _ "Thank you for trusting me, Tenma; I give you my word that I shall never fail you. Now, we must depart before more Wesnothians come and cut off any wait out of this village."
[/message]
[message]
speaker=Kenshiro
message= _ "But the Wesnothians have sentries all around Kodakuni, and to both the east and the south there's only the Doom Wasteland, which..."
[/message]
[message]
speaker=Olokun
message= _ "...annihilates even the mightiest of armies, I know it well, I myself nearly died there before arriving here. No, I'm thinking about another way out, one I doubt the Wesnothians know. I'll tell about it as we prepare for the journey ahead of us."
[/message]
[endlevel]
result=victory
bonus=yes
[/endlevel]
[/event]
{HEROES_LAST_BREATHS}
[event]
name=time over
[message]
speaker=Aetheryon
message= _ "I must confess that these insurgents are way stronger than I anticipated... But even the most stalwart resistance cannot hope to stand against a far superior might: call in all the reserves!"
[/message]
[message]
speaker=Kenshiro
message= _ "Damn it! There's no way we can win now!"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
[/scenario]
Author of the Dragon Trilogy.
If you enjoyed A Song of Fire, War of the Jewel, Aria of the Dragon-Slayer and Soldier of Wesnoth, you may like my new project: Star of Chaos, a science-fiction mystery/adventure intended to be a trilogy ;-)
If you enjoyed A Song of Fire, War of the Jewel, Aria of the Dragon-Slayer and Soldier of Wesnoth, you may like my new project: Star of Chaos, a science-fiction mystery/adventure intended to be a trilogy ;-)
Re: <Lua> Unknown condition, ignoring
Why don't you try removing parts of the code until it goes away and identify the line that causes it?
- revansurik
- Posts: 604
- Joined: October 17th, 2012, 11:40 pm
- Location: Brazil
- Contact:
Re: <Lua> Unknown condition, ignoring
Found the problem:
Codition should be 'lose', not 'defeat'
Sorry to bother for such stupid mistake
Code: Select all
[objective]
description= _ "Death of Tenma"
condition=defeat
[/objective]
Sorry to bother for such stupid mistake
Author of the Dragon Trilogy.
If you enjoyed A Song of Fire, War of the Jewel, Aria of the Dragon-Slayer and Soldier of Wesnoth, you may like my new project: Star of Chaos, a science-fiction mystery/adventure intended to be a trilogy ;-)
If you enjoyed A Song of Fire, War of the Jewel, Aria of the Dragon-Slayer and Soldier of Wesnoth, you may like my new project: Star of Chaos, a science-fiction mystery/adventure intended to be a trilogy ;-)
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: <Lua> Unknown condition, ignoring
With better wording this should have been a matter of a minute. Suggestions ?revansurik wrote:Found the problem:
Codition should be 'lose', not 'defeat'Code: Select all
[objective] description= _ "Death of Tenma" condition=defeat [/objective]
Sorry to bother for such stupid mistake
And I even thought it would come from the included lua source after search in the C++ interface showed nothing - no, that error message is just in objectives.lua (which didn't come to mind).
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: <Lua> Unknown condition, ignoring
How about "Invalid condition in [objective]"?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: <Lua> Unknown condition, ignoring
Has lua some way to get the file/line of the WML objects it processes? That'd help with useful error messages.
Re: <Lua> Unknown condition, ignoring
Unfortunately, it doesn't. Lines can be linked to issues only to errors while parsing (that means exclusively syntax errors), otherwise the WML is read from the cache in RAM, not from the files.CIB wrote:Has lua some way to get the file/line of the WML objects it processes? That'd help with useful error messages.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: <Lua> Unknown condition, ignoring
I think that would require the config structure, which holds the wml data, to store file/line information. Then the wml action engine, including lua, could emit such messages. Best we can do is emit the whole block of erroneous wml (such as the lua function wesnoth.debug does). With that a search should show the position quickly however (with grep or similar).CIB wrote:Has lua some way to get the file/line of the WML objects it processes? That'd help with useful error messages.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: <Lua> Unknown condition, ignoring
In principle we could make debug mode keep track of all the line number stuff I suppose, but it might be a significant undertaking.
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: <Lua> Unknown condition, ignoring
Maybe this will be a better option:Pentarctagon wrote:How about "Invalid condition in [objective]"?
Code: Select all
helper.wml_error(string.format("Invalid condition %s in [objective] (should be 'win' or 'lose')",obj.condition))
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)