EasyCoding

From The Battle for Wesnoth Wiki
Revision as of 18:48, 3 October 2006 by Boucman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 hsould 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.


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

Animation related features

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


User interface related

Allow arrow keys for moving the map around

the hard part is to make sure it works across multiple OS/cpu

ask grzywacz for more details


Misceleanous

More powerfull 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