It simply doesn’t work.
[code]#include <GDCpp/RuntimeScene.h>
#include <windows.h>
#include <tchar.h>
void WinUserName(RuntimeScene & scene)
{
//For now, we’re just changing a variable to check if the function works.
scene.GetVariables().Get(“test”) = “player”;
char user_name[256];
DWORD user_name_size = sizeof(user_name);
if (GetUserName(user_name, &user_name_size)){
scene.GetVariables().Get(“usrName”) = user_name;}
else {
scene.GetVariables().Get(“usrName”) = “player”;
}
}[/code]
(my functions.cpp file)
I’ve used as a template example for setting variable via c++ feature. It compiled just fine, but couldn’t execute. At first I’ve thought it’s because windows.h just isn’t there, so I’ve placed unconditional change to another variable. Nope, didn’t work. Both variables remained at their defaults (0).
Then I’ve thought it’s because of “if (scene.IsFirstLoop())” in execution event. So I’ve commented it out. Nope, didn’t fix the issue either.
Unfortunately I don’t know what to do. Maybe API has changed and that example for variable change is no longer valid, but still compiles? I dunno.