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())
37 item.SetQuantity(item.GetQuantityMax());
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)
389 Param par =
new Param3<string, EntityAI, Param>(
"PlaceOnSurface" ,
m_ObjectPtr, NULL);
408 Param par =
new Param3<string, EntityAI, Param>(
"SetPosition" ,
m_ObjectPtr,
new Param1<vector>(pos));
459 Param par =
new Param3<string, EntityAI, Param>(
"SetHealth" ,
m_ObjectPtr,
new Param1<float>(value));
529 Param par =
new Param3<string, EntityAI, Param>(
"AddRotation" ,
m_ObjectPtr,
new Param1<float>(add_rot));
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 ObjectDelete(Object obj)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
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.
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
bool IsLinkedWithSceneObject(SceneObject scene_object)
bool CanAttachment(EntityAI e)
void AddRotation(float add_rot)
void EditorShapeUpdatePos()
protected Shape m_DebugShapeBBox
void SetRotation(float rot)
int GetLinkedSceneObjectsCount()
EntityAI GetLinkedObject(int i)
string GetPositionAsString()
void EditorShapeDeselect()
void SetPositionAsString(string string_pos)
void LinkEntityAI(EntityAI e)
void SetPosition(vector pos)
protected string m_InitScript
protected ref map< SceneObject, Shape > m_LinkedSceneObjectsShapes
static const int COLOR_OBJ_BBOX_NORMAL
array< EntityAI > GetAttachments()
TStringArray GetConfigAttachments()
ref array< int > m_LinkedSceneObjectsIndices
void AddAttachment(string att_name)
SceneObject GetLinkedSceneObject(int i)
void SceneObjectSynch(Param p)
protected string m_ObjectNameOrigin
void SetInitScript(string init_script)
void LinkSceneObject(SceneObject scene_object, bool draw_line=true)
protected string m_ObjectName
void EditorLineAdd(SceneObject obj)
protected ref array< SceneObject > m_LinkedSceneObjects
void RemoveAttachment(EntityAI e)
static const int COLOR_OBJ_BBOX_SELECT
protected EntityAI m_ObjectPtr
void EditorShapeSetColor(int color)
void SetHealth(float value)
array< SceneObject > GetLinkedSceneObjects()
void UnlinkSceneObject(SceneObject scene_object)
SceneObject Init(string obj_name, vector pos)
void EditorLineRemove(SceneObject obj)
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.