Search found 1271 matches

by white_haired_uncle
Today, 1:41 pm
Forum: Lua Labs
Topic: units on the recall list
Replies: 8
Views: 201

Re: units on the recall list

I'm reasonably sure that I need to serialize at some point, and AFAIK there's no list of exactly what is available from just unit vs unit.__cfg (what do you call that anway?). It's kind of become a habit since the performance hit, which I've never been able to notice, is nothing compared to the amou...
by white_haired_uncle
Today, 2:05 am
Forum: Lua Labs
Topic: units on the recall list
Replies: 8
Views: 201

Re: units on the recall list

Code: Select all

        local unit = wesnoth.units.find({ id = unit_id})[1].__cfg
        local unit2 = wesnoth.units.find({ id = unit_id})[1]


unit.valid == nil
unit2.valid == map|recall
by white_haired_uncle
Today, 1:59 am
Forum: Lua Labs
Topic: units on the recall list
Replies: 8
Views: 201

Re: units on the recall list

This seems to work, but now I'm nervous about it breaking in the future. As the valid documentation explained, you want if unit.valid == 'recall' . Right, but I'm getting nil for both units on the recall and on the map, and while the doc explains when I would see that, it doesn't make any sense to ...
by white_haired_uncle
Today, 12:55 am
Forum: Lua Labs
Topic: units on the recall list
Replies: 8
Views: 201

Re: units on the recall list

So, both units on the map and on the recall return nil. I looked into unit.valid: A unit can be either visible on the map (#wesnoth.get_units, #wesnoth.put_unit), or on a recall list (#wesnoth.get_recall_units, #wesnoth.put_recall_unit), or private to the Lua code (#wesnoth.create_unit, #wesnoth.cop...
by white_haired_uncle
Today, 12:34 am
Forum: Lua Labs
Topic: units on the recall list
Replies: 8
Views: 201

units on the recall list

It looks like wesnoth.units.get(id) will only find units on the map, correct? If this is the intended behaviour I'll add a comment to the wiki. So I switched to using wesnoth.units.find because I want to look at map and recall. Now when I'm done messing with the unit and I want to "put it back&...
by white_haired_uncle
Yesterday, 4:02 pm
Forum: Scenario & Campaign Development
Topic: Compatibility of previous add-ons with the current version
Replies: 6
Views: 246

Re: Compatibility of previous add-ons with the current version

Assuming this campaign has been abandoned, and I have no idea how to determine that, you might find a lot of good info here:

viewtopic.php?t=55180

You did notice that it is MP, so you won't find it under Campaigns, right?
by white_haired_uncle
Yesterday, 3:34 pm
Forum: Lua Labs
Topic: [unsolvable] Access event content
Replies: 9
Views: 278

Re: [unsolvable] Access event content

I don't know, I've never used them. But for those I was thinking about your question about 'how to notice when it's fired'. If you want to erase them (the events) and recreate them, you could: 1) Since you want to do this from lua, just write them in lua in the first place, save them as variables, a...
by white_haired_uncle
Yesterday, 3:13 pm
Forum: WML Workshop
Topic: multiple objects, overlapping effects
Replies: 2
Views: 92

Re: multiple objects, overlapping effects

You mean it will use whichever comes last?
by white_haired_uncle
Yesterday, 2:39 pm
Forum: WML Workshop
Topic: multiple objects, overlapping effects
Replies: 2
Views: 92

multiple objects, overlapping effects

If a unit possesses two objects, say abilities.leadership.value=15 and abilities.leadership.value=20, which one is selected? What about abilities.leadership.value=-15 and abilities.leadership.value=-20? Or abilities.leadership.value=-15 abilities.leadership.value=20? Does it make any difference who ...
by white_haired_uncle
Yesterday, 2:09 pm
Forum: Scenario & Campaign Development
Topic: Compatibility of previous add-ons with the current version
Replies: 6
Views: 246

Re: Compatibility of previous add-ons with the current version

Depends what you mean by "make it playable". You want to edit the code to bring it up to 1.18 compatibility, or just download the 1.14 version to your 1.18 install and hope it works? You might ask over here, though it doesn't seem to have seen much (un)life recently: https://forums.wesnoth...
by white_haired_uncle
Yesterday, 1:35 pm
Forum: Lua Labs
Topic: [unsolvable] Access event content
Replies: 9
Views: 278

Re: [unsolvable] Access event content

Hi, How to access event content via Lua? I'm pretty sure I don't understand what you are asking, but if you mean you want to access (read) events you've written in WML from lua, could the answer be as simple as just writing them in lua in the first place? Or some combination of wesnoth.game_events....
by white_haired_uncle
Yesterday, 8:35 am
Forum: Lua Labs
Topic: [resolution] problems
Replies: 4
Views: 123

Re: [resolution] problems

You can't use side 1 turn 1, or turn refresh, or one of those?
by white_haired_uncle
May 15th, 2024, 11:47 pm
Forum: WML Workshop
Topic: new campaign's questions and ideas
Replies: 13
Views: 355

Re: new campaign's questions and ideas

You're using attack end, I wonder if that happens before or after the unit is granted experience. If it's before, he'll have nothing to give on the first attack (or the third, fifth...). yes! thats whats happening, how could i fix that? I don't know that there is an event that happens "after a...
by white_haired_uncle
May 15th, 2024, 9:08 pm
Forum: WML Workshop
Topic: new campaign's questions and ideas
Replies: 13
Views: 355

Re: new campaign's questions and ideas

i made a unit for the orbs (Emperor zombie knight helped), it works well enough although it waits until a second attack is made in order to transfer xp to my mage unit... You're using attack end, I wonder if that happens before or after the unit is granted experience. If it's before, he'll have not...
by white_haired_uncle
May 15th, 2024, 2:26 am
Forum: WML Workshop
Topic: WFL conditionals and variable substitution
Replies: 9
Views: 249

Re: WFL conditionals and variable substitution

If I'm following this right, X - null = error, but null - X = X therefore X - (null - 0) = X [which of course, should mean that X - null + 0 = X -> X - null = X ] But, I think I might see what's going on. Using simple substitution: "X - $undefined_variable" = "X - ", which is inv...