If I could ask for a new Editor feature this would be to extent an existing map in x and y direction, while keeping the existing part
That´s a feature I miss very much
Yes, it would be very nice to have lots of support for infrastructure and scripting in the editor!
Sound like a feature I could implement when all my other open feature branches are merged
Afaik in the past the idea to split off the editor code from the widelands code come up. So the editor will be an own executable then. I think this has to be the first goal, e.g. by creating an api which can be used for both parts, the Game and the editor. Doing it like that would make some things easier.
I´m against this, because this would include lots of code duplication. There is very much common code used both for games and the editor (in EditorGameBase), and all this would have to be duplicated. This would make it much harder IMHO.
I guess it should not be that problematic to have a property window of a 'field' (e.g. a tribes starting field) or an action (e.g. create road) which is turned into valid lua commands. But the devil is surely in the details
It most certainly is
Outline for a possible implementation
Scenario options: A dialog to include additional pictures (e.g. for campaign character portraits) and to allow writing scripts (such as a mission_thread) in addition to the ones mentioned below. Including templates for commonly used functionality. And a box for defining texts spoken by campaign characters, with autogeneration of the appropriate speech() functions.
Tabs: Scripts, Pictures, Characters, Texts
Field Groups. A Field Group is a set of fields (corresponding of an array of fields in Lua). The tool allows to add/remove fields from field groups. Field Groups can be used in the scenario to apply an operation (e.g. conquering for a certain player, removing immovables etc) to many fields at once.
Tool Window: Dropdown box to choose the field group to edit; buttons to add new group, rename active group, delete active group; map-clicking to add/remove(shift)/toggle(ctrl) field under the mouse to/from the active group
Set Owner, to conquer certain areas for a certain player at gamestart. A similar tool to give players additional vision.
Tool Window: Dropdown to choose the player (including entry for none), click the map to conquer a field for the selected player
Place Building to place certain buildings for certain players. Corresponding tools for roads, flags etc.
Enhance the Player Settings to set teams and attack_forbidden overrides
- On Conquer: When the owner of a particular Field Group changes, a certain Lua script is triggered. Similar callback scripts for other events, such as Player has a certain number of certain buildings or Player´s military strength exceeds a limit.
The On Event tool window contains two dropdowns, one for a field group and one for an event. The multilineeditbox below shows the script that is called when the specified event happens on the chosen field group. A toggle button decides whether the script is called when the event happens for one or for all fields in the group.
Implement the use of "callback" functions, so scripts can define functions that get called by the EGBase when a certain event happens in the game. I´ve been planning to implement this anyway someday…
Saving all the Lua scripts, ideally with nice formatting and a syntax check
A specialised multilineeditbox with syntax highlighting, automatic indent and perhaps even spell-/syntaxcheck-as-you-type would be great