Lua error after adding factions to wc2
Moderator: Forum Moderators
-
- Double Style Tourney #1 Champ
- Posts: 121
- Joined: November 26th, 2009, 5:46 am
- Location: Egypt
Lua error after adding factions to wc2
Hi all, my goal/project 's to add more factions to wc2
It worked but the option "Tell me how recruit works" gives an error When browsing units of the new faction
I noticed in the error, that lua uses the old/default path for addon, i tried changing that in main.lua and beside every LUAREQUIRE instance but failed.
Error image's here: https://ibb.co/GJ56Tm8
Edit: i renamed LUAREQUIRE macro but still old path's used
It worked but the option "Tell me how recruit works" gives an error When browsing units of the new faction
I noticed in the error, that lua uses the old/default path for addon, i tried changing that in main.lua and beside every LUAREQUIRE instance but failed.
Error image's here: https://ibb.co/GJ56Tm8
Edit: i renamed LUAREQUIRE macro but still old path's used
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
Re: Lua error after adding factions to wc2
Could you show us the statement at line 233? I see two possibilities: (1) Someone is using _ as a dummy variable, in which case you can replace it with nil, or (2) _ is the translation function that hasn't been defined for some reason.
-
- Double Style Tourney #1 Champ
- Posts: 121
- Joined: November 26th, 2009, 5:46 am
- Location: Egypt
Re: Lua error after adding factions to wc2
Code: Select all
function wesnoth.wml_actions.wc2_recruit_info(cfg)
local side_num = wesnoth.get_viewing_side()
local faction = wc2_era.get_faction(side_num)
if not faction then
wesnoth.wml_actions.message {
scroll = false,
canrecruit = true,
side = side_num,
message = _ "You are not using a WC2 faction.",
}
return
end
But i tried deleting the underscore, commenting out whole line, nothing works
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
-
- Double Style Tourney #1 Champ
- Posts: 121
- Joined: November 26th, 2009, 5:46 am
- Location: Egypt
Re: Lua error after adding factions to wc2
I see translations folder empty in wc2
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
- Lord-Knightmare
- Discord Moderator
- Posts: 2359
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: Lua error after adding factions to wc2
May i see the faction file codes? You are supposed to designate pairs of units under a new custom tag specific to WC otherwise errors like these will be common.hay207 wrote: ↑May 19th, 2021, 3:05 pm Hi all, my goal/project 's to add more factions to wc2
It worked but the option "Tell me how recruit works" gives an error When browsing units of the new faction
I noticed in the error, that lua uses the old/default path for addon, i tried changing that in main.lua and beside every LUAREQUIRE instance but failed.
Error image's here: https://ibb.co/GJ56Tm8
Edit: i renamed LUAREQUIRE macro but still old path's used
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Re: Lua error after adding factions to wc2
Lord-Knightmare seems to know better than me what he's talking about, but there's an explanation of how to define _ at: https://wiki.wesnoth.org/GettextForWesn ... ngs_in_Lua
-
- Double Style Tourney #1 Champ
- Posts: 121
- Joined: November 26th, 2009, 5:46 am
- Location: Egypt
Re: Lua error after adding factions to wc2
Here
- Attachments
-
- loyalist_drake.cfg
- (1.66 KiB) Downloaded 118 times
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
- Lord-Knightmare
- Discord Moderator
- Posts: 2359
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: Lua error after adding factions to wc2
Just as I suspected.
This is the correct way:
Code: Select all
#define MULTIPLAYER_SIDE_THE_CULT
[multiplayer_side]
id=The Cult
name={STR_CULT}
recruit=Spearman,Spearman,Skeleton,Skeleton,Bowman,Bowman,Skeleton Archer,Skeleton Archer,Mage,Mage,Dark Adept,Dark Adept,Horseman,Horseman,Ghoul,Ghoul,Fencer,Fencer,Dune Herbalist,Walking Corpse,Heavy Infantryman,Ghost,Cavalryman,Cavalryman,Vampire Bat,Vampire Bat,Merman Fighter,Merman Fighter
image={IMG_CULT}
type=random
leader= Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage,Dark Sorcerer,Revenant,Deathblade,Bone Shooter,Necrophage
random_leader= {RANDOM_LEADERS_CULT}
[world_conquest_data]
commanders=Loyalists,Undead,Dune Herbalist
heroes=Rebels_All,Knalgans_All
deserters=Drakes,Northerners,Young Ogre
deserters_names={STR_YOUNG_OGRE}+", "+{STR_DRAKES}+{STR_AND}+{STR_NORTHERENS}
{WC_II_PAIR "Spearman" "Spearman"}
{WC_II_PAIR "Skeleton" "Skeleton"}
{WC_II_PAIR "Bowman" "Bowman"}
{WC_II_PAIR "Skeleton Archer" "Skeleton Archer"}
{WC_II_PAIR "Mage" "Mage"}
{WC_II_PAIR "Dark Adept" "Dark Adept"}
{WC_II_PAIR "Horseman" "Horseman"}
{WC_II_PAIR "Ghoul" "Ghoul"}
{WC_II_PAIR "Fencer" "Fencer"}
{WC_II_PAIR "Dune Herbalist" "Walking Corpse"}
{WC_II_PAIR "Heavy Infantryman" "Ghost"}
{WC_II_PAIR "Cavalryman" "Cavalryman"}
{WC_II_PAIR "Vampire Bat" "Vampire Bat"}
{WC_II_PAIR "Merman Fighter" "Merman Fighter"}
[/world_conquest_data]
[/multiplayer_side]
#enddef
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
-
- Double Style Tourney #1 Champ
- Posts: 121
- Joined: November 26th, 2009, 5:46 am
- Location: Egypt
Re: Lua error after adding factions to wc2
Ok, so you suggest using instead of which is used by default factions , However your method doesn't allow pairing (displays all units in faction).
Also, i still get same error
Code: Select all
[world_conquest_data]
Code: Select all
FACTION_VARIABLE
Also, i still get same error
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
-
- Double Style Tourney #1 Champ
- Posts: 121
- Joined: November 26th, 2009, 5:46 am
- Location: Egypt
Re: Lua error after adding factions to wc2
Also i should mention that everything works if i delete wc2 and used my modded one
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
- Lord-Knightmare
- Discord Moderator
- Posts: 2359
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: Lua error after adding factions to wc2
Are you trying to load the mainline WC in 1.15.x as an add-on in 1.14?
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
-
- Double Style Tourney #1 Champ
- Posts: 121
- Joined: November 26th, 2009, 5:46 am
- Location: Egypt
Re: Lua error after adding factions to wc2
I'm just editing the addon on 1.14 server, so the is not written yet
Code: Select all
[world_conquest_data]
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
-
- Double Style Tourney #1 Champ
- Posts: 121
- Joined: November 26th, 2009, 5:46 am
- Location: Egypt
Re: Lua error after adding factions to wc2
Ok, i'll just write the info in [message], thanks all
Ports: Velensk's tower defense, dov's deep shrine, Scrolling survival, Scrolling survival Co-op, Temples of the nagas.
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p
Addons: Tower defense maps , some ANL scenarios like: ANL 3p "A New Land" survival type, and ANL Co-operative map for 2p