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,...
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 other’s...
Is there a way to get a list of all units available for placement via , as well as the data contained within the ?
Or to put it another way, what I'm looking for is the programmatic equivalent of (for every unit in the game, as well as potentially any campaign currently being played): placing the...
I thought I'd ask if it's even possible before attempting to figure it out as learning exercise.
What's I was thinking about was a way to control the attack of a stronger unit when pairing strong and weak units to help the weak unit advance. If the strong unit stopped striking when that target...
This seems odd, but overriding the on_event in lua causes a bunch of blank lines to be printed every time a hex is highlighted by the mouse (Wesnoth 1.12.4 and Mac 10.10.4). Any idea on what is causing it?
Just by using that, not even printing anything, I see a lot of blank lines in the console....
I should start out by saying I barely know what I'm doing here, so this may be a stupid question, but is there some disconnect between what Lua can access and what is seen in :inspect?
But using :inspect, I can see there is an entry for the profile image for that unit
I can print a profile...
I have a few lua questions, but since I'm really new to it, these might be a little noobish. Ok here goes.
I have this huge pile of shop code dumped across multiple files that uses hundreds of variables, and I was hoping to find a way to simplify it with lua. SAMPLE:
I'm trying to return a WML table of tags from a lua function, the idea being that it's similar to splitting WML between files and then including them in a main file via:
has worked in the past in wesnoth lua even if the second line is left out, so that a table with something at = but nothing at = is created, according to the code I had written back then.
Wasn't there some strict lua kind of change ? I find a post from 06 Jan 2015 but that's...
Sorry to take your time, I have googled hard before writting here.. (Wesnoth version 1.10.7)
Anyone could tell me the lua codes for adding and removing labels? (partuicularily team labels)
if you have full information please include also lua commands to change label from show to team only into...
Today I merged a feature to master which allows to write random map generators in lua. I hope that this will make it much easier to develop and distribute random map generators, since they won't need to be written in C++ or tied to the release cycle.
To use it, select either map_generation= lua or...
I'm looking for something like a pre-moveto event. I want to fire an event based on a unit's target hex (like moveto), but I want the event to fire as the unit starts moving instead of at the end of its move. Is there a way to do this?
I'm working on a campaign written almost entirely in lua, and so having data available as pure lua tables is very useful. However, they should be pure lua tables, not userdata, since I also use lua table serialization for my savegames .
It seems that wesnoth.copy_unit might do this, but I'm not...
I decided to write some lua hooks which will, for example, let you read mp_era, get a list of currently active modifications, and some other things. (Previous feature requests here , here ). My proposal is now a github pull request . But I wanted to explain what it is here and solicit...
The wiki claims that units will be stored in order of their internal underlying_id attribute by . That is currently not true with the tag coded in Lua and can cause units to be stored in different orders in the same situation. That, in turn, can lead to OOS errors when orders are different between...
ModularLua is meant to make it easier to develop Lua for Wesnoth add-ons by providing high-quality, decoupled utilites. Currently provides streamlined dialog creation, scenario tag support, and a debug shell with history, among other features.
There are two ways to install ModularLua. You can...
This is my goal:
After a multiplayer game starts, the AI has its recall list enabled (via a MP Mod), to which certain generated units can be placed in the list for the AI to recall.
This is my obstacle:
For any side to have a recall list, the side's persistent variable must be set to yes /true,...
So I am trying to make a mod that reduces random damage deviation in Wesnoth. The idea is, before every attack I calculate a sequence of chances that will override literal chances of hit for every hit, so that the randomness distribution can be limited.
This is relevant for this sub-forum too. If cross-posting is not allowed, please modify this post and delete the rest of the text, but leave this link: (I can do the modifying if you want me to).
I want to do a lua mod that works with all new versions of Wesnoth. Where is a good place to start,...
hi i have a problem:
i use wesnoth.game_events.on_event and wesnoth.current.event_context to handle events, worked very good so far.
but now i have a problem:
in the enter_hex events the location of the unit and the location where the event is trieggered is not aways the same.
i think...
In short: when your leader dies, an another unit from a pre-defined list takes the mantle and you can fight on. If there's no one left alive from that list, a specific event is called. It's up to you what to do then: proceed to defeat or switch to an another scenario with a spare set of heroes...
hi i wrote a scenario that uses a lot of lua and also some gui2 codes.
the problem is that when i see the replay. the replay shows me the gui2 dialog.
and because the dialog influences the game, the replay will be detroyed if i dont make exactly the same coiches as in the original.
I've decided to put my (limited) knowledge of Lua to use to make some WML tags. So far, I've finished one, but I'll (hopefully) finish the other ideas I have soon.
Tags:
:
This tag blinks an image, like HIGHLIGHT_IMAGE does in core, but in lua, is more compact, and has more options.
Usage:
Hi, as everybody know i am the author of biggest era in wesnoth, even with ordered list of units its hard to find out which unit id is written wrong in codes used in my era. To make it easier i really could be happy if someone could write me here how to change game codes (even this from core...
Lately, I was used to do a lot of variable-related stuff with WML, that resulted in long calculations, than resulted sometimes in visible times of execution (I mean like, 0.3 second, the code was like 200 KiB long, but contained many cycles and macros), while creating and scattering a hundred units...
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