On 2009/4/8 Eric S. Raymond wrote:
>> I would just like to point that, if you are using an event (e.g. the
>> prestart one if the units have to be there right from the start), you
>> could use Lua to achieve this:
>>
>> function leader_and_follower(x,y)
>> W.unit { id="Leader", .., x=x, y=y }
>> W.unit { id="Follower1", .., x=x, y=y+1 }
>> W.unit { id="Follower2", .., x=x+1, y=y-1 }
>> end
>
> What magic does the W stand for? Is that the global Wesnoth context or
> something?
Sorry, I was using the syntactic sugar described in the Wiki:
http://www.wesnoth.org/wiki/LuaWML
If you decide to discard all the Lua helpers and to work at the lowest
level, this is how it would look like in Lua:
wesnoth.fire("unit", { ... })
In other words, this statement tells Wesnoth to act as if the event
action [unit] was present. (The content of the WML tag is passed as
the second argument of the function.)
Best regards,
Guillaume
_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev