Home » MODDING HQ 1.13 » Flugente's Magika Workshop » Expanded Feature: Fortifications revisited
Expanded Feature: Fortifications revisited[message #335557] Sun, 07 September 2014 00:51 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Expanded Feature: Fortifications revisited

Likely the most important feature of this year's summer convention, we (Smeagol, DepressivesBrot and myself) have improved the fortification feature.

The pure mechanics are the same - only this time, you can define via xml what you want to construct and what to deconstruct. You can pretty much create ANY structure the game knows. And I mean ANY.

A small demonstration in A9, Smeagols's AIMNAS:



  • The first xml, TableData/Items/StructureDeconstruct.xml, allows setting up what structures you want to pull down, how, and what you might get:
    ...
    <STRUCTURE><!-- wooden planks, medium -->
    	<usDeconstructItem>5832</usDeconstructItem>
    	<usItemToCreate>1544</usItemToCreate>
    	<usCreatedItemStatus>100</usCreatedItemStatus>
    	<szTileSetName>deb_02.sti</szTileSetName>
    	<allowedtile>1</allowedtile>
    	<allowedtile>2</allowedtile>
    </STRUCTURE>
    ...
    
    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:
    ...
    <<STRUCTURE><!--wooden planks, medium 2x1 -->
    	<usCreationItem>1544</usCreationItem>
    	<usItemStatusLoss>100</usItemStatusLoss>
    	<szTileSetName>deb_02.sti</szTileSetName>
    	<northfacingtile>1</northfacingtile>
    	<southfacingtile>1</southfacingtile>
    	<eastfacingtile>2</eastfacingtile>
    	<westfacingtile>2</westfacingtile>
    </STRUCTURE>
    ...
    
    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.

[Updated on: Sun, 26 July 2015 12:21]

Report message to a moderator

Captain

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New feature: a private military company offers its services
Next Topic: New Feature: Tactical recruitment
Goto Forum:
  


Current Time: Sat Nov 30 00:35:20 GMT+2 2024

Total time taken to generate the page: 0.01714 seconds