| 10 | |
| 11 | |
| 12 | |
| 13 | == Resources == #resourceTypes |
| 14 | 0 A.D. currently has several different types of resources: |
| 15 | * four normal resources: food, wood, stone, and metal |
| 16 | * a special resource: population |
| 17 | * a local resource (affecting only individual units): experience |
| 18 | * a fundamental resource: time (time can not be edited, neither in 0 A.D. nor outside) |
| 19 | This page simply considers modifying normal resources and ignores all others. |
| 20 | |
| 21 | |
| 22 | |
| 23 | == How to edit an existing resource == #editResource |
| 24 | === Change a resource icon === #resourceIcon |
| 25 | Suppose you want to replace the meat icon used by “food” with a different one (because you care about historical accuracy and realize most people living in Antiquity could not afford meat even a single day in the year; or because you are a vegetarian and are opposed to the use of meat as generic food; or because you simply like to know how to change an icon; or for any other reason), all you have to do is create or edit two images: |
| 26 | * `food.png` (the convention is 64×64 pixels) |
| 27 | * `food_small.png` (16×16 pixels) |
| 28 | and place those in `art/textures/ui/session/icons/resources/` |
| 29 | |
| 30 | Then launch the game and admire your icon being used everywhere for food. |
| 31 | |
| 32 | === Change a resource name or other aspects === #resourceData |
| 33 | The resources themselves are defined each in a separate `{resource}.json` file in `simulation/data/resources/` |
| 34 | |
| 35 | |
| 36 | |
| 37 | == To remove a resource == #removeResource |
| 38 | Substraction is the inverse of addition. To remove a resource, in short, follow the instructions to add a resource (below), but in reverse making sure to remove all reference to the resource. |
| 39 | |
128 | | In short, follow the instructions to add a resource, but in reverse making sure to remove all reference to the resource. |
| 157 | == Summary == #summary |
| 158 | In short, to add a resource you need at least to create: |
| 159 | * `art/textures/ui/session/icons/resources/{newresource}.png` |
| 160 | * `art/textures/ui/session/icons/resources/{newresource}_small.png` |
| 161 | * `simulation/data/resources/{newresource}.json` |
| 162 | and to edit: |
| 163 | * `gui/common/setup_resources.xml` |
| 164 | * `gui/session/selection_panels.js` |
| 165 | * `gui/session/selection_panels_left/barter_panel.xml` |
| 166 | * `gui/session/top_panel/resources.xml` |
| 167 | * `simulation/templates/special/player.xml` |
| 168 | * `simulation/templates/special/player_gaia.xml` |
| 169 | * `simulation/templates/template_structure.xml` |
| 170 | This sufficient for having, displaying, trading, bartering, and using a resource. |
| 171 | |
| 172 | If you also want to make your resource gatherable, you'll need more icons, create templates, and edit AI files and maps; see the relevant sections (above). |
| 173 | |