Request: expose worker data on g_currentMission for cross-mod access
Hi! We're building an integration between FS25_NPCFavor and ContractorMod so that contractor workers appear as named NPCs in the favor/relationship system. Players can then build relationships with their hired crew over time.
The problem:
FS25 sandboxes each mod's Lua environment. g_contractormod is set via getfenv(0) inside your mod's environment, so it's not visible from other mods. Same applies to the ContractorMod class table. This means we can't access ContractorMod.workers from NPCFavor.
We can detect ContractorMod is loaded via g_modManager:getModByName("FS25_ContractorMod"), but we can't read worker names or positions.
What we're asking for:
A single line in your load() function that exposes the workers table on g_currentMission, similar to how NPCFavor exposes its system:
-- In ContractorMod main.lua, after contractormod is created:
mission.contractorWorkers = ContractorMod.workers
This gives other mods read-only access to worker names, positions, and current vehicle — enough to build integrations without coupling to your internals.
Our end is ready. NPCFavor already checks g_currentMission.contractorWorkers as its primary access path and falls back gracefully if it's nil. The moment you expose it, workers will automatically appear in the NPCFavor list with their real names.
Currently we're falling back to g_npcManager HELPER* entries which gives us the right worker count but only generic names ("Worker 1", "Worker 2").
Thanks for the great mod — the role-play management angle is exactly what FS25 needs!
Request: expose worker data on g_currentMission for cross-mod access
Hi! We're building an integration between FS25_NPCFavor and ContractorMod so that contractor workers appear as named NPCs in the favor/relationship system. Players can then build relationships with their hired crew over time.
The problem:
FS25 sandboxes each mod's Lua environment.
g_contractormodis set viagetfenv(0)inside your mod's environment, so it's not visible from other mods. Same applies to theContractorModclass table. This means we can't accessContractorMod.workersfrom NPCFavor.We can detect ContractorMod is loaded via
g_modManager:getModByName("FS25_ContractorMod"), but we can't read worker names or positions.What we're asking for:
A single line in your
load()function that exposes the workers table ong_currentMission, similar to how NPCFavor exposes its system:This gives other mods read-only access to worker names, positions, and current vehicle — enough to build integrations without coupling to your internals.
Our end is ready. NPCFavor already checks
g_currentMission.contractorWorkersas its primary access path and falls back gracefully if it's nil. The moment you expose it, workers will automatically appear in the NPCFavor list with their real names.Currently we're falling back to
g_npcManagerHELPER* entries which gives us the right worker count but only generic names ("Worker 1", "Worker 2").Thanks for the great mod — the role-play management angle is exactly what FS25 needs!