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
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.
Messages:89
Registered:February 2016 Location: Altis, Sometimes Tanoa
Would love to see if someone can make all the maps support at least some of the basic fortifications such as sandbags and the Concertina wire. not sure what that would take, but would be excellent to have.
I have no Wife, Children, or real Job. This also means I have 24 hours a day and 7 days a week to think of a rebuttal. You have been warned.
"I got another problem: I am being overrun by Dinosaur Nazis on Hoverboards!" -Ravenhugger
"Before you judge a man, walk a mile in his shoes. After that who cares? He's a mile away - and you've got his shoes!" - Unknown Criminal
Would love to see if someone can make all the maps support at least some of the basic fortifications such as sandbags and the Concertina wire. not sure what that would take, but would be excellent to have.
Aimnas supports fortifications in all sectors, also Wildfire+SDO supports sandbags in any sector.
Before the weekend I was wishing something like this was possible to help hold off the massive counter attacks. Wonderful timing. I'm amazed that such good work is still being done for this game, and that such dedicated people such as yourself are doing it in your free time and asking very little in return. Well done to you and all the other active modders keeping this game alive.
Edit:
An afterthought... would it be possible to also place landmines and other boobytraps using this (or a similar) system? So you can preplan a minefield and have it created along with the fortifications by using a merc task, instead of actually placing them manually?
Also, could it be possible to fell tress and clear shrubs? I'm sure that they will eventually be in the way of my perfectly placed fortifications and it seems like an obvious (to me anyway) extension to this kind of mass battlefield fortification system. I'm not sure if it will actually be possible, but it can't hurt to ask.
While that would be neat, that would neat an entirely new interface that allows selecting explosives from your pool of explosives, as well as a way to set up directional mines and guntraps. Additionally, explosives are tied to a merc's abilities (a minefield created by Red would a whole different game from a minefield created by Flo), and there's always the risk of blowing yourself up, which can only be somewhat effectively modelled with an assingment. Still, the idea is good, it's just lot of hassle.
Removing vegetation this way is possible - all you need is to set up the xml (which requires knowledge as to what tree is in what tileset). Afaik smeagol does that in AIMNAS with machetes and some bushes.
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.
While that would be neat, that would neat an entirely new interface that allows selecting explosives from your pool of explosives, as well as a way to set up directional mines and guntraps.
Maybe it would be possible to just log player's actions?
1. Select 'start' somewhere (in the ALT+RMB skills menu)
2. Plant bombs, tripwire, etc - game will log every action like: item 141, gridno XXX; item tripwire, network 1, level 4, gridno YYY; item claymore, direction 1, gridno ZZZ;
3. Select 'stop'
Then, when player selects strategic action "bomb plan 1", the game will simply try to place mines in that order, taking them from merc's or sector inventory.
If mine already exists or gridno is unreachable - skip this gridno.
Soldier's skills and background will define mine difficulty, as always, and there could be chance to damage health/stats as in other facilities.
This can greatly reduce micromanagement when remaking sector minefields after enemy attack, especially with lots of complex tripwire networks, especially on bigmaps.
Say in the most recent builds, should the construction nodes appear on display?
Because for me it doesn't, so i thought i wasn't really doing nothing, but turns out i actually was adding the nodes, even tho i can't see them, i noticed that once i saw that the "fortify" option was available.
But yeah, after a while messing with this feature without knowing what i was actually doing i ended up doing a mess in the sector placing barbed wire and sandbags all over the place.
So i decides to come and ask how to see that on display because Even with the "fortifications" option enabled in the "ctrl+c" menú and selecting something from "ctrl+alt+A" when i try to press "ctrl+A" there is no fortification display, althought apparently it does add the node.
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.
Would this require more coding or could something like the following possibly working? And if so, I'm missing the last step, how to call for the plan. Any idea anybody?
strateticmap.lua
function HandleSectorTacticalEntry( sSectorX, sSectorY, bSectorZ, fHasEverBeenPlayerControlled )
if ( fHasEverBeenPlayerControlled == false ) then
if ( gubQuest( Quests.XYZ ) == qStatus.QUESTINPROGRESS ) then
if ( (CheckFact( Facts.FACT_XY ) == false) and (bSectorZ == 0) ) then
???????"Create Fortification"??????
If anybody knows, please tell me, this sounds very interestening. Thanks.
I play again after a long, long time and to be honest, I thought someone was cracking the topic of sandbags. Well.
Thanks for the idea of cutting down trees and shrubs, it took barely a quarter of an hour to prepare it, and I don't even know how to code.
I will try to ignore the tileset problem, replacing debris with sandbags. A simple but dirty solution with the current method of fortification.
Ok, it works almost perfectly. I am not sure if they work identically to standard sandbags, although they can be jumped over and catch some bullets. I will add a Zip file here with changes + xml as soon as I can add files to posts.
And for those interested, an additional xml that allows you to cut trees for wooden boards, thanks to which you can build "serious" walls.
I play again after a long, long time and to be honest, I thought someone was cracking the topic of sandbags. Well.
Thanks for the idea of cutting down trees and shrubs, it took barely a quarter of an hour to prepare it, and I don't even know how to code.
I will try to ignore the tileset problem, replacing debris with sandbags. A simple but dirty solution with the current method of fortification.
First of all, thanks for keeping this awesome game alive. Great Work
Could you please explain how to change the Tileset. So is it possible to build Sandbags and Concertina in every Sector?
Greetings
Messages:199
Registered:February 2020 Location: North East England
Quote:
Examon wrote on Sun, 26 April 2020 18:20
I play again after a long, long time and to be honest, I thought someone was cracking the topic of sandbags. Well.
Thanks for the idea of cutting down trees and shrubs, it took barely a quarter of an hour to prepare it, and I don't even know how to code.
I will try to ignore the tileset problem, replacing debris with sandbags. A simple but dirty solution with the current method of fortification.
First of all, thanks for keeping this awesome game alive. Great Work happy
Could you please explain how to change the Tileset. So is it possible to build Sandbags and Concertina in every Sector?
Greetings
Messages:328
Registered:November 2001 Location: on route to San Hermanos
Hey everyone,
I recently got back in to JA2 after a few years hiatus. Having a blast defending towns from counter attacks. Wanting to utilize fortifications I am having issues opening the selection menu using [Ctrl] + [Alt] + [a]. Nothing comes up. Is anything else needed to open it? I am using BRAINMOD on revision 9141.
the tag <fFortifyAdjacentAdjustment> for concertina wire
has been changed from 1 to 0
with version
JA2_113-v1-134-gfad3a27-G9ac3L0144 (2024-04-01)
It's recommened to keep it that way for concertina. With that tag at 1, the game tries to align neighbouring graphics to each other.
Which looks ok for sandbags, but the way the actual concertina graphics are looking like and are sorted in their .sti-file, doesn't work well with that.
When trying to align them, it resulted in them facing the wrong direction when placing some next to each other and using the fortification assignment.
Therefore, for concertina, the default value got changed from 1 to 0 in StructureConstruct.xml and a comment about that being recommended has been added to the xml.
If adding new available structures to that xml, it's advised to check wether they are suited for use with that tag or not.