Jump to content

Console question


Recommended Posts

I'm relatively new to using the console and I want to count the number of a prefab in the world. When I enter the command "c_countprefabs("prefab")" where does the response print? I'm not seeing it on my game screen. This is on a dedicated server.

Link to comment
Share on other sites

12 minutes ago, Rellimarual said:

where does the response print? I'm not seeing it on my game screen. This is on a dedicated server.

It prints on the server's console and in the server's server_log.txt file.

If you're just printing out small things, then you can use your player's talker component to network it so you can quickly see it:

ThePlayer.components.talker:Say(tostring(c_countprefabs("prefab")))

Link to comment
Share on other sites

I'm just cutting and pasting, which is why it was so confusing that it worked perfectly a few times then not: I'd cut and pasted the same text. But if the console is in the wrong mode that might explain it. What changed was the server I'd used it on.

Link to comment
Share on other sites

Huh. Well, I WAS able to use it on one, but then after that I used it to generate a four-Tusk world on my own server, so maybe that first open server I tried it on had somehow enabled regular players to use admin-level console commands?

Link to comment
Share on other sites

That's what I'd assume, since console commands are usually admin only. (Which kinda makes sense.) Not sure why or how you'd enable console commands for all users. I guess there are reasons and ways to do it. Maybe that one even was a server someone set up to play with friends and wanted all of them to have access to console commands and was too lazy to add them all as admins. (And forgot to set a Pw) :wilson_ecstatic:

Link to comment
Share on other sites

50 minutes ago, Rellimarual said:

Huh. Well, I WAS able to use it on one, but then after that I used it to generate a four-Tusk world on my own server, so maybe that first open server I tried it on had somehow enabled regular players to use admin-level console commands?

While the command will tell you a number, it won't be the actual number of walrus worlds in the world. It only counts loaded entities.

Link to comment
Share on other sites

3 minutes ago, Electroely said:

While the command will tell you a number, it won't be the actual number of walrus worlds in the world. It only counts loaded entities.

I *swear* I got this to work just fine on the dedicated server I rent. I started several worlds because I didn't want to invest in a one-Tusk  map, and I got numbers ranging from 1 to 4. Recently on a public server I tried it while standing right next to the camp and got 0.

Link to comment
Share on other sites

10 minutes ago, Electroely said:

While the command will tell you a number, it won't be the actual number of walrus worlds in the world. It only counts loaded entities.

As admin on a server you CAN use this command to count all entities in the entire map.

As non-admin player you probably just get a 0 just like the boolean false aka nope, you can't execute this command.

Link to comment
Share on other sites

9 hours ago, Daniel86268 said:

As admin on a server you CAN use this command to count all entities in the entire map.

As non-admin player you probably just get a 0 just like the boolean false aka nope, you can't execute this command.

Sorry, I wasn't specific enough. It only counts loaded entities when ran as a non-admin.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...