URL:
  <http://gna.org/bugs/?10612>

                 Summary: Request for a script to check if the 'Special
notes:' for all units that should have some are set
                 Project: Battle for Wesnoth
            Submitted by: ivanovic
            Submitted on: Sonntag 30.12.2007 um 14:32
                Category: Feature Request
                Severity: 3 - Normal
                Priority: 3 - Low
              Item Group:  None of the others
                  Status: None
                 Privacy: Public
             Assigned to: esr
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: any (post 1.3.13)
        Operating System: any

    _______________________________________________________

Details:

It would be nice to have a script to check if all the special notes a unit
should have are set. The special notes are meant to be shown in the ingame
help to allow users to see what they should keep in mind with the units. We
did just split off the special notes into nice macros so that they only have
to be translated one. Now it would be nice to be able to check if all units,
that should get a special note, do actually get them and that they are
defined as a macro. Here is the more verbose specification:

If the units should get at least one special notes block, the unit should
have '+{SPECIAL_NOTES}' right after the unit_description=_"mydescription"
part. (I will post an example for how it should exactly look like at the end
of this request)

Here is the list of macros/abilities that determin if and which SPECIAL_NOTES
macro should be used:

* Dependant on the type of a units (most difficult to detect):

1) TAG: movement_type=undeadspirit 
Special_notes: {SPECIAL_NOTES_SPIRIT}

* Dependant on a special ability (has to be inside of the    
[abilities][/abilities] block which might include several items):
1) TAG: {ABILITY_HEALS}
Special_notes: {SPECIAL_NOTES_HEALS}
2) TAG: {ABILITY_EXTRA_HEAL}
Special_notes: {SPECIAL_NOTES_HEALS}
3) TAG: {ABILITY_UNPOISON}
Special_notes: {SPECIAL_NOTES_UNPOISON}
4) TAG: {ABILITY_CURES}
Special_notes: {SPECIAL_NOTES_CURES}
5) TAG: {ABILITY_REGENERATES}
Special_notes: {SPECIAL_NOTES_REGENERATES}
6) TAG: {ABILITY_STEADFAST}
Special_notes: {SPECIAL_NOTES_STEADFAST}
7) TAG: {ABILITY_LEADERSHIP_LEVEL_?} (several levels are possible, substitute
the ? by a number between 1 and 5)
Special_notes: {SPECIAL_NOTES_LEADERSHIP}
8) TAG: {ABILITY_SKIRMISHER}
Special_notes: {SPECIAL_NOTES_SKIRMISHER}
9) TAG: {ABILITY_ILLUMINATES}
Special_notes: {SPECIAL_NOTES_ILLUMINATES}
10) TAG: {ABILITY_TELEPORT}
Special_notes: {SPECIAL_NOTES_TELEPORT}
11) TAG: {ABILITY_AMBUSH}
Special_notes: {SPECIAL_NOTES_AMBUSH}
12) TAG: {ABILITY_NIGHTSTALK}
Special_notes: {SPECIAL_NOTES_NIGHTSTALK}
13) TAG: {ABILITY_CONCEALMENT}
Special_notes: {SPECIAL_NOTES_CONCEALMENT} (still has to be written)
14) TAG: {ABILITY_SUBMERGE}
Special_notes: {SPECIAL_NOTES_SUBMERGE}
15) TAG: {ABILITY_FEEDING}
Special_notes: {SPECIAL_NOTES_FEEDING} (still has to be written)

* Dependant on a special attack (has to be inside of the    
[specials][/specials] block which might include several items and is inside
the [attack] [/attack] block):
1) TAG: {WEAPON_SPECIAL_BERSERK}
Special_notes: {SPECIAL_NOTES_BERSERK}
2) TAG: {WEAPON_SPECIAL_BACKSTAB}
Special_notes: {SPECIAL_NOTES_BACKSTAB}
3) TAG: {WEAPON_SPECIAL_PLAGUE_TYPE TYPE} (TYPE is replaces with a unit, so
better use *)
Special_notes: {SPECIAL_NOTES_PLAGUE}
4) TAG: {WEAPON_SPECIAL_PLAGUE}
Special_notes: {SPECIAL_NOTES_PLAGUE}
5) TAG: {WEAPON_SPECIAL_SLOW}
Special_notes: {SPECIAL_NOTES_SLOW}
6) TAG: {WEAPON_SPECIAL_STONE}
Special_notes: {SPECIAL_NOTES_STONE}
7) TAG: {WEAPON_SPECIAL_MARKSMAN}
Special_notes: {SPECIAL_NOTES_MARKSMAN}
8) TAG: {WEAPON_SPECIAL_MAGICAL}
Special_notes: {SPECIAL_NOTES_MAGICAL}
9) TAG: {WEAPON_SPECIAL_SWARM}
Special_notes: {SPECIAL_NOTES_SWARM}
10) TAG: {WEAPON_SPECIAL_CHARGE}
Special_notes: {SPECIAL_NOTES_CHARGE}
11) TAG: {WEAPON_SPECIAL_DRAIN}
Special_notes: {SPECIAL_NOTES_DRAIN}
12) TAG: {WEAPON_SPECIAL_FIRSTSTRIKE}
Special_notes: {SPECIAL_NOTES_FIRSTSTRIKE}
13) TAG: {WEAPON_SPECIAL_POISON}
Special_notes: {SPECIAL_NOTES_POISON}


I don't know/think any special order should be used for the display of the
special_notes tags that are applied behind the unit_description. The script
should just check that each of the notes does exist for the units and output
a list of units and their missing tags. It should check all .cfg files with a
[unit] [/unit] block (maybe it is enough to check all files which are in a
patch that includes /units/). It should check if behind all the
unit_description tags there are the special notes check (units with a female
variation might have two unit_description blocks).

Here is one example for a correct unit (taken from
data/core/unitshumans/Mage_of_Light.cfg but removed animations and female
variation):



[unit]
    id=Mage of Light
    name= _ "Mage of Light"
    race=human
    gender=male
    image="units/human-magi/white-cleric.png"
    {MAGENTA_IS_THE_TEAM_COLOR}
    halo=halo/illuminates-aura.png
    hitpoints=47
    movement_type=smallfoot
    movement=5
    experience=150
    level=3
    alignment=lawful
    advanceto=null
    {AMLA_DEFAULT}
    cost=64
    usage=fighter
    unit_description= _ "After years of experience, the most devout of white
magi develop vast spiritual powers. By strict devotion to the path of the
light, they can call upon its aid to chase away the shadows of the night.

Following a strict code of piety and honor, these men and women work
tirelessly to bring life and order to the troubled world in which they
live."+{SPECIAL_NOTES}+{SPECIAL_NOTES_MAGICAL}+{SPECIAL_NOTES_ARCANE}+{SPECIAL_NOTES_CURES}+{SPECIAL_NOTES_ILLUMINATES}
    [abilities]
        {ABILITY_ILLUMINATES}
        {ABILITY_CURES}
    [/abilities]
    [resistance]
        arcane=40
    [/resistance]
    [attack]
        name=morning star
        description=_"morning star"
        type=impact
        range=melee
        damage=7
        number=3
        icon=attacks/morning-star.png
    [/attack]
    [attack]
        name=lightbeam
        description=_"lightbeam"
        type=arcane
        range=ranged
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
        [/specials]
        damage=15
        number=3
    [/attack]
[/unit]

The tags are all correctly set, just as they should be:
unit_description=_"translateable multilike
description"+{SPECIAL_NOTES}+{SPECIAL_NOTES_MAGICAL}+{SPECIAL_NOTES_ARCANE}+{SPECIAL_NOTES_CURES}+{SPECIAL_NOTES_ILLUMINATES}
The block of SPECIAL_NOTES should always start with '+{SPECIAL_NOTES}' and
each note should be added as '+{SPECIAL_NOTES_something}', so that it should
be possible to grep for things via normal regexp. At the end the output
should be something like this, if for that unit none would have been
specified:
missing special notes for path_to/unit/name.cfg:
+{SPECIAL_NOTES}+{SPECIAL_NOTES_MAGICAL}+{SPECIAL_NOTES_ARCANE}+{SPECIAL_NOTES_CURES}+{SPECIAL_NOTES_ILLUMINATES}

If just the {SPECIAL_NOTES} was missing, just that one was listed as
+{SPECIAL_NOTES}, if others were missing, they were just listed in a way that
allows copy&paste of them (that means including all + that are needed to
concatenate)

I hope this specification is clear enough, if anything is missing, please
ask. The reason why I did not ask to directly add it is that there might be
some units that still have 'Special notes:" hardcoded inside the
unit_description, I want to find those via the script, too...




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?10612>

_______________________________________________
  Nachricht geschickt von/durch Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to