A note on the NDF Reference manual

User avatar
Gronank
Colonel
Posts: 2511
Joined: Tue 8 Nov 2011 23:40
Contact:

A note on the NDF Reference manual

Postby Gronank » Mon 24 Apr 2017 15:04

In the NDF Reference manual we can read: "Integers are written in base 10, there is no binary or hexadecimal notation."
Right, but then here's TerrainType.ndf:

Code: Select all

ETerrainType is CommonTerrainType
(
    Littoral               is 0x00400000
    TerrainBlocageHauteMer is 0x00800000
    HauteMer               is 0x01000000
    Batiment2              is 0x02000000
    Batiment3              is 0x04000000
    Batiment4              is 0x08000000
    Batiment5              is 0x10000000
    TerrainBlocageLittoral is 0x20000000
    TerrainBlocageBeach    is 0x40000000
)

You know what I would call that? hexadecimal notation.
Image

Sahnvour
Specialist
Posts: 11
Joined: Mon 10 Apr 2017 15:26
Contact:

Re: A note on the NDF Reference manual

Postby Sahnvour » Mon 24 Apr 2017 15:32

Hello,

You got me! ;)
I am aware of that, in fact it is already corrected but the manual hasn't been updated yet on the steam version. As you guessed this is not (yet) the absolute NDF guide but we're working on it. It is also possible that you encounter some deprecated or undocumented constructs, but in any case don't hesitate to post feedback here.

User avatar
Gronank
Colonel
Posts: 2511
Joined: Tue 8 Nov 2011 23:40
Contact:

Re: A note on the NDF Reference manual

Postby Gronank » Tue 25 Apr 2017 14:32

More pedantic details!

The reference manual states:

Code: Select all

$/Path/To/OtherObject // absolute reference ~/Path/To/OtherObject // reference from the loading namespace (can't be known by the  modder)

It is not entirely true that the modder can't know the loading namespace. Using the community modding tool to open \Gen\PC\NDF\Patchable\GFX\Everything_SourceHashes.ndfbin, one can clearly see that (almost) everything in CommonData and GameData is loaded into /GFX/everything/. This isn't entirely frivolous because in \GameData\Gameplay\Decks\Decks.ndf the absolute path is used to reference deck pack descriptors. The use of the absolute path here is potentially confusing since it breaks the pattern used elsewhere to use the loading namespace (~/) in this kind of situation.
Image

Sahnvour
Specialist
Posts: 11
Joined: Mon 10 Apr 2017 15:26
Contact:

Re: A note on the NDF Reference manual

Postby Sahnvour » Tue 25 Apr 2017 16:32

Although there may be hints in the NDF files, this statement in the manual stays true, modders do not have direct access to the definition of namespaces since we do not explicitely support the inspection of ndfbin files (eh, that's the point of official modding right ? :) ).

In your example, absolute references are used but they could very well be relative or direct references since this file is loaded in the same namespace as the descriptors referenced, ie. GFX/Everything. In other words, the '$/GFX/Everything' part is optional.

The reason this is mentionned in the manual is to make the modder aware that some objects may be referenced but not included in the moddable files.

Who is online

Users browsing this forum: No registered users and 1 guest