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:
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.
You are welcome to post any WML-related question here, even if they pertain to a campaign or map that you're working on.
If this is you:
"How do I..."
"Can you help me debug..."
"In my campaign, I am trying to..."
"On my map, I want to..."
"Can you add the following to WML..."
"I need help...
Last post
There is also a partially-complete WML Tutorial which would be helpful to the WML newcomer. Note that it is a work-in-progress and that some sections are more complete than others, but it does exist. The ReferenceWML page, while extremely helpful to those who already understand WML, can be...
Does you campaign produce obscure WML errors on startup and you don't know what line in your 2000 lines of WML causes it? Instead of going through everything line by line and try to spot the mistake you've made, or before posting your entire campaign on the forums in the hopes that someone wants to...
Last post
totally YMMV
i used grok a lot to learn the Wesnoth map editor ("Where is..." "How do i...") and that worked great
for example: How do I make a map description that shows up in the multiplayer screen and not just on the addon server
and it told me in so many words "do that in the file dude doh!...
Here you can find configuration files to enable WML syntax highlighting for various text editors :
Gedit (and other Gnome based editors): Has full WML support and partial inline lua support. wml.lang goes in /usr/share/gtksourceview-3.0/language-specs. cobalt-wml.xml goes in...
The purpose of this thread is to provide links to particularly useful information and code examples of WML and Lua on the wiki, without cluttering up this forum with more and more stickies. As such, the wiki pages linked here should be kept working and up to date - if an unmodified piece of...
Last post
Saratos wrote: May 31st, 2018, 1:56 am
Would love if there was a link to a thread on "Balancing" maps/factions/etc.
not sureifyou have found this already, but here is a guide on faction design/balancing as you requested
People often use WML attribute or tag names that are misspelled or just plain fictitious when trying to debug WML — or even tag structures that (to the trained eye) are logical to the writer but have no basis in reality. You should always look up the proper format first, and we have a dedicated...
I've got a strange issue with a cumulative [illuminates] ability: It doesn't accumulate in the dark...
Imagine a unit which illuminates (mage of light), standing besides another which has a special cumulative illumination*. When outside (daylight), lawful units affected by both indeed display the...
Last post
I already posted what cumulative is documented to do.
I've made a couple campaigns (initially for 1.12, now ported to 1.16) and am considering switching to 1.18. But I'm not sure I understand the new add-on structure and its "ID".
Given all my campaigns happen in a specific non-Wesnoth universe with dozens of custom units, I definitely see the...
I'm looking at writing a campaign and in one scenario an ally can recruit a variety of units but I want the shocktroopers to essentially remain castle guards and not cross the moat (the castle is surrounded by water with some bridges). Is the best way to achieve this with a custom unit (modified...
I have been working on my campaign and when I am playtesting it, seemingly randomly, the oponents units get their max hp reduced to 4 (though I think it is just 10% of their max hp, since other enemies have 5 or 6 hp).
I have noticed this phenomona after I have implemented a system that...
Last post
Alternatively, I guess you could also just give the object an id, and specify take_only_once=yes.
This might be is probably me but while testing some new code some errors appeared in the logfile.
They didn't affect gameplay but I dislike clutter so tracked them down.
The logic is rather gnarly; I'm mangling units involving the following operations:
Adding/removing AMLAs...
Last post
Mmm, I think I'll just bung the events elsewhere (outside abilities and specials), otherwise if I came back to the code in six months time I'd not understand what I'd previously done!
Thanks for explaining the situation tho', really appreciated!
it seems weird that, for some reason, the pre-attack calculation does not simply use the actual HP for the calculation (well it does) but seems to cap it off at max HP, if for some reason if the HP is higher than that.
so all calculations with HP higher than max HP are wrong and there is...
Last post
I mean the feature that unit is not capped to max hp regularly.
Hello,
I'm trying to create a campaign. But despite numerous checks, the first scenario never loads. The campaign displays correctly with the others, and I haven't noticed any typos. Could someone please help me?
Last post
chaos_chicken wrote: June 29th, 2026, 1:27 pm
Hello,
I'm trying to create a campaign. But despite numerous checks, the first scenario never loads. The campaign displays correctly with the others, and I haven't noticed any typos. Could someone please help me?
Hi,
I have code that detects when an attacker makes the first strike (only).
E.g. a spearman has 3 melee strikes so I want to do something on the first strike (of 3) only.
However it involves events and unit variables and seems a bit klunky so I'm wondering if there's a better way?
Maybe something...
Last post
Ravana wrote: June 24th, 2026, 12:06 pm
You can use normal variables if you want.
But you actually can use first_time_only=yes by having attack event create event about attacker hits/misses.
1)
i see a side can have multiple leaders at once "now" (well, its been implemented for a few years now, but i just realized )
Question:
- how is the recruitment process distributed among those leaders. will they recruit in an automate alternating procress usin...
Last post
Regarding Question 1 i think i have found something in the WIKI:
Some notes on multiple leaders
The new recruitment CA is able to recruit with multiple leaders — even with different recruitment lists for each leader. However there are some drawbacks:
Just need to check I understand this correctly.
If an attack has movement_used=0 I assume this only benefits skirmishers?
If a non-skirmisher has an attack with movement_used=0 then from my admittedly limited testing on 1.19.24 (Windows) it appears that the attacking unit still has moves set to 0...
Last post
Ravana wrote: June 14th, 2026, 5:09 pm
You probably want it not first time only. Also if you want it as real event then you should use filter_weapon to find out if current attack has special.
It was working all the time, my [message] had an out of date speaker.
Thanks for taking the trouble t...
I want that a unit stays at place without moving, and after it gets attacked there should be an text message and then he could move but doesnt have to (normal unit behaviour like). Sadly, I found right now no campaign who posses such traits, there is 100% an official campaign who has it, but I dont...
Last post
Thank you Spannerbag, you helped a lot but also Ravana. With you it gets a lot easier to make my own Campaign
I programmed that a unit goes from one tile to another, but it faces at the destination tile in the wrong direction, it should face north/west, but it always faces nort/east. What code should I implement to let him face the right direction? Here is the Code btw:
{MOVE_UNIT id=Maugrad 4 16}
...
Some user on Steam Forum asked the following question. I don't want to step in on Steam forums before the devs, but perhaps it is worth responding.
Is this possible to do through debug? Is this possible to do via WML, just copying and pasting a line or code or something similarly...
Last post
The add-on "Side Color Changer" is doing the trick. I have also checked Ravanas color changer, but it has a different approach. I've answered op on steam, so this questions is answered and maybe now will be used to train an ai to answer this question in the future ^^.
For a scenario of a campaign I am making, I want one side to "foolishly defend" the exit hex of the player.
Basically, the victory condition is that the player character must move to a specific hex on the map. An enemy side's leader has a keep+encampment a short distance from this exit hex.
What...
Last post
I have done something like that recently. There were two instances, where I needed the AI to block the hexes from the player no matter what. At the end I decided to fool-proof the script by removing the micro_ai's entirely.
Consider the following: I assume player side is 1, the enemy side is 2 and...
Hello, If I use [effect) ] to apply a variation to a unit this seems to lose any existing [effect]s based on my limited testing.
Hopefully I'm doing something stupid so here's my test code that adds a second melee attack: ... and the variation (long version, I've tried trimming various elements).
Last post
I missed the [advancement] mention in [modify_unit]'s wiki.
WIll give that a try when I get chance (hopefully this w/e ).
Thanks for the advice, much appreciated.
Cheers!
-- Spannerbag
Hi, Spent ages investigating unit variation not working as I expected on v1.19.23 on Windows.
Issue Created clone of Mage then added variation to same (added a melee attack). Worked OK for male version, didn't on female.
Relevant code 1: Apply variation 2: unit_type Resolution Works as expected...
Last post
Ah, hadn't realised that gender was implemented using the variation mechanism.
What I wanted to do was add another melee attack which does have gender based animations.
The only way I can see how to do this is as I've done it - but am more than happy to adopt a more efficient/elegant approach if...
Hello, I am currently trying to figure out the following macro. It works as intented until "name=side 2 turn $random" event included. However, at "name=side 2 turn refresh" it starts to fail substituting variables. The "current_{DIR}_spots" variable never changes; even though {DIR}_spots does get...
Last post
BajMic wrote: May 13th, 2026, 6:41 pm What is the rationale behind $|this_spot?
Ravana wrote: May 13th, 2026, 6:49 pm $| evaluates to $, so that next evaluation will see it.
Here's a really simplified example to illustrate the problem: If you run this, you will find that this_item_1 and...
Hi,
My campaign has several [event]s that can fire in (m)any scenario(s) so appear in _main.cfg.
Everything works fine, I'm just wondering if at what point it becomes more efficient/better practice to embed a macro into scenarios rather than have a global event?
I am here to ask the feasibility of a project I’m thinking about attempting in Wesnoth.
I am not a programmer or a modder, I have a very general baseline knowledge of coding and custom content.
Recently, I have run a game for my friends that I’ve been calling Realm.io. While run digitally, all the...
Last post
You know, the numbers there make it clear why using Wesnoth would be a bad idea, I guess that settles it for me haha
In all honesty, I may also outsource art to the players when the time comes, given that it is a highly community driven thing (something that I know Wesnoth enjoyers will fully...
Can anyone suggest some uses for macros? Have already got character, deaths and starting gold macros too. Was wondering if anyone knows some other macros that would be useful to know.
Is there any way in a unit's code to make them gain a certain amount of experience after every turn passes?
I'm trying to make an egg, and originally I based it off of the Ant Egg, however that unit hatches depending on factors that I do not want.
I wish for my egg to hatch after a certain amount...
Last post
if you want all units, then just use the addon which gives free xp
Recently I have been very interested in coding an add-on for Wesnoth. I am quite new to coding still and was wondering if anyone could enlighten me on the subject of AI involvement in the creation of add-ons. Is AI completely banned in any way from helping with code or are you allowed to...
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