Debug: add position-probe action for non-enumerable proxies

ActionYAProxyProbe shows on any building surface (no proxy match needed) and
logs the cursor-hit position (world, model-space via WorldToModel, and house-
relative) plus target.GetObject type. Lets us capture vending-machine-style
proxies that don't appear in the geometry-LOD scan, to register as overrides.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
smthspec 2026-06-19 11:08:14 +03:00
parent b54c053e13
commit 54bdfb3a19

View file

@ -78,6 +78,84 @@ class ActionYAProxyDebug : YAProxyActionBase
}
}
// ----------------------------------------------------------------------------
// ActionYAProxyProbe - shows on ANY building surface (no proxy match needed).
// Use it to capture the position of proxies that DON'T enumerate in the scan
// (e.g. vending machines), so they can be added as manual overrides. Logs the
// cursor-hit position several ways (the model-space one is what an override
// would use).
// ----------------------------------------------------------------------------
class ActionYAProxyProbeCB : ActionContinuousBaseCB
{
override void CreateActionComponent()
{
m_ActionData.m_ActionComponent = new CAContinuousTime(1.0);
}
}
class ActionYAProxyProbe : ActionContinuousBase
{
void ActionYAProxyProbe()
{
m_CallbackClass = ActionYAProxyProbeCB;
m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
m_FullBody = true;
m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
}
override string GetText()
{
return "YA: Probe Pos";
}
override void CreateConditionComponents()
{
m_ConditionItem = new CCINotPresent();
m_ConditionTarget = new CCTCursorParent(UAMaxDistances.DEFAULT);
}
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
{
if (GetGame().IsDedicatedServer())
return true;
if (player.GetItemInHands())
return false;
return House.Cast(target.GetParent()) != null; // any building surface
}
override bool IsLockTargetOnUse()
{
return false;
}
override void OnFinishProgressClient(ActionData action_data)
{
ActionTarget t = action_data.m_Target;
House h = House.Cast(t.GetParent());
if (!h)
return;
Object obj = t.GetObject();
vector hitW = t.GetCursorHitPos();
Print("[YAProxy][PROBE] ===== position probe =====");
Print("[YAProxy][PROBE] house = " + h.GetType());
if (obj)
{
Print("[YAProxy][PROBE] target.GetObject type = " + obj.GetType());
Print("[YAProxy][PROBE] obj.GetPosition (local) = " + obj.GetPosition().ToString(false));
Print("[YAProxy][PROBE] obj.GetWorldPosition = " + obj.GetWorldPosition().ToString(false));
}
else
{
Print("[YAProxy][PROBE] target.GetObject = null (cursor on house geometry)");
}
Print("[YAProxy][PROBE] cursorHit world = " + hitW.ToString(false));
Print("[YAProxy][PROBE] cursorHit model (W2M) = " + h.WorldToModel(hitW).ToString(false));
Print("[YAProxy][PROBE] cursorHit (hit-housePos) = " + (hitW - h.GetPosition()).ToString(false));
}
}
// --- registration (debug only) ---
modded class ActionConstructor
{
@ -85,6 +163,7 @@ modded class ActionConstructor
{
super.RegisterActions(actions);
actions.Insert(ActionYAProxyDebug);
actions.Insert(ActionYAProxyProbe);
}
}
@ -97,7 +176,8 @@ modded class PlayerBase
if (YAProxyConstants.DEBUG)
{
AddAction(ActionYAProxyDebug, InputActionMap);
Print("[YAProxy] Debug proxy action registered on player");
AddAction(ActionYAProxyProbe, InputActionMap);
Print("[YAProxy] Debug proxy actions registered on player");
}
}
}