#That + docs should be more than enough

1 messages · Page 1 of 1 (latest)

glacial frigate
#

Sorry to "reopen" this again, but I'm unsure how to set it up correctly.
I currently tried this:

From ConsoleVaraibles.ini

[Startup]
bSuppressSpamLogs=False

From GAMENAME.h

TAutoConsoleVariable<bool> CVarSuppressSpamLogs(
    TEXT("Kerapac.bSuppressSpamLogs"),
    false,
    TEXT("If true will suppress logs which would be spammed"),
    ECVF_Default
);

#define SPAMM_LOGS_VALUE (CVarSuppressSpamLogs.GetValueOnGameThread() == true)

Within the character class

    bool cBool = SPAM_LOGS_VALUE();

Vscode error while building:

1>E:\UE5_Dev\Tests\UE54\Kerapac\Source\Kerapac\Characters\KerapacCharacter.cpp(99): error C3861: 'SPAM_LOGS_VALUE': identifier not found

honest kite
#

MM

glacial frigate
#

Shouldnt every file in the module automatically have a reference to the module?

honest kite
#

Also that isnt how you do a header console variable

#

you do static and extern

#

I linked the docs before

#

Docs example

// header
    // only needed if you are not in the same cpp file
    extern TAutoConsoleVariable<int32> CVarRefractionQuality; // declare it here

    // get the value on the game thread
    int32 MyVar = CVarRefractionQuality.GetValueOnGameThread(); // how you would use it whenever in a func
 

// cpp
        TAutoConsoleVariable<int32> CVarRefractionQuality(
            TEXT("r.RefractionQuality"),
            2,
            TEXT("Defines the distortion/refraction quality, adjust for quality or performance.\n")
            TEXT("<=0: off (fastest)\n")
            TEXT("  1: low quality (not yet implemented)\n")
            TEXT("  2: normal quality (default)\n")
            TEXT("  3: high quality (e.g. color fringe, not yet implemented)"),
            ECVF_Scalability | ECVF_RenderThreadSafe);
glacial frigate
#

ah. i guess i got my issue. so if i get this correct, than the console-variables are not part of the GAME_API and therefore have to be done as extern

honest kite
#

static and extern are just due to how c++ handles globally defined variables that are referenced across translation units

honest kite
#

@glacial frigate I didnt mean static with extern

glacial frigate
#

i just saw you removing the static just did it myself a second before

honest kite
#

ahah

#

I have that discord syntax error list (aka fuck all but memory while also doing other things)

#

I just realised an was like wait