#That + docs should be more than enough
1 messages · Page 1 of 1 (latest)
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
MM
Shouldnt every file in the module automatically have a reference to the module?
Your define is SPAMM
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);
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
static and extern are just due to how c++ handles globally defined variables that are referenced across translation units
if you want cross module stuff but you shouldnt need that
@glacial frigate I didnt mean static with extern
i just saw you removing the static just did it myself a second before