It surely makes sense. Deciding the usefulness of such changes on case by
case basis.
> (That questions appeared when I work on fix for issue 526 where I
> asked them. However, with this mailing list have been appeared, I copy
> the questions from the bugtracker here.)
> Proper realization will add more flexibility to the game.
>
> Some examples are below
>
> inventory.cpp
> Inventory::draw()
> textprintf(temp, g_small_font, 128, 140, COLOR_GREEN, "%s",
> sel_item->name().c_str());
> if (sel_item->is_grenade()) {
> if (sel_item->delay_time()) {
> textout(temp, g_small_font, _("DELAY"), 272, 64,
> COLOR_LT_OLIVE);
> textout(temp, g_small_font, _("TIME:"), 272, 72,
> COLOR_LT_OLIVE);
> textout(temp, g_small_font, _("LEFT="), 272, 80,
> COLOR_LT_OLIVE);
> textprintf(temp, g_small_font, 299, 80,
> COLOR_ORANGE, "%d", sel_item->delay_time() - 1);
> rect(temp, 272, 88, 303, 135, COLOR_GRAY08); //
> clip
> PCK::showpck(temp, sel_item->obdata_pInv(), 272, 88 +
> 8);
> }
> }
Could you elaborate on this? Are you proposing to tweak colors? Or the
placement of text labels? Or something else?
> soldier.cpp
> Soldier::initialize()
> ud.Morale = 100;
>
> soldier.cpp
> Soldier::process_MANDATA()
> if (md.TimeUnits < 50) md.TimeUnits = 50;
> if (md.TimeUnits > 80) md.TimeUnits = 80;
> if (md.Health < 50) md.Health = 50;
> ...
> if (md.Reactions > 80) md.Reactions = 80;
There is a bug (and a bunch of related bugs) about modding units and
their stats:
http://ufo2000.net/mantisbt/view.php?id=387
Technically, it's not very different from modding weapons or maps. It was just
not implemented yet.
--
Best regards,
Siarhei Siamashka
I see. Still it may be not the best idea because we are still going to have
the general layout hardcoded in C++, with only labels placement tweakable. We
will get some extra clutter to the code for getting these constants from .lua
or .ini to C++, but still lack complete configurability. This feels somehow
similar to 'soundmap.xml' which I think was not the very best design. Another
headache would come from ufo2000 versions upgrade (we will have to maintain
compatibility with all these externally configurable variables and provide
a sane upgrade path for the users who may tweak them).
If you want to be able to override the whole look of the item description area
from lua scripts, it may be interesting to move the whole drawing code to lua,
adding bindings for the needed functions (somewhat similar to how 'chameleon'
unit animation sequence is fully defined in lua). Though it brings some
challenges for internationalization, because text labels such as "TIME:",
"LEFT=" and the others will need to be translatable. And internationalization
does not work well with lua yet (for example, translation for the names of the
weapons is missing now).
Another thing to consider is support for different screen resolutions. If you
specify some coordinates in configuration files, they may not work equally well
for different resolutions.