Difference between revisions of "EasyCoding"

From The Battle for Wesnoth Wiki
(added Python thingies section as suggested by Boucman :))
m
Line 19: Line 19:
  
 
== MP related features ==
 
== MP related features ==
 +
 
=== Add TTL to wesnothd bans ===
 
=== Add TTL to wesnothd bans ===
 
As per FR #3638 [https://gna.org/bugs/?3638]
 
As per FR #3638 [https://gna.org/bugs/?3638]
Line 25: Line 26:
 
=== Allow lists for /ignore and similar ===
 
=== Allow lists for /ignore and similar ===
 
As per FR #7492 [https://gna.org/bugs/?7492]
 
As per FR #7492 [https://gna.org/bugs/?7492]
 +
  
 
== WML related features ==
 
== WML related features ==
 
  
 
=== WML configurable village income / upkeep ===
 
=== WML configurable village income / upkeep ===
Line 33: Line 34:
 
=== Add support of [if] for [scenario] ===
 
=== Add support of [if] for [scenario] ===
 
As per FR #4539 [https://gna.org/bugs/?4539]
 
As per FR #4539 [https://gna.org/bugs/?4539]
 
  
 
=== Make [have_unit] optionaly use full SUF ===
 
=== Make [have_unit] optionaly use full SUF ===
Line 39: Line 39:
 
=== Side-specific results ===
 
=== Side-specific results ===
 
Giving result=defeat or result=victory for specific sides. ([http://gna.org/bugs/index.php?4960 FR #4960]) -- [[User:dlr365|dlr365]] -- patch submitted [https://gna.org/bugs/index.php?4960]
 
Giving result=defeat or result=victory for specific sides. ([http://gna.org/bugs/index.php?4960 FR #4960]) -- [[User:dlr365|dlr365]] -- patch submitted [https://gna.org/bugs/index.php?4960]
 
  
 
=== Enabling checking of damage dealt in WML ===
 
=== Enabling checking of damage dealt in WML ===
 
A WML variable should be set when triggering some combat-related events, allowing WML to know the amount of damage being dealt. ([http://gna.org/bugs/index.php?7673 FR #7673])
 
A WML variable should be set when triggering some combat-related events, allowing WML to know the amount of damage being dealt. ([http://gna.org/bugs/index.php?7673 FR #7673])
 +
 
=== Support for leaderless multiplayergames ===
 
=== Support for leaderless multiplayergames ===
 
Add support for the WML key victory_when_enemies_defeated= in the scenario tag during multiplayergames. ([https://gna.org/bugs/index.php?8106 FR #8106])
 
Add support for the WML key victory_when_enemies_defeated= in the scenario tag during multiplayergames. ([https://gna.org/bugs/index.php?8106 FR #8106])
 +
 +
=== Allow a single [clear_variable] to clear multiple variables ===
 +
Currently the name= key of [clear_variable] only takes a single variable name. However it'd be very handy to be able to clear multiple variables at the same time, so name= should also be made to also understand a comma-separated list:
 +
 +
[clear_variable]
 +
    name=var1,var2,var3
 +
[/clear_variable]
 +
 +
Commas don't need to be valid characters in variable names, so the fact that it's ambiguous whether "name=var1,var2,var3" refers to three variables or just one variable named "var1,var2,var3" shouldn't cause any problems.
 +
 +
 
=== Other Ideas ===
 
=== Other Ideas ===
 
See [[FutureWML]]; some ideas there are easier than others.
 
See [[FutureWML]]; some ideas there are easier than others.
 +
  
 
== Improvements to FormulaAI ==
 
== Improvements to FormulaAI ==
Line 63: Line 75:
 
    
 
    
 
--[[User:SkeletonCrew|SkeletonCrew]] 14:04, 9 March 2008 (EDT)
 
--[[User:SkeletonCrew|SkeletonCrew]] 14:04, 9 March 2008 (EDT)
 +
  
 
=== Theme Changes ===
 
=== Theme Changes ===
 +
 
* show number of owned villages/total villages (FR: #3135) (--[[User:Alink|alink]] done but must update help, doc, tooltip...)
 
* show number of owned villages/total villages (FR: #3135) (--[[User:Alink|alink]] done but must update help, doc, tooltip...)
 
* allow custom themes to display values of WML variables ([http://gna.org/bugs/index.php?6209 FR #6209])
 
* allow custom themes to display values of WML variables ([http://gna.org/bugs/index.php?6209 FR #6209])
Line 77: Line 91:
 
* AI API function to check if a location is outside the map (http://www.wesnoth.org/forum/viewtopic.php?f=10&t=20817)
 
* AI API function to check if a location is outside the map (http://www.wesnoth.org/forum/viewtopic.php?f=10&t=20817)
 
* AI API function to get gold settings (https://gna.org/bugs/?11136)
 
* AI API function to get gold settings (https://gna.org/bugs/?11136)
 +
  
 
== Miscellaneous ==
 
== Miscellaneous ==
 +
 
=== More powerful village naming ===
 
=== More powerful village naming ===
 
'''Adding mountain names and other features to village names, having a second random name in village names'''
 
'''Adding mountain names and other features to village names, having a second random name in village names'''

Revision as of 15:41, 14 April 2008

Foreword

This page is here to document easy to do coding tasks. It is not here to double the feature request database, and should only be filled by people that know the code well enough to judge the difficulty of a given task.

If you are such a person, you should feel free to edit this page.

If you're not, you should post a feature request and discuss your idea on the forum or IRC. A coder with better knowledge of the code might give you the green light to add your feature here.

Anybody should feel free to add "clues" to any tasks, that is entry points, traps to avoid, person to contact to discuss and so on.

If you plan to work on a feature, write your name at the bottom of the feature, with the date. Note that if you are too long at working on a feature I'll "free" it back (that is if you're not working on it. If you have problems implementing it, just tell us....)


--Boucman 20:48, 3 October 2006 (CEST)


Since bugs are sometimes a good opportunity to get a first idea of the code, i will add some here that are easy to fix as soon as i stumble upon them (the one i had in mind is fixed already ;-).

--Yogi Bear, 28 February 2008

MP related features

Add TTL to wesnothd bans

As per FR #3638 [1]

Use different font for in-game chat

Since commas and dots are apparently hard to tell apart. As per FR #7470 [2]

Allow lists for /ignore and similar

As per FR #7492 [3]


WML related features

WML configurable village income / upkeep

Preferably as a [scenario], [side] or [campaign] keys. As per FR #6301 [4]

Add support of [if] for [scenario]

As per FR #4539 [5]

Make [have_unit] optionaly use full SUF

[have_unit] by default uses SUF but does not apply it to recall list. Introduce an optional key that will allow to lift that limitation.

Side-specific results

Giving result=defeat or result=victory for specific sides. (FR #4960) -- dlr365 -- patch submitted [6]

Enabling checking of damage dealt in WML

A WML variable should be set when triggering some combat-related events, allowing WML to know the amount of damage being dealt. (FR #7673)

Support for leaderless multiplayergames

Add support for the WML key victory_when_enemies_defeated= in the scenario tag during multiplayergames. (FR #8106)

Allow a single [clear_variable] to clear multiple variables

Currently the name= key of [clear_variable] only takes a single variable name. However it'd be very handy to be able to clear multiple variables at the same time, so name= should also be made to also understand a comma-separated list:

[clear_variable]
    name=var1,var2,var3
[/clear_variable]

Commas don't need to be valid characters in variable names, so the fact that it's ambiguous whether "name=var1,var2,var3" refers to three variables or just one variable named "var1,var2,var3" shouldn't cause any problems.


Other Ideas

See FutureWML; some ideas there are easier than others.


Improvements to FormulaAI

Add new formula functions, or minor improvements to the formula language. Make it easier to debug the formula language.

GUI related features

Change map paths from dots to dashes

Or even better allow dashes and allow choice between the two. As per FR #5522 [7]


Note at the moment Mordante is working on a new GUI system, these changes will probably affect the way these items need to be implemented. Contact Mordante on IRC before starting to work on these.

--SkeletonCrew 14:04, 9 March 2008 (EDT)


Theme Changes

  • show number of owned villages/total villages (FR: #3135) (--alink done but must update help, doc, tooltip...)
  • allow custom themes to display values of WML variables (FR #6209)
  • hide the hourglass item from the statusbar when there is no timer

Widget Changes

  • show side number, name and team association information in the status table
  • make games sortable in the lobby (open slots, total number of players, era, XP modifier, gold per village, fog/shroud)
  • input history (chat, commands, ..) - note: rujasu is working on this feature

Python thingies


Miscellaneous

More powerful village naming

Adding mountain names and other features to village names, having a second random name in village names

Currently the village naming engine has a very good structure that could allow more powerfull names to be generated. Understanding how it works should be quite easy, and a few usefull improvements could be added.

  • Currently villages can use lake names and river names, this should be extended to other features like bridges, swamps, mountains etc...
  • It would be nice to have a separate list of "first sylabus" and "last sylabus" for naming. That's not really needed in english, but some translations could use it
  • Again, it is common to have villages with more than one "random" word in them. having a $name2 variable would be nice

ACardboardRobot 2/2/07

Debug Mode

  • New debug command functionality (setting additional status.variables, possibly terrain)


Add minimal regexp to friend list

Lots of people use multiple nicks, usually postfixed with a number... it would be nice to have minimal regexp support in friend list to easily get who's there...

Bugs

See Also

NotSoEasyCoding