• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Amartus

Captain
34 Badges
Jul 14, 2008
441
12
  • Hearts of Iron Anthology
  • Semper Fi
  • Europa Universalis: Rome
  • Iron Cross
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Deus Vult
  • Darkest Hour
  • Hearts of Iron IV: Together for Victory
  • Knights of Honor
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
  • Ancient Space
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron 4: Arms Against Tyranny
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • 500k Club
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Victoria: Revolutions
  • Arsenal of Democracy
  • Rome Gold
Hi there

I seem to recall that in a previous patch all units were given the ability to have up-to five attachments, and that this could be defined on a unit-by-unit basis in the respective unit files.

Is the ability to allow units to have more-than five units currently available and, if not, is this planned at all in future patches?

Cheers,
Amartus
 
You can edit it yourself just by using notepad, it is nothing

Go to \db\units\divisions

Pick for example ''Infantry'' file and you will see this line max_allowed_brigades = 2
you can change it to 4 or 5 or what ever. Those units that dont have it, by default have 1 allowed, by adding that line you can also change that.
 
Hi there

Took me a while to get back to this - sorry.

The maximum number of brigades allowed to be attached to all units is 5, i.e. if you allow a unit in its file to have more than 5 attachments, it will not work, and gives an error message if I recall correctly. Can any of the developers speak to whether this is hard-coded, or if this is some thing that could be changed in the future?

Many thanks,
Amartus
 
Hi there

Took me a while to get back to this - sorry.

The maximum number of brigades allowed to be attached to all units is 5, i.e. if you allow a unit in its file to have more than 5 attachments, it will not work, and gives an error message if I recall correctly. Can any of the developers speak to whether this is hard-coded, or if this is some thing that could be changed in the future?

Many thanks,
Amartus

Hi there

I was wondering if any of the developers might be able to speak to my query here? Is 5 attachments the maximum limit for all units, or can this be increased somehow? Further, if this is the case at the moment (i.e. 5 attachments max), are there any plans to change this in a future patch?

Many thanks,
Amartus
 
The unit to build class has space for 5 bytes.

So for example:

Code:
class UnitToProduce
{
// stuff

    uint_8 BrigadeAttachment_1;
    uint_8 BrigadeIDAttachment_2;
    uint_8 BrigadeIDAttachment_3;
    uint_8 BrigadeIDAttachment_4;
    uint_8 BrigadeIDAttachment_5;

};

The actual unit definition expands these to a 32 bit value, so uint_32. Bare in mind these are ids, so if you wanted to expand the number of brigades you'd have to modify the executable. You could rewrite the entire definition in memory allowing say 32 attachments, but every place the game code goes to read the attached brigades would have to be rewritten. Additionally, I don't think it would properly display all the attached brigades either, which is probably why it was clamped to 5 brigades.

One way of potentially going about it without rewriting the class definition is to do something like:

Code:
if ( DoesProducibleUnitHaveBrigadeToBuild ( brigade_artillery ) )
{
    CurrentProducible.BrigadeAttachment_1 |= BRIGADE_ARTILLERY;
}
else
{
    CurrentProducible.BrigadeAttachment_1 &= ~BRIGADE_ARTILLERY;
}

Bare in mind this is purely conceptual code at this point. You would need to apply detours to the game code, and where-ever the game code was run. In addition because each uint_8, with bit usage can represent up to 8 brigades, you have a total possible brigade count up to 40 brigades using this. You would need to differentiate between land, sea and air brigades as well. I don't see that being too difficult or being too much work to do. However rendering all of the attached brigades would be messy.