28 PluginDeveloper module_dev = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
29 EntityAI e = module_dev.SpawnEntityOnGroundPos(PluginSceneManager.PLAYER, obj_name, 100, 0.0, pos);
36 if (item.HasQuantity())
43 else if (obj_name !=
"player")
152 size[0] = min_max[1][0] - min_max[0][0];
153 size[2] = min_max[1][2] - min_max[0][2];
154 size[1] = min_max[1][1] - min_max[0][1];
179 float width = size[0];
180 float height = size[1];
181 float length = size[2];
183 float width_h = width*0.5;
184 float lenght_h = length*0.5;
242 pos1[0] = 0; pos1[1] = pos1[1] / 2; pos1[2] = 0;
243 pos1 = pos1 + obj.
GetObject().GetPosition();
246 pos2[0] = 0; pos2[1] = pos2[1] / 2; pos2[2] = 0;
314 for (
int i = 0; i < link_count; ++i)
535 v[0] = v[0] + add_rot;
548 GetObject().GetInventory().CreateAttachment(att_name);
556 return GetObject().GetInventory().CanAddAttachment(e);
574 for (
int i = 0; i <
GetObject().GetInventory().AttachmentCount(); ++i)
576 ret.Insert(
GetObject().GetInventory().GetAttachmentFromIndex(i));
607 return cfg_attachments;
PluginBase GetPlugin(typename plugin_type)
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
bool IsKindOf(string cfg_class_name, string cfg_parent_name)
Returns is class name inherited from parent class name.
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native void ObjectDelete(Object obj)
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
void AddRotation(float add_rot)
int GetLinkedSceneObjectsCount()
void EditorShapeDeselect()
array< SceneObject > GetLinkedSceneObjects()
ref array< SceneObject > m_LinkedSceneObjects
SceneObject GetLinkedSceneObject(int i)
bool IsLinkedWithSceneObject(SceneObject scene_object)
void LinkEntityAI(EntityAI e)
void SetInitScript(string init_script)
EntityAI GetLinkedObject(int i)
TStringArray GetConfigAttachments()
void SetRotation(float rot)
ref array< int > m_LinkedSceneObjectsIndices
void SetPositionAsString(string string_pos)
void SetHealth(float value)
void EditorShapeUpdatePos()
void RemoveAttachment(EntityAI e)
void AddAttachment(string att_name)
static const int COLOR_OBJ_BBOX_NORMAL
void EditorLineAdd(SceneObject obj)
void EditorShapeSetColor(int color)
void LinkSceneObject(SceneObject scene_object, bool draw_line=true)
void EditorLineRemove(SceneObject obj)
string GetPositionAsString()
array< EntityAI > GetAttachments()
bool CanAttachment(EntityAI e)
void SetPosition(vector pos)
SceneObject Init(string obj_name, vector pos)
ref map< SceneObject, Shape > m_LinkedSceneObjectsShapes
void SceneObjectSynch(Param p)
static const int COLOR_OBJ_BBOX_SELECT
string m_ObjectNameOrigin
void UnlinkSceneObject(SceneObject scene_object)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool beautify=true)
Vector to string.
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
array< string > TStringArray
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
const string STRING_EMPTY
proto vector ToVector()
Returns a vector from a string.