What deterimes if server Script print() shows up in Studio output window during "Play"?

In Roblox Studio, if I run the Script below using “Run” the output window shows all print() output.


print(“SERVER: Top of script!”)
local RunService = game:GetService(“RunService”)

local function checkDelta(deltaTime)
	print("SERVER: Time since last render step:", deltaTime)
end
 
RunService:BindToRenderStep("Check delta", Enum.RenderPriority.First.Value, checkDelta)

wait(1)
print(“SERVER: Bottom of script”)

image

But if run it using “Play” I get the following output:

image

If I use “Play” and under the Test tab switch to “Current: Server”, I start seeing callback function output again.

If under the Test tab, I use the “Clients and Servers” method of testing (with a 20 second wait so client has time to launch), the server output window shows all the output and client output window shows none of the output.

I started wih a new baseplate place/.rblx file and the only thing I added was the above Script inside of ServerScriptService.

So what determines whether the output from a Script’s print() statement goes to the output window or not in Studio when “Play” is used and the current view under the Test tab is the client?

Why do I ask? I’m newish to Roblox development and am trying to figure out how things work–in particular how the task schedule plays out between the server and the client. This trait caught me by surprise. At first I didn’t think the callback was being executed.

Maybe this is a Studio bug not a feature. I just don’t know.

Thanks.

This post may explain why it happen:

@Block_manvn, thanks for replying.

That topic relates more to what runs on the client or on the server–which admittedly is part of what my test was all about–rather than why the results of some of the Script/Server print() statements appear in the output window and some don’t.

Sort of off topic, but before stripping my initial test down for simplicity when posting my question, I had an essentially identical LocalScript running under StarterPlayerScripts.When I test that place using the “Clients and Servers” method under the Test tab, I can see that both the Script and the LocalScript produce text as expected, so BindToRenderStep works on both client and server.

I could output tick() at the front of each print() statement, run “Clients and Servers” testing, then combine the output of each into a single file and sort by the tick value to see what runs when. As I add callbacks for other parts of the task scheduler process I will probably end up doing that.

But since some Script print() statements’ results were shown in the output window when “Play” testing, I had the expectation that all Script print() statements’ results would be shown in the output window and that expectation proved erroneous.

Or maybe the output is missing because under the particular scenario, the callback function is actually not being run–which I would consider to be a Roblox bug.

As I expand my testing, I might figure it out, but for now I am wondering if anyone knows what the cutoff is so I can avoid further befuddlement down the road.

Thanks again.

But since some Script print() statements’ results were shown in the output window when “Play” testing, I had the expectation that all Script print() statements’ results would be shown in the output window and that expectation proved erroneous.
Or maybe the output is missing because under the particular scenario, the callback function is actually not being run–which I would consider to be a Roblox bug.

Actually, it’s not bug. Server don’t need to render anything when “Play” testing because it can take a lot of Server’s resources and Clients are the only one who need to see what happen in the game so RunService.RenderStepped event won’t fire in the Server when you play as the Client.

But when you switch to the Server(or use “Run” test), you are the Server now and you can see everything in the game as the Server and it has to render to you could see what is in the game, so RunService.RenderStepped event would be fire in the Server.

1 Like

It’s the same topic. RenderStepped will only fire on a machine that is rendering. The server renders nothing in the live game, but it does when testing to show you what stuff looks like on the server.

Heartbeat and Stepped are the only ones consistently on the server, as mentioned in that post.

2 Likes

Just in case you (anyone) missed it:
https://developer.roblox.com/en-us/articles/game-testing

And it finally seeps through my thick skull. Thank you @Block_manvn and @BanTech for your kind patience while assisting.

I would think that such a description would be a good addition to the BindToRenderStep documentation page–saving us noobs some time. I know it says that BindToRenderStep can only be called on the client, but to the noob, it clearly let me call it without an error and apparently the callback was being executed. And I’ve seen other posts mentioning errors in the documenation that were similar to what I thought was an issue here (Heartbeat documentaion incorrect: Can be used on server) so unfortunately I assumed the documentation was a bit off.

The weird part is, I don’t even plan on using BindToRenderStep, I was just testing stuff.

Thank you again.

Thank you (see above reply to @Block_manvn)