Search found 1103 matches
- September 9th, 2026, 12:51 am
- Forum: WML Workshop
- Topic: regen with filter not working
- Replies: 9
- Views: 98
Re: regen with filter not working
Good point: that'll be my plan B if I can't get this to work with unit variables - but it'll make things more complicated sadly.
Well, yes, all units are basically containers, but I wasn't suggesting avoiding unit variables altogether; what I meant was that return_guardian.return_x is probably ...
- September 9th, 2026, 12:39 am
- Forum: Lua Labs
- Topic: Feasibility of customising return guardian micro ai
- Replies: 23
- Views: 361
Re: Feasibility of customising return guardian micro ai
Is it possible for the same unit to be processed multiple times by a micro ai?
If so then yes I suppose it could happen.
In general, the evaluation function will keep getting called over and over again until it returns a score of zero.
Bit doubtful tho' TBH because this issue only arises ...
- September 8th, 2026, 11:10 pm
- Forum: Lua Labs
- Topic: Feasibility of customising return guardian micro ai
- Replies: 23
- Views: 361
Re: Feasibility of customising return guardian micro ai
What about if they don't have any moves remaining?Spannerbag wrote: September 8th, 2026, 11:03 pm Hmm, pretty sure it should find both the test units as they would both have full moves (created side 1 turn 1 but in side 3 so would have a turn refresh before being controlled by micro ai).
- September 8th, 2026, 11:05 pm
- Forum: WML Workshop
- Topic: regen with filter not working
- Replies: 9
- Views: 98
Re: regen with filter not working
I suspect this would work better if you just used simple scalar variables instead of container variables, since Wesnoth tends to get confused if you try to do complicated stuff with container variables.
- September 8th, 2026, 9:38 pm
- Forum: Lua Labs
- Topic: Feasibility of customising return guardian micro ai
- Replies: 23
- Views: 361
Re: Feasibility of customising return guardian micro ai
I guess this is complaining that line 12: if guardian_u.variables.return_guardian then references an empty guardian_u ?
Yes, AH.get_units_with_moves() might not return any units. In that case guardian_u will be nil . You need to check for this before trying to do anything with guardian_u .
- September 4th, 2026, 5:36 pm
- Forum: Scenario & Campaign Development
- Topic: The Fellowship of the Clay [1.18+]
- Replies: 41
- Views: 966
Re: The Fellowship of the Clay [1.18+]
Well, his lab is named Kal Alamos, and he seems to have an interest in light sources (radiation).
- September 4th, 2026, 3:51 am
- Forum: Scenario & Campaign Development
- Topic: The Fellowship of the Clay [1.18+]
- Replies: 41
- Views: 966
Re: The Fellowship of the Clay [1.18+]
Huhhh, I should fix Feyndwarf dying. I wonder why that doesn't trigger. Does hp reduction damage not count as death or something???
It might have something to do with the [kill] tag using fire_event s =yes but the documentation says it should be fire_event=yes.
I find it funny that they just ...
- September 3rd, 2026, 4:49 pm
- Forum: Lua Labs
- Topic: Feasibility of customising return guardian micro ai
- Replies: 23
- Views: 361
Re: Feasibility of customising return guardian micro ai
Only other minor query: I've not been able to find the internal structure of loc so guessed at how to assign return_loc_uv the relevant x,y values - is there a better way than what I did (line 6 of code below)? Just curious. :)
local function get_guardian_uv_xy(cfg, guardian_uv)
local return ...
- September 2nd, 2026, 7:39 pm
- Forum: Lua Labs
- Topic: Feasibility of customising return guardian micro ai
- Replies: 23
- Views: 361
Re: Feasibility of customising return guardian micro ai
However the thought occurs that a simpler method would be to simply reassign return_loc in get_guardian_uv if valid (on map) locations are specified in the current guardian_uv .
This would be passed back as a return value to overwrite the value specified in the definition.
As these are local ...
- September 1st, 2026, 12:57 pm
- Forum: Lua Labs
- Topic: Feasibility of customising return guardian micro ai
- Replies: 23
- Views: 361
Re: Feasibility of customising return guardian micro ai
Test unt variables, if either is null/undefined fallback to default/global values.
Presumably these values would be visible in lua as guardian.return_guardian.return_x and guardian.return_guardian.return_y ?
Custom unit variables should be in guardian.variables :
https://wiki.wesnoth.org ...
- August 31st, 2026, 9:27 pm
- Forum: Scenario & Campaign Development
- Topic: The Fellowship of the Clay [1.18+]
- Replies: 41
- Views: 966
Re: The Fellowship of the Clay [1.18+]
Harriett's teleporting ability includes this code:
#define HARRIETT_TELEPORTING
[event]
name=start
[set_menu_item]
id=harriett_tele_unitchoose
description= _ "Teleport this unit"
[filter_location]
[filter]
[filter_adjacent]
id=Harriett Porter
[filter_wml]
moves=6
[/filter_wml ...
#define HARRIETT_TELEPORTING
[event]
name=start
[set_menu_item]
id=harriett_tele_unitchoose
description= _ "Teleport this unit"
[filter_location]
[filter]
[filter_adjacent]
id=Harriett Porter
[filter_wml]
moves=6
[/filter_wml ...
- August 31st, 2026, 3:17 pm
- Forum: Lua Labs
- Topic: Feasibility of customising return guardian micro ai
- Replies: 23
- Views: 361
Re: Feasibility of customising return guardian micro ai
However I'm not sure the additional effort is worth it given I can employ other implementations that would be a lot easier/simpler if also less close to what I envisage. :?
It wouldn't be much additional effort since you would just copy the entire ca_return_guardian.lua file to your add-on ...
- August 31st, 2026, 2:27 pm
- Forum: Scenario & Campaign Development
- Topic: The Fellowship of the Clay [1.18+]
- Replies: 41
- Views: 966
Re: The Fellowship of the Clay [1.18+]
Also in "Bad News" is this code:
But the image filename is named "Cscroll.jpg" so the image does not display.
Code: Select all
[story]
[part]
background="data/add-ons/The_Fellowship_of_the_Clay/images/Story/CScroll.jpg"
fade_in=yes
fade_out=yes
[/part]
[/story]
- August 31st, 2026, 6:41 am
- Forum: Scenario & Campaign Development
- Topic: The Fellowship of the Clay [1.18+]
- Replies: 41
- Views: 966
Re: The Fellowship of the Clay [1.18+]
This is the code in the scenario "Bad News":
[store_unit]
[filter]
x=14
y=10
[/filter]
variable=stored_outpost
kill=yes
[/store_unit]
...
[unstore_unit]
variable=stored_outpost
find_vacant=yes
[/unstore_unit]
Isn't that code going to generate an error if there's no unit at x=14 y ...
[store_unit]
[filter]
x=14
y=10
[/filter]
variable=stored_outpost
kill=yes
[/store_unit]
...
[unstore_unit]
variable=stored_outpost
find_vacant=yes
[/unstore_unit]
Isn't that code going to generate an error if there's no unit at x=14 y ...
- August 30th, 2026, 7:08 pm
- Forum: Lua Labs
- Topic: Feasibility of customising return guardian micro ai
- Replies: 23
- Views: 361
Re: Feasibility of customising return guardian micro ai
And, maybe, tweak the behaviour (not sure until I playtest which is a long way off :( ).
You'll probably need to create your own AI eventually anyway then?
The Micro AIs are really just some pre-defined behaviors with a limited number of tweakable parameters... I think if you really want to ...