Maybe it will be interesting for someone? http://pastebin.com/q4zqTbrt
What is it? Bones, animations, weapons, entities...
How to generate:
How to spawn:Code:local no_spawn = {} local nulvector = new(UnityEngine.Vector3._type,nil) local nulquaternion = new( UnityEngine.Quaternion._type, nil ) local enum = global.GameManifest.Get().pooledStrings:GetEnumerator() print("------------ Spawn as entity: true ------------") while enum:MoveNext() do local prefab = enum.Current.str if global.GameManager.CreateEntity(prefab, nulvector, nulquaternion) then print(prefab) else table.insert(no_spawn, prefab) end end print("---------------------------------------------------") print("------------ Spawn as entity: false ------------") for i=1, #no_spawn do print(no_spawn[i]) end print("---------------------------------------------------")
Code:local pos = player.transform.position local rot = player.transform.rotation local ent = global.GameManager.CreateEntity("ENTITY NAME(like 'npc/animals/wolf_corpse')", pos, rot) ent:Spaw() -- Simple spawn at position - 'pos' ent:Kill(ProtoBuf.Mode.None,0,0,new(UnityEngine.Vector3._type,nil))
Some Rust Names
Discussion in 'Rust Development' started by Bombardir, Dec 7, 2014.
-
This is really helpful!
Given these "names", how can I check to see if an entity is one of these? So if I had a specific entity as a variable (lets say a supply_drop), how can I check if that entity is a supply_drop, or something else? -
[DOUBLEPOST=1419267628][/DOUBLEPOST]or i could just tell you that it's that : items/supply_dropCode:
local no_spawn = {} local nulvector = new(UnityEngine.Vector3._type,nil) local nulquaternion = new( UnityEngine.Quaternion._type, nil ) local enum = global.GameManifest.Get().pooledStrings:GetEnumerator() print("------------ Spawn as entity: true ------------") while enum:MoveNext() do local prefab = enum.Current.str local entity = global.GameManager.CreateEntity(prefab, nulvector, nulquaternion) if entity:GetComponentInParent(global.SupplyDrop._type) then print(prefab) end end print("---------------------------------------------------")
^^ -
I'm trying to add items to a players inventory, however I'm having troubles figuring out the names for certain objects. For example, I can do inv:GiveItem("bandage", 1), but if I try to do inv:GiveItem("pistol_bullet", 1) it doesn't work because pistol_bullet is not the correct name. Is there a list that I can use to get the desired names? Or even a function in which the user can write simplified names such as "Pistol Bullet" and the code would know what I am looking for?
Thanks -
http://oxidemod.org/resources/kits.668/
look how i initialise the table.
so you can use "Pistol Bullet"
all your answers should be there.
EDIT: or in here: http://oxidemod.org/resources/give.666/
