Read this as: if we have item #5832 (a shovel in AIMNAS) in our primary hand, then clicking on a structure of .sti library deb_02.sti which is tileset member 1 or 2 will destroy this structure and give us item #1544 (wooden planks, medium) with 100% status.
The second xml, TableData/Items/StructureConstruct.xml, allows setting up what structures we can create with items:
Read this as: if we have item #1544 in our primary hand (wooden planks, medium, sound familiar?), then we will build a structure of sti library deb_02.sti from this. If we face north or south doing so, we will build number 1 from that set, otherwise 2.
Of course, in order for this to work, the map needs to have these sti sets. What we don't know we cannot build... Yes, I've tried getting rid of that (which would allow us to build anything anywhere), but that part of the code is so whack that it is on hold.
As AIMNAS was built with thing like this in mind, many of these constructions will work in all maps there. For example, you can now create earthwork in all maps with a simple shovel, as Smeagol made room for that in his tilesets. This is not possible in vanilla maps, so you'll need AIMNAS or a similarly advanced map mod to get the most out of this feature.
You can also create walls this way (not shown in the video, but it works). As deconstructing walls would allow a player to flatten an entire city right under the enemies eyes with just a spy and a shovel (I'm looking at you, Gorro!), I do not allow tearing down walls this way in the code.
As you can set up what you get depending on what direction you face, you can set up your fortifications very detailed.
Via <usCreatedItemStatus> and <usItemStatusLoss>, you can set up very detailed how much of your 'resource' is used. For example, the concertina I've used loses 1% per tile, thereby making constructions less of an item hassle.
For increased immersion, you can set up what items deconstruct what - so a hammer could be used for rocks, a shovel for earth, a wrench for machines, a wirecutter for concertina wire, an axe for trees... now your dreams of playing a lumberjack have come true! :axe:
The Items.xml ItemFlag values 2 (FULL_SANDBAG) and 8 (CONCERTINA) aren't use anymore. I'll likely reuse those numbers soon, so removing these numbers from your items won't hurt.
This feature is fully savegame compatible.
It has been added in r7491 an GameDir r2140. GameDir >= 2140 is required from now on du to the new xmls.