Search found 1214 matches

by Spannerbag
September 4th, 2026, 10:16 am
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Re: Feasibility of customising return guardian micro ai


...So instead of writing this:


return_loc_uv[1], return_loc_uv[2] = guardian_uv.variables.return_guardian.return_x, guardian_uv.variables.return_guardian.return_y


You could write this:


return_loc_uv = { guardian_uv.variables.return_guardian.return_x, guardian_uv.variables.return_guardian ...
by Spannerbag
September 3rd, 2026, 4:26 pm
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Re: Feasibility of customising return guardian micro ai

Well, got it working much quicker (and more easily) than expected. ^_^

Not exhaustively tested but seems to work as expected plus no errors. :shock:

Only niggle was lua didn't like testing for the nonexistence of a variable inside a nonexistent container (fair enough I suppose) so I just tested ...
by Spannerbag
September 2nd, 2026, 8:28 pm
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Re: Feasibility of customising return guardian micro ai


...I'm not sure exactly what you have in mind... I would probably recommend just creating a new function...


Heh, at first glance your structure does pretty much what I was trying to express - and in a more elegant way.
To me, it does the same basic thing: assign the unit's return values to ...
by Spannerbag
September 2nd, 2026, 3:07 pm
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Re: Feasibility of customising return guardian micro ai

Hi,
making progress but have a couple of queries.

None of this has been tested yet , responses to this post will determine if I test current code or mess things up even further simplify (if sensible) first

First I created a new mai return_guardian_uv ( _uv for unit variables ).
-- mai_return ...
by Spannerbag
September 1st, 2026, 2:22 pm
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Re: Feasibility of customising return guardian micro ai


Custom unit variables should be in guardian.variables :

https://wiki.wesnoth.org/LuaAPI/types/unit#Unit_sub-tables

Forgot the "variables" bit. :doh:



...If you're using x and y values and you just want to check that they are valid, you could use wesnoth.current.map:on_board(x, y) .

https ...
by Spannerbag
September 1st, 2026, 9:49 am
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Re: Feasibility of customising return guardian micro ai

Having done a tiny bit of digging myself I'd come to a very similar conclusion; basically extend the existing logic by having the return guardian micro ai work as it does now plus enabling unit specific return x,y values that override the "global" values return_x,return_y / return_loc .

So in both ...
by Spannerbag
August 31st, 2026, 10:55 am
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Re: Feasibility of customising return guardian micro ai


You'll probably need to create your own AI eventually anyway then?...

Thanks for the info, I have several options and am presently scoping out the complexity of each.
Ideally I would - at present anyway - prefer to have a custom/micro ai solution as I feel this would maximise gameplay interest ...
by Spannerbag
August 30th, 2026, 6:55 pm
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Re: Feasibility of customising return guardian micro ai

Thanks again for the advice, much appreciated. :D

I think I'll look into multiple mais first as this seems the saner approach.

Cheers!
by Spannerbag
August 30th, 2026, 5:32 pm
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Re: Feasibility of customising return guardian micro ai


to specify different return_x,return_y for each unit?

Yes, this is possible.

Great - just to be crystal clear the only code I need to change is the stuff I posted and nowhere else (i.e. there are no dependencies)?



(other than defining multiple micro_ais) of doing this?

This is the way ...
by Spannerbag
August 30th, 2026, 3:56 pm
Forum: Lua Labs
Topic: Feasibility of customising return guardian micro ai
Replies: 16
Views: 215

Feasibility of customising return guardian micro ai

Hi,

Is there a way to customise the return guardian micro ai to specify different return_x , return_y for each unit?
And, maybe, tweak the behaviour (not sure until I playtest which is a long way off :( ).

Here, I presume, is the relevant code:
function wesnoth.micro_ais.return_guardian(cfg ...
by Spannerbag
August 24th, 2026, 10:43 am
Forum: Technical Support
Topic: Reproducible crash on v1.19.27
Replies: 12
Views: 263

Re: Reproducible crash on v1.19.27


...If you want to provide feedback ... developers seem to mostly use Discord these days and rarely (or never) use this forum.

Mmm, I've noticed a few "regulars" seem to have stopped posting. Maybe they're now only active on discord ... or they've moved on.
Oh well, I'll give discord a try ...
by Spannerbag
August 23rd, 2026, 12:47 pm
Forum: Technical Support
Topic: Reproducible crash on v1.19.27
Replies: 12
Views: 263

Re: Reproducible crash on v1.19.27

Thanks for taking the trouble to compose and post these logs, much appreciated.
Sadly didn't have time to read in detail all your posts (might get chance during coming week). :fingers_crossed:
However I understand, to some extent, the pressures that underpinned the discussion and decision, but ...
by Spannerbag
August 22nd, 2026, 12:00 pm
Forum: Technical Support
Topic: Reproducible crash on v1.19.27
Replies: 12
Views: 263

Re: Reproducible crash on v1.19.27


...No, they actually changed it...

...If you delete your preferences file, then restart Wesnoth, you will see that the "Default RNG" is no longer the default RNG ... let me rephrase that ... the "Reduced RNG" is the default RNG, not the "Default RNG" ... let me try one more time ... the initially ...
by Spannerbag
August 21st, 2026, 11:19 am
Forum: Forum Games
Topic: Word association
Replies: 1329
Views: 290666

Re: Word association

squash
by Spannerbag
August 21st, 2026, 11:12 am
Forum: Technical Support
Topic: Reproducible crash on v1.19.27
Replies: 12
Views: 263

Re: Reproducible crash on v1.19.27


It appears that "Default RNG" is no longer, in fact, the default. :doh:

:D
Also seems that for SP you pick the RNG you want at the start of the campaign then that's it; there doesn't seem to be a way to change it.
Neither does the game report what RNG is active - but I didn't dig into ...