Is it possible to spawn a non-BaseEntity prefab and place it arround the map ?
I tried using GameManager.server.CreatePrefab which seems to work except no player can see the object spawned. I somewhat randomly tried to add BaseEntity and BaseNetworkable components, and use TransformChanged & SendNetworkUpdateImmediate to no effect.
Edit: I did look at the Build and HideAnSeek plugins, but it seems they can only spawn Resources (tree, minerals ...), Deployables (mines & co) and BuildingBlocks. Im trying to spawn decor elements : Bushes, large rocks & other props.
Spawning a bush / prop ? (not BaseEntities)
Discussion in 'Rust Development' started by Yatta, Jul 28, 2016.
-
I would love to learn how to do this as well, please post it if you find out, and the answer doesn't show up here.
-
The problem with spawning decor elements is that you can perfectly spawn them on the server but they will not be there on the client(s) because they are not networked. Currently these objects are generated on the client based on the server's seed. I can't tell for sure but it might be possible to spawn them on the clients if you manage to get them to spawn as an entity that is networked to the client(s). I'll see if I can find some time to run a few tests one of these days.
-
Thank you. Looking forward to your results.
-
assuming they changed it .uhm.... like..a year ago? .... cause it WAS possible to do that ..... sadly
-
I suppose there must still be a way to do it. Its a prefab that exist client side, and Unity surely has a way to tell a client to spawn one. However im not sure if/how much Rust relies on the Unity network system or their own. I was thinking about turning a regular prefab into a BaseEntity, or spawning a BaseEntity then changing its prefab, but not sure how to do that.
-
Hello, little bump here, hoping someone has found a way to do that.
So far all I could do is spawn a working object server-side (by Instantiating an already existing one) whose collisions actually affect players, but I could never send the object spawn information to the players. I dont know how to properly initialize a "custom" BaseEntity / BaseNetworkable that could allow to send the update to the clients.
I tried to dig in Rust network code but im afraid its too complicated for me.
Any chances an Oxide developer has a solution, or maybe even make a tool for that in a future version ? Being able to place any objects from the assets list could be open a lot of possibilities for plugins / mod developement.