Commit graph

6 commits

Author SHA1 Message Date
smthspec
4bd4a74152 Support actions on standalone-spawned objects (by classname)
Objects spawned directly in the world (init.c / CE) are real BuildingBase
entities, so attach a Search to them by classname - independent of the proxy
framework (which needs a parent house; CCTCursorParent rejects parentless
objects).

- ActionYASearchObj: object-targeted (CCTNonRuined) Search; resolves the entry
  from target.GetObject().GetType() (substring), cooldown keyed by network id
- modded BuildingBase.SetActions: attaches it to classes matching a search entry
- Shared YAInteractionManager.PerformSearch() used by both proxy + object actions
- Re-add vending_machine (works for standalone-spawned vending machines)

Lets you make spawned loot boxes / vending machines lootable: add the classname
(or a substring) as a 'search' entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 17:23:58 +03:00
smthspec
7fb07aac4a Add per-search find-chance and item count to config
YAInteractableEntry gains SearchChance (% chance a search yields anything),
SearchMin/SearchMax (item count on success), replacing the global roll
constants. Search rolls the chance first; on success spawns a random count in
[SearchMin, SearchMax] from the loot table. Defaults: lekarnicka 60% 1-2,
fridge 75% 1-2. Fields have inline defaults so older JSON loads safely.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 14:23:28 +03:00
smthspec
41c8e29cea Drop vending machine interactable (no targetable proxy object)
Hospital vending machines resolve to target.GetObject()==null, so they can't be
detected or cleanly overridden. Ship sink + fridge + med cabinet (all working).
VendingTable loot kept for future re-add / reuse on a detectable furniture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 14:12:01 +03:00
smthspec
5a07c85416 Rebuild interaction layer on @YAProxy (1.29-working)
Replace the ZenProxyFramework dependency (broken on 1.29) with @YAProxy, our
self-contained proxy framework. Actions now extend YAProxyActionBase:

- Search / RepairSink / GatherWater resolve the targeted furniture proxy by
  keyword and use the synced world position from YAProxy
- Confirmed proxy names from live test: case_sink_a, fridge, lekarnicka
  (vending defaulted to 'sodamachine' pending confirmation)
- Registry lookup matches proxy names as substrings (handles '.001' suffix)
- Sink repaired-state + search/water cooldowns tracked server-side, keyed by
  proxy world position / player UID (in-memory, reset on restart per v1 spec)
- Repair on Wrench/PipeWrench, GatherWater on Bottle_Base (item-based, load-
  order safe); Search on PlayerBase

requiredAddons: YAProxy. Loot tables / settings JSON unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 09:58:00 +03:00
smthspec
c1cd01f224 Replace EnScript config with JSON-based system
Move the registry, loot tables and scalar tunables out of hardcoded EnScript
into JSON loaded via DayZ's JsonFileLoader. Defaults are written to
<ProfileFolder>/YAInteraction/{settings.json,interactables.json} on first start
and read back (overriding code defaults) on subsequent starts.

- Add YAInteractionSettings (settings.json) and YAInteractionData
  (interactables.json) serializable classes with inline defaults
- Add YAInteractionConfigLoader singleton: MakeDirectory + FileExist driven
  load-or-save, plus client-safe in-code default fallback (EnsureDefaults)
- Load server-side via modded MissionServer.OnInit before players connect
- Gut YAInteractionConfig down to compile-time constants
- Rebuild manager lookups from loaded Data; update field names and float weights
- Remove redundant 5_Mission placeholder; update README

CF persistence and config hot-reload remain marked with // TODO (v2).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 21:45:56 +03:00
smthspec
ac90535b5e Initial commit: YAInteraction DayZ mod
Searchable furniture (med cabinet, fridge, vending machine) with weighted,
config-driven loot tables, and a two-stage repairable sink (repair then gather
water). Data-driven registry, in-memory cooldowns/repair state with v2 CF hooks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 21:11:55 +03:00