Follow-up Comment #12, patch #1432 (project wesnoth):
> Self-contained macros? You can use Lua stages without first creating a Lua
engine?
'Lua engine' will be automatically created on first access to ai component
which uses engine=lua . but, I was thinking about the use case "user uses a
standard lua ai engine in [engine], and wants to add a [stage] (or a
[candidate_action]) without modifying that [engine]., so, if the user is
able to use code=, he'll be able to write the required functions on the spot
where they're used. If a user can only use method=, then he'll have to add
things into two places 1) - add a name in method=, and 2) add actual code in
the [engine] (or in the file which to which the engine delegates)
>I can acknowledge that you need a side value on the C++ side to do things
properly. But I still don't understand why it is up to the Lua code to
provide this value to the engine.
Then how to do it ? I need that 'side' value on the c++ side. so, I need
either (1) ask lua to provide me that value, and hide it from end-user via
lua-based helper functions; or (2) infer it from somewhere; or (3) during ai
creation, when, in c++ code, exposing c++ action handlers to lua, make action
handlers behave like closures and push side as an upvalue - then, lua will
consider them functions which do not have a 'side' argument.
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?1432>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs