nickcage 0 Posted June 5, 2021 hi I'm using the https://community.bistudio.com/wiki/profileNameSteam command to display it as a string on RSC text box my init.sqf: _mySteamProfileName = profileNameSteam; My command line: _cuck = _mySteamProfileName; _dialog = findDisplay -9; _ctrl = _dialog displayCtrl 1000; _ctrl ctrlSetText format ["The Cuck is: %1", _cuck]; Does it not produce a string? Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 5, 2021 U linked the biki entry ... it returns a string. I have no clue bout dialogs but i guess u cant use a local variable there which was set in init.sqf Share this post Link to post Share on other sites
nickcage 0 Posted June 5, 2021 Its a variable right? that displays as a string? So what your saying is is should define it a public variable? Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 5, 2021 depends on your purpose but I guess a global variable would be enough: //local - known on the scope ("script") where defined only _mySteamProfileName = profileNameSteam; //global - known in every script on the machine (client/server) where defined mySteamProfileName = profileNameSteam; //public - known in every script on every connected machine missionNamespace setVariable [ "mySteamProfileName", profileNameSteam, true ]; Share this post Link to post Share on other sites
beno_83au 1369 Posted June 5, 2021 Why not just: _ctrl ctrlSetText format ["The Cuck is: %1",profileNameSteam]; And local variables (being with _) are not accessible outside of where they were defined, to put it fairly basically. Share this post Link to post Share on other sites
nickcage 0 Posted June 5, 2021 So what I'm trying to do is display the steam username of the person that plays this scenario on a dialog textbox. Anyone able to fix my janky code so it executes and displays the users steam name on a textbox? This might not even be possible? Share this post Link to post Share on other sites
nickcage 0 Posted June 5, 2021 20 minutes ago, beno_83au said: Why not just: _ctrl ctrlSetText format ["The Cuck is: %1",profileNameSteam]; And local variables (being with _) are not accessible outside of where they were defined, to put it fairly basically. Tried it doesn't work thanks for trying. Share this post Link to post Share on other sites
nickcage 0 Posted June 5, 2021 24 minutes ago, sarogahtyp said: depends on your purpose but I guess a global variable would be enough: //local - known on the scope ("script") where defined only _mySteamProfileName = profileNameSteam; //global - known in every script on the machine (client/server) where defined mySteamProfileName = profileNameSteam; //public - known in every script on every connected machine missionNamespace setVariable [ "mySteamProfileName", profileNameSteam, true ]; Your an absolute legend. I totally forgot about public variables on connected machines. i'll remember to double check my work Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 5, 2021 a global variable is enough because the event script init.sqf is executed on every machine. Share this post Link to post Share on other sites
nickcage 0 Posted June 5, 2021 yeah both should work. I'm only new to C++ thanks. Share this post Link to post Share on other sites