Jump to content
Sign in to follow this  
alarm9k

How to write logs on dedicated server?

Recommended Posts

diag_log only writes local messages. How do I enable logging for the script running on the server?

UPDATE: Disregard diag_log part. What I actually need is to see error messages generated on dedicated server.

Edited by alarm9k

Share this post


Link to post
Share on other sites

Maybe with publicVariable and PVEH? :p

init.sqf

if (isServer) then {
serverLog_fnc = {
	private "_param";
	_param = _this;
	diag_log format ["serverLog: %1", _param];
};
"serverLog" addPublicVariableEventHandler {_id = (_this select 1) call serverLog_fnc;};
} else {
waitUntil {!isNull player};
player addAction ["Log To Server",{
	_list = ["me", "you", 99];
	serverLog = format ["%1", _list];
	publicVariable "serverLog";
}];
};

Share this post


Link to post
Share on other sites

My bad, I asked the wrong question :) What I actually need is to see error messages generated by the script running on dedicated server. My script stops running and I cannot figure out why. Testing in single player and local multiplayer doesn't produce errors.

Share this post


Link to post
Share on other sites

Make sure that in your Steam startup parameters that you include -showScriptErrors, and that will popup in any server enviroment when there is a script error.

I'm not sure if there is anyway to capture these and transfer them to any outside file for later reference, but I'm sure if there is it will be brought up after this post :p.

Edited by JShock

Share this post


Link to post
Share on other sites
My bad, I asked the wrong question :) What I actually need is to see error messages generated by the script running on dedicated server. My script stops running and I cannot figure out why. Testing in single player and local multiplayer doesn't produce errors.

Post the script if that's possible

I'm not sure if there is anyway to capture these and transfer them to any outside file for later reference, but I'm sure if there is it will be brought up after this post :p.

Press F12 to take a screenshot in-game :p

Share this post


Link to post
Share on other sites
Press F12 to take a screenshot in-game :p

In....genius.....

And just so this post isn't straight trolling, what about the RPT file, wouldn't that reflect a script error or is it dependent on certain commands/structure of the script itself?

Edited by JShock

Share this post


Link to post
Share on other sites
Post the script if that's possible

Smarter-tanks-script. Be warned: it's big.

-showScriptErrors

Thanks, I'll give it a try!

what about the RPT file

It does contain script errors, but only client-side, not server-side. Or at least this is what I see. If ARMA process is both a server and a client (Play-->Multiplayer-->New), then RPT includes logs from both (which are actually the same one process). If you however run a dedicated server and a client copy of ARMA on the same machine (which I do to offload AI calculations to a different process and increase FPS in client), then RPT does not include server logs.

Edited by alarm9k

Share this post


Link to post
Share on other sites

When you run a local dedicated box you have two rpt files. The folder you created that is called in profiles= in your bat file for starting your local dedicated server will contain all of the rpt logs generated by the server.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×