Leopold Posted Saturday at 07:38 PM Posted Saturday at 07:38 PM Hi all, I'm completely new to coding and scripting in DCS and have spent several days trying to get a simple task to work using Lua. I want to move a ground group (TestGroup) to a trigger zone (TargetZone) when the mission starts. What I'm trying to do: Use Lua scripting to move TestGroup to the center of TargetZone at mission start. I’ve used MIST before and don’t mind using it, but I’d like to understand how to do it with or without it — mainly to learn scripting basics for future use. What I’ve tried so far: Using Group.getByName("TestGroup") and getController():setTask() → errors like: vbnet KopieraRedigera attempt to call field 'setTask' (a nil value) Using routeSet(), moveGroup(), and pushTask() — all resulted in errors or did nothing. Tried per-unit pushTask() as well, based on what ChatGPT generated — no luck. Tried scripting both inline (DO SCRIPT) and with external .lua files (simple_pathfinding_vXX.lua), loaded with dofile(). Also tried MIST’s mist.goRoute() after converting a route with mist.taskToRoute() — this version worked the best, but I’m still trying to understand why. My setup: DCS 2.9 stable Group name: TestGroup Trigger zone name: TargetZone MIST is loaded via a DO SCRIPT FILE at mission start What I need help with: A simple, working example of moving a ground group to a zone using Lua Ideally an explanation of why certain methods (like setTask, pushTask, etc.) fail or silently don’t work Bonus if you can show how to do it both with and without MIST Also: I’ve been working with ChatGPT to get started, and while it’s helped with structure and ideas, the actual DCS scripting details have been really difficult to get right. Any help is appreciated! I'm just trying to understand the basics here so I can build missions that use simple automation like this. Thanks in advance!
Recommended Posts