Recommended Posts

Rellimarual    1,657

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.

Share this post


Link to post
Share on other sites
CarlZalph    1,529
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")))

  • Like 3

Share this post


Link to post
Share on other sites
Rellimarual    1,657

I don't seem to have access to the server's console, since it's rented, but I'll try the talker component. Thanks!

 

Share this post


Link to post
Share on other sites
Rellimarual    1,657

This used to work and now no longer does. Were changes made to console commands?

Share this post


Link to post
Share on other sites
Daniel86268    22

Afaik there were no recent changes. Did you paste the command in? If yes, did you make sure that you still had the "Remote:" in front? Otherwise you just executed it clientside which doesn't do much.

  • Like 1

Share this post


Link to post
Share on other sites
Rellimarual    1,657

I'm not sure about whether "Remote" was in effect. I'll doublecheck next time I play. The command does get the character to speak , but it returns a number (0) that I know is inaccurate.

Share this post


Link to post
Share on other sites
Daniel86268    22

Make sure you spelled the prefab correctly as well. Some prefabs also have a pretty weird naming, so make sure you get that one right as well.

Share this post


Link to post
Share on other sites
Rellimarual    1,657

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.

Share this post


Link to post
Share on other sites
Daniel86268    22

With different server you mean dedicated vs local hosted one? Because that would make sense since I think local hosted servers don't have that remote one, so pasting it wouldn't trigger it with ctrl.

Share this post


Link to post
Share on other sites
Rellimarual    1,657

No, I meant different dedicated servers. I was logging into various unpassworded servers looking for one with four walrus camps.

Share this post


Link to post
Share on other sites
Daniel86268    22

I wouldn't have expected that you'd be able to use commands like that on servers without being owner or admin. (Unless configured otherwise.)

Share this post


Link to post
Share on other sites
Rellimarual    1,657

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?

Share this post


Link to post
Share on other sites
Daniel86268    22

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:

Share this post


Link to post
Share on other sites
Electroely    1,762
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.

Share this post


Link to post
Share on other sites
Rellimarual    1,657
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.

Share this post


Link to post
Share on other sites
Daniel86268    22
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.

  • Like 1

Share this post


Link to post
Share on other sites
Electroely    1,762
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.

Share this post


Link to post
Share on other sites
Daniel86268    22
Just now, Electroely said:

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

That makes sense. So I guess it's executed clientside then and the client just lists all available/loaded prefabs.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this