Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: sector fortifications
New feature: sector fortifications[message #344401] Sun, 06 March 2016 15:08 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
While constructable fortifications allow us to create map structures wherever we want (provided the map supports them), this is rather tedious if one wants to do this large-scale. I feel this is a significant drawback.

For this reason, I've now added new functionality:


In each map, we create Fortification Nodes. These nodes store what we want to build/remove. Nodes are stored in easily-readable files stored in \Profiles\UserProfile_xxx\FortificationPlan\ and look like this:
...
6164 0 1 0 5
12058 1 1 0 6
12059 0 0 0 3
...

Each line represents a node. The meaning is this:


  • The first number is the number of the tile where we want to build - you can also get that number by pressing [f] ingame.
  • The second number is the height level: 0 for ground level, 1 for rooftops (no, this wont work without a roof to support whatever you are building).
  • The third number indicates whether we want to build sth. (1) or remove sth. (0).
  • The fourth number is the StructureConstruct.xml (build) or StructureDeconstruct.xml (remove) index - this lets the game know what you are planning to do. Note that this is only possible if this map supports this tileset (you can only build sandbags if the map has sandbags).
  • The fifth number is the tileset's subindex, indicating which specific structure we want to build (which one of the 10 different sandbags shall it be?)


You can then assign your mercs to build whatever it is you added. On strategic, their face displays their construction points per hour and the total amount needed in this sector. Due to to game limitations, the addition of the structures to the map and the removal of required resources only happens once you enter the map.

You can call the select-what to build-menu via [Ctrl] + [Alt] + [a].
You can create a build node via [Ctrl] + [a].
You can create a removal node via [Ctrl] + [b].

A very notable feature is that these Fortification plans are not save-state-dependent. You alter them whenever you want - the altered plan will be used in any game. This also means that you can create a detailed plan and then post it here for everybody else to use. To demonstrate, I've added my plan for K6 to the trunk.

StructureConstruct.xml has new tags (also present in StructureDeconstruct.xml):
<STRUCTURE><!--sandbags-->
	<usCreationItem>1540</usCreationItem>                           item required for building this
	<usItemStatusLoss>1</usItemStatusLoss>                          status of item consumed per structure
	[color=green]<szTileSetDisplayName>Sandbags</szTileSetDisplayName>[/color]           name of this structure fir ingame menu
	<szTileSetName>sandbag.sti</szTileSetName>                      tileset. Only if this tileset is present in the map can we build it.
	[color=green]<dCreationCost>2.5</dCreationCost>[/color]                              Construction point cost per structure
	[color=green]<fFortifyAdjacentAdjustment>1</fFortifyAdjacentAdjustment>[/color]      0/1-setting. If set to 1, adjacent nodes of the same tileset will try to fit each other in order to look better visually
	<northfacingtile>3</northfacingtile>                            in old-style construction, this indicates what can be build from which direction the merc faces. In the new system, any tile mentioned here can be selected
	<northfacingtile>4</northfacingtile>
	<southfacingtile>3</southfacingtile>
	<southfacingtile>4</southfacingtile>
	<eastfacingtile>8</eastfacingtile>
	<eastfacingtile>9</eastfacingtile>
	<westfacingtile>8</westfacingtile>
	<westfacingtile>9</westfacingtile>
</STRUCTURE>


Should you lack the required resources to build something, the game will tell you so in strategic. A merc's construction points is derived from his effective strength, altered by fatigue, his health state and the new <fortify_assignment> background property.

This has been added to the trunk in r8094 & GameDir r2296. It is fully savegame compatible.

Also, HOLY FUCK! This doesn't have any ini options! Let's see how long that stays the same not sure

While coding this, I've also heavily cleaned up the cover display functions, which are now a bit less obscure (as you can see in the video, the menu ([Ctrl] + [c]) was also altered).

It would be thinkable to also have similar plans that are applied depending on quest states with a LUA-interface. So for example, depending on game progress, the AI would heavily fortify it's remaining cities.

[Updated on: Sun, 06 March 2016 15:14]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

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
Previous Topic: New feature: Administration assignment
Next Topic: New (unofficial) merc: Max Payne
Goto Forum:
  


Current Time: Sun Dec 01 12:14:17 GMT+2 2024

Total time taken to generate the page: 0.00965 seconds