We've moved! Join us as we continue development on our new site at umod.org!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  1. Currently decompiling rust to look at how items are placed (like lanterns, etc.) As i need this concept as a part of a plug-in i wish to create.

    Was wondering if anyone has already discovered this? it'd mean a lot if someone was able to save me this time and let me know where to find it.
  2. This is kind of a hacky way to do it, I'm sure there are better ways, but here is how I normally spawn deployables.

    Item item = ItemManager.CreateByName("wall.external.high.stone", 1);
    var deployable = item.info.GetComponent<ItemModDeployable>().entityPrefab.resourcePath;
    var entity = GameManager.server.CreateEntity(deployable, position, rotation, true);
    Valkaaire likes this.
  3. Thank you so much! I was just going through the files and really wasn't having a good time (I know i have all the files that contain the whole procedure but having to find the relevant code i need is time consuming going through loads of .cs files)

    From having read it it seems like it'd be good, i'll have a look.

    Thank you buddy!
  4. Unless you have a reason to keep the item, you don't need to create a new one. You can make that code a bit better by changing it from creating an item to simply finding the ItemDefinition:
                var def = ItemManager.FindItemDefinition("wall.external.high.stone");
                var deployable = def.GetComponent<ItemModDeployable>().entityPrefab.resourcePath;
                var entity = GameManager.server.CreateEntity(deployable, position, rotation, true);
  5. I'm planning on trying to deploy the item in the same way that items do in the game (With the blue gizmo) for the item i want to make placeable, i just needed a contingency solution incase i am unable.

    The items i want to spawn are permanent, but thank you for trying to help me out! :)