Add unknown unit type...

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Add unknown unit type...

Post by ChaosRider »

Hi, as everybody know i am the author of biggest era in wesnoth, even with ordered list of units its hard to find out which unit id is written wrong in codes used in my era. To make it easier i really could be happy if someone could write me here how to change game codes (even this from core folders) to see in error message unit id which couldnt be added to recruit list.

Btw i am surprise a bit that game code send me such a message that some of my units id is unknown cause they are all used in my eras:

0/1 lvls in rpg era (if some of them could be written wrong i could see it by none unit image in units list)
2 lvls - they are seen able as a leaders in two eras War Of The Gods v2.4.5 and War Of The Gods Random Recruits v2.4.5
3 lvls - as a leaders in War Of The Gods Random Recruits 3 Lvl Leaders v2.4.5
4 lvls - as a leaders in War Of The Gods Random Recruits 4 Lvl Leaders v2.4.5
5 lvls - as a leaders in War Of The Gods Random Recruits 5 Lvl Leaders v2.4.5

Lua Error send me such a message:"
<Lua error> ...x86)/Battle for Wesnoth 1.10.0/data/lua/wml-tags.lua:130: bad argument #1 to 'add_known_unit' (unknown unit type)
stack traceback:
.
.
."

It would be usefull to change this "'add_known_unit' (unknown unit type)" for this 'add_known_unit' (unknown unit type = "UsedUnitId - this which was unknown")
_____________________________________________________________________________________________________________________________________
Or i just get other idea, at the same time of random picking new recruits add them to some variable and after this picking remove from that variable this units id which they are also in leader recruit list, this which will be still in this variable will be this one unknown...
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Add unknown unit type...

Post by Dugi »

This is a WML problem. And as usually, you haven't included the part of wml code that caused this problem. I tracked it to an [allow_recruit] tag. According to the code, this problem is related to adding a non-existent unit to the recruit list (that does not show a proper error message). Verify if all the units on the list exist (try to remove them all and add them one by one), if you didn't confuse the commas between, if you haven't added a space behind a comma, if you have capitalised correctly etc.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: Add unknown unit type...

Post by ChaosRider »

I dont know how you are doing this but you are the cure for my each disease which i didnt know how to cure. Yes the reason for that error messages was a space after the comma in ids list. But still i think this could be really helpfull if in this error message could be written id of unit which has been understood as unknown by game. Thx :P.
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Add unknown unit type...

Post by Dugi »

Yes, it would be helpful, but way too many operations would have to be done in order to verify if it is valid. This is the only type of argument error that is not handled by error messages (and there is a reason why it isn't handled) I have ever encountered, so just rely on this: all lua errors relying to unknown something are related to bad arguments inserted.
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Add unknown unit type...

Post by Anonymissimus »

It will display the unknown type from 1.11.3 on now. Note that wmllint's sanity checks would possibly have pointed out that error to you, as it tries to match unit types against the known ones.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Post Reply