The Great War: Western Front™

The Great War: Western Front™

The Great War: Western Front Workshop
Explore other users workshop creations, upload, download and subscribe to new content
TheCampingTurret 1 2023 年 7 月 16 日 上午 6:06
BrushName / BrushComponent
All tactical buildings have a brush component, does anyone know where the names of these components are defined or how they are created?

Searching all xml files for the name of the brush yields no results (for example, searching German_Machinegun_05 yield 1 result in Trench_Spur_MG_German.xml but no other references) but changing this name at all causes a crash (if Turret_MG_German is in owned objects). (The error log complains about arty for some reason, this is consistent)


Keeping this the same but changing the owned objects to an exact copy of Turret_MG_German with a different name makes it so that:
  • the MG never spawns (if the brush name is altered)
  • Only the sandbags spawn (if the brush name isn't altered)

I can't find any references to it on the web page.

Does anyone know how to define a brush or knows a way to get the turret to instantiate on its own?
< >
正在显示第 1 - 4 条,共 4 条留言
Brutallisck 4 2023 年 7 月 17 日 下午 2:34 
What ive lernt so far, is that some Spurs are defined in the Company_object.xml files (object/misc)
The brush isn't there, but it has helped me to create Alternative emplacements, wirhout touching the brush.

Another thing that's important is the faction file, I noticed that while emplacements like artillery mortars and MGs have company files, to actually use them in the game, you have to use the reference of "trench" not "company" in the factions files.

A further complication is that for the AI to use an emplacement, it must have a reference in the trench configuration template in the .lua files. Haven't got so far to implement this, bit I know that.

The devs have yet to produce a documentation to how to create tremch spurs/objects, would be cool to have something like this be added to the modding documentation
TheCampingTurret 1 2023 年 7 月 20 日 上午 8:26 
In Company_object.xml, as far as i can find only the artillery has companies and those seem near equivalent to the brush_proxies used for the MG and mortar.

I have been able to find the brushes, the brush names are the file names of the map brushes DATA\ART\MAPS\COPYPASTESETS\GERMAN_MACHINEGUN_05.CPBF (in CONFIG.MEG) . The .CPBF file extension seems like it might be proprietary as googling the extension gives near to no results. And it is actually on the web page, i just thought map brushes would be different from the brushes emplacements use (Map brush (.CPBF) Data\Art\Maps\Copypastesets).

From some of the comments in Trench_Artillery_Company_British_00.xml it seems like the map brushes intrinsically reference the names of objects in them. ( <!-- Company still needs to be specified (and match what's already in the brush art), even if CompaniesByNationalityState is also being used --> )

So until the devs provide documentation and tools, changing anything within the brushes might be near impossible.

Though i am curious on how you have made emplacements without touching the brush.
What type of emplacements have you been able to make? and how?


引用自 Brutallisck
Another thing that's important is the faction file, I noticed that while emplacements like artillery mortars and MGs have company files, to actually use them in the game, you have to use the reference of "trench" not "company" in the factions files.
I noticed this too. Though for the MG and mortars this doesn't look strange since they don't seem to have dedicated company objects. It is strange for the Artillery. (The trench objects should be in FactionObjects, StructureHierarchyObjects and BuildableStructureObjects )


引用自 Brutallisck
A further complication is that for the AI to use an emplacement, it must have a reference in the trench configuration template in the .lua files. Haven't got so far to implement this, bit I know that.
I also haven't gotten there yet as i still can't get the emplacement to survive the start of battle.
最后由 TheCampingTurret 编辑于; 2023 年 7 月 20 日 上午 10:44
Torpid 2023 年 7 月 26 日 下午 3:38 
Brushes are probably one of the more complex objects in the game. You can load up TRENCH_SPUR_MG_VICKERS.XML to see as an example (this is the allied MG spur). The first object in that file will be the brush object. Brush objects are what you place in pre-battle and contain the map editor-based object that serves as the "surroundings" of the actual game object.

Brushes are actually a piece of a map, so they are created in the map editor, and then given a specific name. That is not my area of expertise (it is done by artists) so maybe one of them can chime in. In any case, that map piece is referenced in the BrushComponent in the brush object. So in the example, Trench_Spur_MG_Vickers (the brush object) has the BrushComponent.

The component contains the name of the map editor brush piece (in this case British_Vickers_Machinegun_04), as well as the object name of any object contained inside that map piece (in this case, it's the MG turret object Turret_MG_Vickers).

There are two complications here. If you want to have different nationalities of the same brush, then you need to add an OwnedObjectsByNationalityState setup which has the nationality object state and a variant object for each nationality. If you don't need variants, then you can skip this.

The other complication is facing. This is handled in the AngleToTypeMapping block in the TrenchComponent. You only need to do this if you have something that is linking to the trench grid - otherwise, you can skip it. If you load up the brushes in the map editor, you will see that there are multiple rotation angles for each brush with a numeric value (that number is consistent for all brushes in the game and is used for a specific facing direction). If you are using the facing, then you need to list out each facing in the TrenchComponent and then create a variant brush object for each facing (the MG brush has such a setup as a guide, so you can mostly just cut and paste).

It should be noted that The object you have listed in the BrushComponent under OwnedObjects MUST match the object that is actually in the map-editor brush; if not, the game will crash.

Hope that helps; if you have more questions, let me know!
最后由 Torpid 编辑于; 2023 年 7 月 26 日 下午 3:41
TheCampingTurret 1 2023 年 7 月 26 日 下午 6:07 
I have been able to get it working (about 10 minutes after you posted) (using a hex editor and python).

Currently i am still limited by the length of the OwnedObject's name (this is because i don't know where the length indicators are). But i am able to edit the CPBF files to get other OwnedObjects.

引用自 Torpid
Brushes are actually a piece of a map, so they are created in the map editor, and then given a specific name. That is not my area of expertise (it is done by artists) so maybe one of them can chime in. In any case, that map piece is referenced in the BrushComponent in the brush object. So in the example, Trench_Spur_MG_Vickers (the brush object) has the BrushComponent.

That actually explains a lot of what i have seen. So the massive semi repeating part in the center is probably a mesh (3-4 kb on MG, 35 kb on the blockhouse).


引用自 Torpid
If you load up the brushes in the map editor, you will see that there are multiple rotation angles for each brush with a numeric value (that number is consistent for all brushes in the game and is used for a specific facing direction).

As far as i know we don't have access to the map editor. (i could have missed it, i already didn't see the compression algorithm of the files, even though it is really common and the code was literally the first 2 bytes, 3 days...).



But here is it in game:

In shop:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3010402475

Normal MG still works:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3010402413

Modded nest works:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3010402433


I still need to make some icons and probably a model. But progress.
Also need to change the name.
最后由 TheCampingTurret 编辑于; 2023 年 7 月 26 日 下午 6:07
< >
正在显示第 1 - 4 条,共 4 条留言
每页显示数: 1530 50