Follow-up Comment #2, bug #13042 (project wesnoth):

For reference, this is easy to do with Lua scripts in Wesnoth 1.7. In your
Lua prelude, define the following functions:


function append_objective(obj, desc, cond)
    obj[#obj + 1] = { "objective",
        { description = desc, condition = cond } }
end

function show_my_objectives()
    local o = { side = 1 }
    append_objective(o, _ "Defeat all the enemies", "victory")
    if has_tanner() then
        append_objective(o, _ "Do not let Tanner swim with the fishes",
"lose")
    end
    if something_else() then
        append_objective(o, _ "Do something else", "victory")
    end
    wesnoth.fire("objectives", o)
end


Then you just have to call the following macro whenever the objectives
change:


#define SHOW_MY_OBJECTIVES
    [lua]
        code="show_my_objectives()"
    [/lua]
#enddef


    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?13042>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to