Several of our mainline campaigns are in the works for upgrades at the moment, which includes adding characters and enhancing existing scenarios. We are looking for more artwork to supplement these upgrades, including the following:
5 portraits
Female Captain (Mari)
Asheviere - 4 variations
4...
Last post
Viviziz wrote: January 12th, 2026, 6:20 pm
I would like to contribute, but i'm not sure if my art style is... alike to general Wesnoth's. Is it ok? Should I try? Where to sign?)
I'd start by posting in the "Art Workshop" forum, and then if people think it's mainline-quality, you can move to the...
We are happy to announce that Wesnoth is now able to accept donations on Liberapay. While Wesnoth does rely on the work of dedicated volunteers, no project can function completely cost-free. Revenue from the Apple App Store and from donations goes towards maintaining our servers,...
Last post
It looks good at the bottom since the page isnt too long; i had no problem finding it.
There have been numerous important forum posts and wiki articles written by users and developers. We reference these pages a lot, and decided to put them together in a convenient list. ------
Write clearly, be nice to others, and be very careful when posting anything related to politics or religion. When asking for help, remember that everyone here is a volunteer. Prefer editing your previous post over double posting. No animated avatars or graphical signatures. Don’t plagiarize...
Last post
The Community Guidelines have been updated.
The Moderation section has been expanded to cover Discord moderation issues.
Hello,
I'm developing a random map generator for my campaign. It's currently over 3000 lines of Lua code and probably not a very well-optimized at that. As I try to add a new feature to it. I'm going into the situation, where Wesnoth hangs on map generation. The window stops refreshing. When I call...
Last post
I think I have found the problem. I made a mistake when setting metatables for my internal objects, apparently creating a reference cycle between my prototypes. That was most likely the source of the issue. It explains why Wesnoth choked when trying to display these objects or call their methods....
Hello,
the EventWML documentation describes allow_undo and on_undo direct action tags. However, there seems to be no equivalent for them in the LUA API, wesnorth.game_events.add and wesnoth.game_events.add_menu don't mention any option of allowing undo. wesnoth.game_events.add_repeating does have...
Last post
I think experimental means it's kinda ready to be used but not guaranteed to be stable. So, it should be fine to document it, with a warning note.
Hi, Still playing with the forest animals micro ai and am rather lost after some progress. The following test setup was merely to check I was capturing correct data and it sent me down a rabbit hole.
Yes, it is basically [store_unit] and I have a cutdown version that works. Here though I have ...
Last post
Soliton wrote: August 29th, 2025, 5:18 pm
Not sure I understand fully but this means you still want to trigger whatever action from wesnoth.game_events.on_mouse_action and thus there is no change in issue?
Mmm, kinda thought that'd be the case, I was hoping that only responding to a single mouse...
Hello, As a project I've decided to try and create a new micro_ai. I did have quite a bit of the logic below working using WML but my implementation was messy and inelegant, hence an attempt at a purely lua implementation.
Below is a breakdown of the proposed logic.
All thoughts and comments...
Last post
Celtic_Minstrel wrote: May 25th, 2025, 9:31 pm There is a way to make CAs without a location= parameter... Personally, I don't really recommend trying to consolidate the whole thing into one file like this, but it is at least theoretically possible to achieve.
This is my fifth add-on, Gui Debug Tools. It is written completely in Lua. Current version is 0.10.6 for the 1.18 series. First released for BfW 1.13.5.
I have found the tools in this add-on useful in making bug reports and developing add-ons.
Hey, I'd like to animate two units, switching their places, in standart time rate, (which is 200ms) This code almost works, except the animator:add(u, "movement", "hit",{with_bars = false}) part takes 500ms (because some units do have longer animation, which is played over more tiles), resulting in...
Last post
Celtic_Minstrel wrote: April 23rd, 2025, 2:58 am
Sadly, this is unsupported. Even #9487 wouldn't enable what you want. Maybe you can get the desired effect via some complicated workaround but I'm not sure how you'd go about that.
I don't see why resolving one unit weird movement animation,...
Pentarctagon wrote: April 1st, 2025, 5:09 am Moved over to the Lua Labs.
Edit: Oops and thanks!
Basically I want a "nuisance" micro ai that gets in the way by moving its units randomly around the map, ignoring other units (be they friend or enemy)....
Last post
Celtic_Minstrel wrote: April 16th, 2025, 6:09 pm
... So yes, I'd use the full path to the file, relative to ~add-ons.
Brilliant - that's what I'd hoped; just wanted to be reassured that the lua environment knew about the addons relative path.
Not 100% sure of syntax lua expects ( e.g....
Hi, I so often need to extract the x,y of a unit that I decided to write a quick WML inline hack to do this. It works as expected except for units on recall.
Here's the relevant code: This all works fine ($gux and $guy return values expected) except for recall.
Ideally I'd like to:
Allow the...
Last post
Just thought I'd post the latest version as there's been several changes:
Changed tag to [get_uxyid] - but if anyone has a better name I'd appreciate it. Returns x,y,id in the gu array.
Returns an array of units found and length indicates number found (so length=0 means no matches).
About the [teleport] function. I believe this is the code of the teleport tag.
Would anyone here be able to create a teleport code that could teleport more than one unit at the same time? Similar to the [animate_unit] tag, where we can animate multiple units at once using [animate].
Hi, During playtesting got this error, I use the goto micro_ai a lot in this scenario and it's never given me any problems. The relevant lua is I am continually tweaking code but haven't changed the micro_ai stuff recently. If I can reproduce it I'll post details here. Apologies but when error came...
Last post
Thanks for the suggestion, much appreciated.
Cheers!
-- Spannerbag
I've working on a mod that's allows it's players to place down different marks on the battleground's tiles. The KEY FEATURE would be to any player at any time could place any marker at any tile trough the context menu. I'm trying to achieve similar behaviour to the built in Set Label or Clear...
Last post
Since it turns out that it does let them fire it outside their turn, then you can probably somehow get it to work, though it might be quite tricky. I'm not sure if there's a way to directly fire a synced event when it's not your turn, but even if that's not possible (which seems likely), you should...
Apparently, you do this through wml.array_access.set, but it doesn't work, not creating new WML variables and not modifying exiting. What am I missing?
Last post
wml.variables['coordinate_list[' .. i .. ']'] = {x = loc[1], y = loc[2]} worked, thank you both!
Units that fly, according to [movetype] flying = yes [/movetype], should have a unit.flying variable. For me, in this circumstance, it does not appear. The code below triggers with gryphons, bats, gliders. And "unit.flying" never appears.
Last post
Celtic_Minstrel wrote: November 6th, 2024, 6:56 pm
Are you using version 1.18.x? If I recall correctly, unit.flying was added in 1.19.x.
I think you're right. I though for sure OP would need to use unit.__cfg, but I tested it (on 1.19) and it worked for me.
The most common use of event data is to pass in the weapons for an attack event - to do this, add a primary_attack and secondary_attack tag to the config. Other...
Last post
Oh, thanks
Btw primary_attack should be defenders weapon in die event.
This code gets called whenever attack starts (to turn on) and ends (to turn off): The problem: During the attck, unit will still use their normal accuracy, meaning they miss attacks, AND after the attack it says on their weapon "-100%", so they can not hit anything. The intention is that the code...
Last post
It turns out that the problem was a part of another code I made which nullified damage, making it look like it missed.
Everybody, thanks to your advice and courageous encouragment, I now bear witness to the world to the add-on to define an era:
I noticed that effect apply_to="attack" increase_accuracy=1000 and also set_accuracy=100 both get overwritten by marksman/etc. So they have 60% chance instead of 100%. Is there, a solution?
What is there out there?
Last post
I don't have an exact implementation for you, but you should be able to use the `[overwrite]` key of the `[chance_to_hit]` tag:
Hi, my code here: The error says that "weapon" is a nil value. It also said so if i "data" is a nil value i tried "ctx.data.weapon.damage". Can somebody help mE?
At this point, I simply detest trying to get anything to line up nicely in a gui. After countless hours of error and trial, I've come no closer to having even a theory about how this stuff works.
I have two lists of units. In the right column, a header and a list of units on the recall list. It's...
Last post
For item 2, you can use a stacked_widget with an invisible image layer set to the minimum size you want to reserve, then put your widget on top of that. Or look at the size_lock widget.
hi, I am trying to iterate over the modifications of a unit to get a specific modifications (trait) but I got an error "except a lua or wml table but get unit". how to fix that? and if someone can tell why is it wrong?
Last post
hermestrismi wrote: August 23rd, 2024, 9:56 am
thanks. I'll try it. may I ask if this is the best way to serialize a table (so that it became surely persistent upon reload)?
In Wesnoth 1.18.2, in my scenario WML, for some sides I have the following variables section: When I'm trying to access these variable from a LUA script, this seems to work, although not exactly like the documentation describes it. https://wiki.wesnoth.org/VariablesWML#T ... les.5D_tag states that:...
Last post
Thanks for the pointer, I think I've figured it out now.
I have a list of weapons_specials on wml and I want to call them to a unit:add_modification using is 'special_id sufficient in such case or I need to recreate all tags inside [abilities]?
Last post
You don't need to recreate the tags in Lua form. You can use the WML preprocessor to forward the official definitions directly to the script.
hi. I am trying to convert my droppable potions system from wml to lua. I used on_event context. I noticed that the items (image + table to store locations) are persistent between turns but disappear when I use reload turn. did someone have a clue about that?
Last post
hermestrismi wrote: July 21st, 2024, 5:24 am
is there any exemple (commented for steps and details) that can help other than the one in the wiki?
There are some examples in core, I believe
hermestrismi wrote: July 21st, 2024, 5:24 am
and what if I on_event to create a preload_event just like the...
I am surrounding. can someone provide me with a function to check if a unit can advance to another unit or to null?
I tried many different methods but I am stock.
Last post
I dont like the design choice to solve the problem with glob, but result sounds correct. After all, if all responsibility is given to [filter], formula looks easier to read.
Hi,
In [resistance] tag I can access current unit and current weapon using WFL, which is great
...
BUT I don't know how to compare those two variables, because weapon object is only accessible in [filter_weapon],
which is the only place where unit object is hidden (overwritten with weapon...
Hi,
I'd like to simulate upcoming combat in the attack event.
And the wesnoth.simulate_combat requires attacker_weapon_index.
Any idea how to get it from weapon?
Thanks!
Last post
white_haired_uncle wrote: June 27th, 2024, 3:23 pm
This has always bugged me (attacks vs [attack]+), though I can't quite put a finger on it. It's just [attack] in [unit] or the gamestate_inspector, so if I didn't know any better, where would I come up with unit.attacks[x] ?
Hi, I'm trying to make a version of [message] that can accept a list of unit ids to simplify (remove) WML to winnow down choices. The first unit in the list that exists on the map issues the message then the routine quits. If no unit is found it does nothing (like normal [message]).
Ideally in...
Last post
Thanks for all your help, much appreciated.
Y'know I'm going (more) crazy; I thought I'd tested id=id1,id2... in [message] and thought it failed.
However tried again just now... and it worked.
I much prefer working in WML if possible so I'll stick with [message] with multiple ids for now.
I'll se...
Hi,
How to animate my "combat" (abilities) same way the real combat is animated (with that sliding health decrease)?
Thanks
Last post
Celtic_Minstrel wrote: June 3rd, 2024, 12:48 pm
That seems like something that might not be possible, unless the slide automatically occurs any time you set health.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum