Opened 10 years ago

Last modified 8 years ago

#2936 closed enhancement

Relative Templates — at Version 11

Reported by: scythetwirler Owned by:
Priority: Must Have Milestone: Alpha 20
Component: Core engine Keywords: patch
Cc: Patch:

Description (last modified by scythetwirler)

Currently, we [could] have templates for units such as

Generic War Dog

<Armour>
    <Hack>1</Hack>
    <Pierce>1</Pierce>
    <Crush>1</Crush>
</Armour>

Ultra-Super Powered War Dog

<Armour>
    <Hack>11</Hack>
    <Pierce>8</Pierce>
    <Crush>9</Crush>
</Armour>

It'd be a lot easier to make slight deviations if we had relative templates that perform an operation upon the stats of the parent. That is:

Ultra-Super Powered War Dog

<Armour>
    <Hack op="add">10</Hack>
    <Pierce op="add">7</Pierce>
    <Crush op="add">8</Crush>
</Armour>

In the case that we need to change the stats of the entire class of units, we would have to only change the parent, but not every template that deviates.

Supporting the basic operations (+, -, x, ÷) would help greatly imo.

Also, files

  • tools/templatesanalyzer/unitTables.py
  • tools/entity/Entity.pm

will need to be updated.

Change History (14)

comment:1 by scythetwirler, 10 years ago

Description: modified (diff)

comment:2 by scythetwirler, 10 years ago

Description: modified (diff)

comment:3 by scythetwirler, 10 years ago

#2620 is somewhat related.

comment:4 by Niek, 10 years ago

Wasn't it already possible to use <Add> and <Multiply>? (Dunno for sure)

in reply to:  4 comment:5 by scythetwirler, 10 years ago

Replying to niektb:

Wasn't it already possible to use <Add> and <Multiply>? (Dunno for sure)

I've seen this in Auras but I'm not sure whether it's possible in templates.

by scythetwirler, 9 years ago

Attachment: relativetemplates.patch added

leper's patch with scythetwirler's fill-in-the-blanks.

comment:6 by scythetwirler, 9 years ago

Keywords: review patch added
Milestone: BacklogAlpha 18

comment:7 by scythetwirler, 9 years ago

TODO: Update tools/templatesanalyzer/unitTables.py tools/entity/Entity.pm

by scythetwirler, 9 years ago

comment:8 by scythetwirler, 9 years ago

Description: modified (diff)

by wraitii, 9 years ago

Should work but needs testing with patch (tested with current templates only)

comment:9 by leper, 9 years ago

wraitii: Could you include the full license (not that long for MIT license) and change the copyright line to WFG?

comment:10 by scythetwirler, 9 years ago

Oh, wraitii, forgot to mention one thing: the case of the "true" string in line 133 and line 205 (with your patch applied) is inconsistent, making ranged units appear to have 0 attack.

comment:11 by scythetwirler, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.