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 next message
Flugente

 
Messages:3536
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

Re: New feature: sector fortifications[message #344463 is a reply to message #344401] Thu, 10 March 2016 03:53 Go to previous messageGo to next message
Thor is currently offline Thor

 
Messages:426
Registered:February 2007
Location: Belgium
This is simply awesome! happy

Report message to a moderator

Master Sergeant
Re: New feature: sector fortifications[message #345370 is a reply to message #344463] Sun, 08 May 2016 19:47 Go to previous messageGo to next message
Panzer is currently offline Panzer

 
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

Report message to a moderator

Corporal 1st Class
Re: New feature: sector fortifications[message #345371 is a reply to message #345370] Sun, 08 May 2016 19:52 Go to previous messageGo to next message
Deleted.

 
Messages:2690
Registered:December 2012
Location: Russian Federation
Panzer wrote on Sun, 08 May 2016 21:47
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.



Left this community.

Report message to a moderator

Lieutenant

Re: New feature: sector fortifications[message #345374 is a reply to message #345371] Mon, 09 May 2016 07:24 Go to previous messageGo to next message
BattleGnome is currently offline BattleGnome

 
Messages:60
Registered:April 2016
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.

[Updated on: Mon, 09 May 2016 07:33]

Report message to a moderator

Corporal
Re: New feature: sector fortifications[message #345379 is a reply to message #345374] Mon, 09 May 2016 13:06 Go to previous messageGo to next message
Flugente

 
Messages:3536
Registered:April 2009
Location: Germany
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.

Report message to a moderator

Captain

Re: New feature: sector fortifications[message #345426 is a reply to message #345379] Wed, 11 May 2016 14:57 Go to previous messageGo to next message
Deleted.

 
Messages:2690
Registered:December 2012
Location: Russian Federation
Flugente wrote on Mon, 09 May 2016 15:06
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.

[Updated on: Wed, 11 May 2016 15:28]




Left this community.

Report message to a moderator

Lieutenant

Re: New feature: sector fortifications[message #354316 is a reply to message #344401] Sun, 12 August 2018 11:17 Go to previous messageGo to next message
Shinobi is currently offline Shinobi

 
Messages:141
Registered:July 2015
Location: Mexico
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.

[Updated on: Sun, 12 August 2018 11:19]

Report message to a moderator

Sergeant
Re: New feature: sector fortifications[message #357433 is a reply to message #354316] Tue, 28 May 2019 00:45 Go to previous messageGo to next message
fightcancer is currently offline fightcancer

 
Messages:211
Registered:February 2005
Location: USA
So cool! Thank you!!

Report message to a moderator

Sergeant 1st Class
Re: New feature: sector fortifications[message #358932 is a reply to message #344401] Wed, 05 February 2020 05:37 Go to previous messageGo to next message
Kitty

 
Messages:339
Registered:October 2017
Location: Germany
Quote:
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.



How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: New feature: sector fortifications[message #359767 is a reply to message #358932] Sun, 26 April 2020 18:20 Go to previous messageGo to next message
Examon is currently offline Examon
Messages:4
Registered:April 2020
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.

Report message to a moderator

Civilian
Re: New feature: sector fortifications[message #359817 is a reply to message #359767] Tue, 28 April 2020 20:28 Go to previous messageGo to next message
Examon is currently offline Examon
Messages:4
Registered:April 2020
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.

Report message to a moderator

Civilian
Re: New feature: sector fortifications[message #360111 is a reply to message #359767] Thu, 21 May 2020 09:02 Go to previous messageGo to next message
Pede87 is currently offline Pede87
Messages:2
Registered:May 2020
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

Report message to a moderator

Civilian
Re: New feature: sector fortifications[message #360112 is a reply to message #360111] Thu, 21 May 2020 12:29 Go to previous messageGo to next message
Vritran is currently offline Vritran

 
Messages:200
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
Check this here --> http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=24388&start=0&

Should be ok with Vanilla maps and the odd AR map but still WIP.

Report message to a moderator

Sergeant 1st Class
Re: New feature: sector fortifications[message #360212 is a reply to message #360112] Sat, 30 May 2020 20:56 Go to previous messageGo to next message
Pede87 is currently offline Pede87
Messages:2
Registered:May 2020
Thanks happy i'll try it today after work

Report message to a moderator

Civilian
Re: New feature: sector fortifications[message #364617 is a reply to message #360212] Sun, 01 May 2022 13:40 Go to previous message
Shadow21 is currently offline Shadow21

 
Messages:329
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.

Any feedback is appreciated.

Kind regards

Report message to a moderator

Master Sergeant
Previous Topic: New feature: turncoats
Goto Forum:
  


Current Time: Sat May 28 20:06:06 EEST 2022

Total time taken to generate the page: 0.01635 seconds