diff --git a/data/campaigns/Descent_Into_Darkness/scenarios/08_A_Small_Favor2.cfg b/data/campaigns/Descent_Into_Darkness/scenarios/08_A_Small_Favor2.cfg index 3d6eca79f034..070f49b61bb5 100644 --- a/data/campaigns/Descent_Into_Darkness/scenarios/08_A_Small_Favor2.cfg +++ b/data/campaigns/Descent_Into_Darkness/scenarios/08_A_Small_Favor2.cfg @@ -334,7 +334,7 @@ # this code is a handler in case this scenario is reached via debug or an old save which did not include this variable [lua] - code = << if wesnoth.get_variable("S7_turns")==nil then wesnoth.set_variable("S7_turns",5) end >> + code = << if wml.variables["S7_turns"] == nil then wml.variables["S7_turns"] = 5 end >> [/lua] [set_variable] diff --git a/data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua b/data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua index dd9d14185619..30fbfbfeb7ca 100644 --- a/data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua +++ b/data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua @@ -59,7 +59,7 @@ function wesnoth.wml_actions.replace_map_section(cfg) end function wesnoth.wml_actions.unstore_left_behind_units(cfg) - if wesnoth.get_variable("l3_store_kalenz") ~= nil then + if wml.variables["l3_store_kalenz"] ~= nil then l3_store_kalenz = helper.get_variable_array("l3_store_kalenz") for i,_ in ipairs(l3_store_kalenz) do var_name = "l3_store_kalenz[" .. tostring(i-1) .. "]" @@ -69,9 +69,9 @@ function wesnoth.wml_actions.unstore_left_behind_units(cfg) y = "recall" } end - wesnoth.set_variable("l3_store_kalenz",nil) + wml.variables["l3_store_kalenz"] = nil end - if wesnoth.get_variable("l3_store_landar") ~= nil then + if wml.variables["l3_store_landar"] ~= nil then l3_store_landar = helper.get_variable_array("l3_store_landar") for i,_ in ipairs(l3_store_landar) do var_name = "l3_store_landar[" .. tostring(i-1) .. "]" @@ -81,7 +81,7 @@ function wesnoth.wml_actions.unstore_left_behind_units(cfg) y = "recall" } end - wesnoth.set_variable("l3_store_landar",nil) + wml.variables["l3_store_landar"] = nil end end diff --git a/data/campaigns/Secrets_of_the_Ancients/utils/zombie_recruit_dialog.lua b/data/campaigns/Secrets_of_the_Ancients/utils/zombie_recruit_dialog.lua index 03e61d5f051c..10873bc0a554 100644 --- a/data/campaigns/Secrets_of_the_Ancients/utils/zombie_recruit_dialog.lua +++ b/data/campaigns/Secrets_of_the_Ancients/utils/zombie_recruit_dialog.lua @@ -137,7 +137,7 @@ while zombies[zArrayIndex] and zExists == false do zArrayIndex = zArrayIndex + 1 end -wesnoth.set_variable( "recruitedZombieType", "cancel" ) -- default value +wml.variables["recruitedZombieType"] = "cancel" -- default value if zExists==false then wesnoth.show_message_box("", _ "There are no corpses available.", "") @@ -146,7 +146,7 @@ else if returned ~= -2 and sides[1].gold < recruitCost then wesnoth.show_message_box("", _ "You do not have enough gold to recruit that unit", "") elseif returned ~= -2 and (sides[1].gold ) >= recruitCost then - wesnoth.set_variable( "recruitedZombieType", recruitedType ) - wesnoth.set_variable( "recruitedZombieCost", recruitCost ) + wml.variables["recruitedZombieType"] = recruitedType + wml.variables["recruitedZombieCost"] = recruitCost end end diff --git a/data/campaigns/Wings_of_Victory/scenarios/03_The_Contention.cfg b/data/campaigns/Wings_of_Victory/scenarios/03_The_Contention.cfg index f8fcabc720cd..3aeca0abd772 100644 --- a/data/campaigns/Wings_of_Victory/scenarios/03_The_Contention.cfg +++ b/data/campaigns/Wings_of_Victory/scenarios/03_The_Contention.cfg @@ -274,7 +274,7 @@ first_time_only=no # Determine which side has the advantage [lua] - code = << wesnoth.set_variable( "result", wesnoth.require("campaigns/Wings_of_Victory/lua/lua.lua").turns_over_advantage() ) >> + code = << wesnoth.wml.variables["result"] = wesnoth.require("campaigns/Wings_of_Victory/lua/lua.lua").turns_over_advantage() >> [/lua] [switch] variable=result