ActionYAProxyProbe.OnFinishProgressServer logs target.GetObject + parent house + positions to the server RPT (reliable), since this setup's client RPT never captures @YAProxy Prints. Reveals what a non-enumerated proxy (vending machine) resolves to when targeted, to design its override. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| scripts | ||
| $PBOPREFIX$.txt | ||
| config.cpp | ||
| mod.cpp | ||
| README.md | ||
YAProxy
A lightweight DayZ framework (1.29+) for attaching user actions to furniture proxies baked into house models (sinks, fridges, cabinets, vending machines, …), which are not separate entities.
Credit: technique combines Zenarchist's ZenProxyFramework (action API / client→server position sync, invisible-entity persistence pattern) and the ShowMeInfoV2 mod (geometry-LOD proxy enumeration that works on 1.29).
How it works
modded Housereads the building's geometry LOD selections (GetLODByName(LOD.NAME_GEOMETRY).GetSelections()), finds those containing a proxy path, and buildsposition → proxy namemaps (client-side).YAProxyActionBaseresolves which proxy the cursor is on, and syncs the resolved name + world position to the server viaActionData.- Detection uses no entities. (Spawning an invisible marker entity is only one option a consumer can use for persistent state, e.g. "sink is repaired for N days" — handled by the consuming mod, not here.)
Writing an action (consumer mods)
class ActionMySearch : YAProxyActionBase
{
override string GetProxyKeywords() { return "fridge,lekarnicka"; } // substring match; "*" = any
override float GetDuration() { return 3.0; }
override string GetText() { return "Search"; }
// optional extra availability check (client)
override bool YA_ExtraCondition(PlayerBase p, ActionTarget t, ItemBase i, string name, vector ws)
{ return !p.GetItemInHands(); }
override void OnFinishProgressServer(ActionData ad)
{
string proxy = GetProxyName(ad); // synced proxy name
vector ws = GetProxyWS(ad); // synced world position
// ... your effect ...
}
}
Register it (required, or AddAction dereferences null):
modded class ActionConstructor { override void RegisterActions(TTypenameArray a){ super.RegisterActions(a); a.Insert(ActionMySearch); } }
Attach it where it should appear:
- empty-handed →
modded PlayerBase.SetActions(out TInputActionMap m){ super...; AddAction(ActionMySearch, m); } - tool/container in hands →
modded Wrench / Bottle_Base .SetActions(){ super...; AddAction(ActionMySearch); }
For an item-in-hands action, override CreateConditionComponents() to use
CCINonRuined instead of the default CCINotPresent.
Debug / discovery
YAProxyConstants.DEBUG (default true during bring-up) enables:
- per-house scan logs:
[YAProxy] House 'Land_X' proxies built: map1=N map2=M - an empty-handed "Proxy: <name>" action on any proxy that, on execute, dumps the resolved name, local vs world position, the full house proxy map, and the server-synced values.
Set DEBUG = false for production (and remove YAProxyDebug.c if desired).
Notes / limitations
- A building only scans if its script class is
House. Many vanilla buildings aren'tHouseby default; declare themclass Land_X : House {}(see ZenProxyFramework'sScriptedBuildings.cfor a curated list) as needed. - Some proxies are missed by the LOD scan and need manual position overrides (also per-building) — a future addition if required.