Difference between revisions of "EasyCoding"
(→Misceleanous) |
|||
Line 74: | Line 74: | ||
If you have experience with implementing Lua scripting, then this is probably quite easy to do, can just look how Python was added. Just keep the security aspect in mind from the beginning (but I think in Lua you don't get filesystem access by default, so shouldn't be anything to do here). | If you have experience with implementing Lua scripting, then this is probably quite easy to do, can just look how Python was added. Just keep the security aspect in mind from the beginning (but I think in Lua you don't get filesystem access by default, so shouldn't be anything to do here). | ||
− | == | + | == Miscellaneous == |
− | === More | + | === 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''' | ||
Line 95: | Line 95: | ||
=== Other === | === Other === | ||
− | *show number of owned villages/total villages (FR: #3135) | + | * show number of owned villages/total villages (FR: #3135) |
− | *show side number, name and team association information in the status table | + | * show side number, name and team association information in the status table |
− | *Giving result=defeat or result=victory for specific sides. (FR: #4960) | + | * Giving result=defeat or result=victory for specific sides. (FR: #4960) |
− | *New debug command functionality (setting status.variables, possibly terrain, WML value display) | + | * New debug command functionality (setting status.variables, possibly terrain, WML value display) |
− | *make games sortable in the lobby (open slots, total number of players, era, XP modifier, gold per village, fog/shroud) | + | * make games sortable in the lobby (open slots, total number of players, era, XP modifier, gold per village, fog/shroud) |
− | *new trait "fearless": remove lawful_bonus penalty at day/night | + | * new trait "fearless": remove lawful_bonus penalty at day/night |
− | *new trait "healthy": +4hp rest healing | + | * new trait "healthy": +4hp rest healing |
− | *input history (chat, commands, ..) | + | * input history (chat, commands, ..) |
+ | * enabling WML-scripted leveling of units ([http://gna.org/bugs/index.php?7426 FR #7426]) | ||
+ | * side-specific [message]s ([http://gna.org/bugs/index.php?7427 FR #7427]) | ||
+ | * allow custom themes to display values of WML variables ([http://gna.org/bugs/index.php?6209 FR #6209]) | ||
+ | * WML event trigger for recalling (the current one triggers on both recalls and recruits) ([http://gna.org/bugs/index.php?3622 FR #3622]) (please read the comments of the report for a proper description of how this should work) |
Revision as of 10:55, 15 October 2006
Forward
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 juge 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)
Victory animation
an animation to be played by the surviving unit during the death animation of the other unit
this should be fairly easy to do, just duplicate all death animation code, and modify the unit_die function to change the state of both units.
ask Boucman for extra help
- unit_display.cpp
- unit_type.cpp
- unit.cpp
- unit_animation.cpp;
En Guard animation
An animation to replace the standing animation when the unit is next to an ennemy
slightly more tricky than the previous one, you should copy most of the standing code, but beware that this should be invisible to external callers. the call to get_stats should be looked at
ask Boucman for extra help
- unit.cpp
- unit_type.cpp
- unit_animation.cpp
Special tags for Extra_anim
special tags in the animate_unit event to call standard unit animations
one of the big limitation of the extra_animation tags is that you need to modify the unit itself to have the extra anim. Most anims can't be easily called that way. It would be interesting to have special tags that would be recognised to call the standard animations (attack, defense, etc...)
the tricky part is to handle correctly the "offset" parameter, and add all the WML handling to "fill in" the information we won't have available (non-existant filtering criterias)
this is more tricky than the two above, and I would advise doing one of the other two first to understand how it work
ask Boucman for extra help
- unit.cpp
- actions.cpp
Animate flags during a [delay] event
currently, the [event] tag calls SDL_delay() and blocks the game completely. It would be trivial to change it to a loop that would call event::pump() every 10ms to have all animations updated
the tricky part is to make sure the screen is somehow "locked" and that player can't play during that time (should be the case, simple checking is needed)
grep should give you the file to change
Scripting
Campaign Server Signing
Currently, the campaign server will rename uploaded *.py files to *.py.unsigned, so untrusted code cannot get executed. It would be nice to use some sort of signing for .py files (instead of having to log in to the CS and un-rename them).
The change for this would probably be only on the campaign server, and not touch any of the main wesnoth code. Here's the forum post suggesting this, and also the thread has more info: http://www.wesnoth.org/forum/viewtopic.php?p=184504#184504
Restricted Python
Unlike Blender/GIMP/Inkscape and so on, there seems to be one project "Zope" which has restricted Python execution: http://zopewiki.org/PythonScript http://svn.zope.org/Zope3/trunk/src/RestrictedPython/
Maybe this could be adapted to Wesnoth? If you know how Python works, then this is probably easy.. copy over the Zope code (if license permits, that is), adjust so it works outside of Zope, and then modify ai_python.cpp so it uses the restricted execution instead of the full Python interpreter.
Lua Support
Lua might be a nice alternative to Python, since it should be possible to have "safe" scripts, i.e. they should not be able to gain any access outside of Wesnoth, or even to crash Wesnoth.
If you have experience with implementing Lua scripting, then this is probably quite easy to do, can just look how Python was added. Just keep the security aspect in mind from the beginning (but I think in Lua you don't get filesystem access by default, so shouldn't be anything to do here).
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 avery good structure that could allow more powerfull names to be generated. Understanding how it works should be quite easy, and a few usefull imprvements could be added
- currently villages can use lake names and river names, this should be extanded 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 village with more than one "random" word in them. having a $name2 variable would be nice
WML variable divide
implement the division for WML variables
- currently there is no simple way to divide variables in WML, it would be nice to have this in the WML [set_variable] tag
- by the way it is also necessary to define how the precision would be handled, how many decial would be returned in the result. A parametrable value would be nice
- for inspiration see how [set_variable] works in game_events.cpp
- watch out for division by zero
When submitting the patch, please include a reference to bug #7112 it's the feature request for this item.
Other
- show number of owned villages/total villages (FR: #3135)
- show side number, name and team association information in the status table
- Giving result=defeat or result=victory for specific sides. (FR: #4960)
- New debug command functionality (setting status.variables, possibly terrain, WML value display)
- make games sortable in the lobby (open slots, total number of players, era, XP modifier, gold per village, fog/shroud)
- new trait "fearless": remove lawful_bonus penalty at day/night
- new trait "healthy": +4hp rest healing
- input history (chat, commands, ..)
- enabling WML-scripted leveling of units (FR #7426)
- side-specific [message]s (FR #7427)
- allow custom themes to display values of WML variables (FR #6209)
- WML event trigger for recalling (the current one triggers on both recalls and recruits) (FR #3622) (please read the comments of the report for a proper description of how this should work)