22 if (!target || !target.GetObject() || player.GetCommand_Ladder() || player.GetCommand_Fall() )
41 building.GetActionComponentNameList(target.GetComponentIndex(), selections);
42 foreach (
string tmp : selections)
44 if (tmp.Length() >= 6 && tmp.Substring(0,6) ==
"ladder" && tmp.IndexOfFrom(6,
"_") < 0)
51 if (compName ==
string.
Empty)
54 string condCompName =
string.Format(
"%1_con", compName);
55 vector pos = player.GetPosition();
58 vector ladderEnterPointGlobal;
59 vector ladderDirPointGlobal;
60 float minDistanceSq = 100.0;
62 string dirCompName =
string.Format(
"%1_con_dir", compName);
64 for (
int i = 0; i < memSelection.Count(); i++ )
66 if ( memSelection[i].
GetName() == condCompName )
69 for(
int j = 0; j < memSelection[i].GetVertexCount(); j++ )
71 ladderEnterPointGlobal = building.ModelToWorld( memSelection[i].GetVertexPosition(lod, j) );
84 for (
int k = 0; k < memSelection.Count(); k++)
86 if( memSelection[k].
GetName() == dirCompName )
88 for(
int l = 0; l < memSelection[k].GetVertexCount(); l++ )
90 vector dirPoint = building.ModelToWorld( memSelection[k].GetVertexPosition(lod, l) );
92 if( dst < minDistanceSq)
95 ladderDirPointGlobal = dirPoint;
103 pos = pos - ladderEnterPointGlobal;
104 ladderDirPointGlobal = ladderDirPointGlobal - ladderEnterPointGlobal;
108 if ( angle < 90 || angle > 270)
119 super.Start(action_data);
125 string compName =
"";
126 building.GetActionComponentNameList(action_data.
m_Target.GetComponentIndex(), selections);
127 foreach (
string tmp : selections)
129 if (tmp.Length() >= 6 && tmp.Substring(0,6) ==
"ladder" && tmp.IndexOfFrom(6,
"_") < 0)
138 string ladderType =
"metal";
149 action_data.
m_Player.SetClimbingLadderType(ladderType);
150 action_data.
m_Player.StartCommand_Ladder(building, ladderIndex );
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
ref ActionTarget m_Target
override bool CanBeUsedSwimming()
override void CreateConditionComponents()
override bool IsLockTargetOnUse()
override void Start(ActionData action_data)
override bool IsInstant()
const string MEM_LOD_NAME
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
const string GEOM_LOD_NAME
void ActionInteractBase()
Super root of all classes in Enforce script.
proto static native bool DebugDrawLadder(Building pBuilding, int pLadderIndex)
debug draws any ladder
proto static native int DebugGetLadderIndex(string pComponentName)
proto native owned string GetPropertyValue(int index)
static const string NAME_MEMORY
proto native int GetPropertyCount()
static const string NAME_GEOMETRY
proto native owned string GetPropertyName(int index)
proto native bool GetSelections(notnull out array< Selection > selections)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
DayZPlayerConstants
defined in C++
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float AbsFloat(float f)
Returns absolute value.