Search found 1104 matches

by silene
January 14th, 2011, 6:37 am
Forum: Lua Labs
Topic: monochromatic's lua thread
Replies: 42
Views: 12083

Re: elvish_soveriegn and Lua

affected_units = wesnoth.get_units { side = "$side_number" , { "filter_location" , { terrain = "Ce" } } } The "affected_units" variable won't be used outside this block, so you may just as well declare it "local". for value in pairs(affected_units) ...
by silene
January 8th, 2011, 11:45 am
Forum: Lua Labs
Topic: Elvish_Hunter's Lua thread
Replies: 170
Views: 41455

Re: Elvish_Hunter's Lua thread

- It looks like I cannot implement ignore_ambush, but to be sure I need a confirmation: there is a Lua way to make the pathfinding engine take ambushes in account while calculating paths? I don't understand the question. Do you mean that invisible enemy units should be visible to your pathfinding? ...
by silene
January 3rd, 2011, 7:15 am
Forum: WML Workshop
Topic: Nested event mechanism, language principles
Replies: 24
Views: 3271

Re: Questions about event mechanism

At turn 11 a message "elves" is displayed? Indeed it is! (I ran a test) I can't imagine a purpose of such functionality of nested events... Why nested events don't work "normal" way? Just because you think it is abnormal doesn't mean it is. As for its purpose, consider the follo...
by silene
January 3rd, 2011, 1:50 am
Forum: WML Workshop
Topic: Nested event mechanism, language principles
Replies: 24
Views: 3271

Re: Questions about event mechanism

The term "delayed variable substitution" confused me. I always thought the variable substitution must be done at the moment the concrete line of the code is processed. It does. And in the case of a nested [event], the time the lines are processed is the time the event is created. (In orde...
by silene
January 1st, 2011, 5:52 pm
Forum: Lua Labs
Topic: Elvish_Hunter's Lua thread
Replies: 170
Views: 41455

Re: Elvish_Hunter's Lua thread

This time I made two tags directly from FutureWML: [advance_unit] and [transform_unit]. Note that there is a new function wesnoth.transform_unit in 1.9.4 that might be suitable for these tags. Unfortunately, I didn't have time to document it yet. (But it shouldn't be long now that I have finished i...
by silene
January 1st, 2011, 7:25 am
Forum: Developers’ Discussions
Topic: [engine] Generate black backgrounds for art on install?
Replies: 39
Views: 23093

Re: [engine] Generate black backgrounds for art on install?

I believe Kitty mentioned to me back in the day that a common practice of hers when downscaling portraits was to apply an Unsharp mask filter on the final 205x205 image. I don't remember whether any generic parameters were used or it was an ad hoc procedure. Theoretically, the cardinal theorem of i...
by silene
January 1st, 2011, 6:39 am
Forum: WML Workshop
Topic: Creating new unit statuses and getting them to show
Replies: 19
Views: 11951

Re: Creating new unit statuses and getting them to show

but can this be used also to simplify defining what that status affects and pershaps a default way of getting rid of it? That's orthogonal. The only thing that was missing for custom statuses was to display them the same way hardcoded ones are; so that's what I added. Everything else could already ...
by silene
December 31st, 2010, 7:15 pm
Forum: Lua Labs
Topic: Getting started with LUA
Replies: 10
Views: 3845

Re: Getting started with LUA

Reepurr wrote:I don't know how to name a string, and I think that's the only problem with my code (the name second_side is not defined anywhere...).

Code: Select all

local second_team = wesnoth.sides[cfg.second_side]
by silene
December 31st, 2010, 6:27 pm
Forum: Lua Labs
Topic: Getting started with LUA
Replies: 10
Views: 3845

Re: Getting started with LUA

Derived from [gold] and stuck in a scenario ([preload] event). All I've changed is gold to steal_gold to avoid identical functions. Looks like function wml_actions is only valid in core from the error message. Should I change it to local function and how do I change the name of inputs, e.g. side? T...
by silene
December 31st, 2010, 6:21 pm
Forum: WML Workshop
Topic: Preprocessor problem: a parameter inside a tag name
Replies: 4
Views: 749

Re: Preprocessor problem: a parameter inside a tag name

It looks inside a tag name the parameters are processed a non-standard way? Not really, the way they are preprocessed is the same as everywhere. (The preprocessor doesn't know what a tag is, it doesn't even know that [ and ] are special characters for Wesnoth.) I think your issue is that the parser...
by silene
December 31st, 2010, 4:24 pm
Forum: WML Workshop
Topic: Creating new unit statuses and getting them to show
Replies: 19
Views: 11951

Creating new unit statuses and getting them to show

It has been mentioned in the Lua changes for 1.9.4, but it might be worth advertising, especially since it doesn't really require any Lua knowledge. Let's suppose you want to define an "entangled" status (that is, an "entangled=yes" line inside the [status] tag of unit). How do y...
by silene
December 29th, 2010, 5:31 am
Forum: WML Workshop
Topic: debugging an incorrect portrait
Replies: 4
Views: 741

Re: debugging an incorrect portrait

Almost all of the unit fields are correctly modified, but the "profile" field is not. It retains the portrait for the old HoRashti unit. I think this is a bug in the newfangled [modify_unit]. Any disagreement? The profile attribute is handled specially by the engine: if a unit advances an...
by silene
December 28th, 2010, 8:10 pm
Forum: WML Workshop
Topic: WML syntax - strange behaviour of "+"
Replies: 4
Views: 585

Re: WML syntax - strange behaviour of "+"

I have run some tests an it looks to me the algorithm that processes values is equal to this one: (?) quoted strings are identified all "+" outside quoted strings are deleted all "$" are processed 1 and 2 happens at load time. 3 happens at execution time. I expected parentheses ...
by silene
December 28th, 2010, 5:15 pm
Forum: WML Workshop
Topic: WML syntax - strange behaviour of "+"
Replies: 4
Views: 585

Re: WML syntax - strange behaviour of "+"

SlowThinker wrote:Why is aux4 empty?
Because "$my_var"+"Two" is the same as "$my_varTwo".
by silene
December 26th, 2010, 9:57 pm
Forum: Faction & Era Development
Topic: ATBX: experimenting with time in 1.9.X; v. 0.2.6 released
Replies: 6
Views: 2315

Re: ATBX: experimenting with time in 1.9.0

I'm not going to get into themes, but I could add the current actual turn to the queue display. With the 1.9.4 engine, you can modify themes more easily. Adding the following lines near the start of the atb-utils.lua file does fix the turn count: function wesnoth.theme_items.turn() return { { "...