The infamous stack overflow exception. There is even a famous programming
website named after that.
Let's start with stacks and overflows.
Stack is kind of a data structure to store data in programming. Think about a gun and its magazine. Magazine is the stack. When you putting bullets into magazine you're storing data into the stack and when you shoot the gun you retrieve data from the stack. Assume you don't shoot but keep putting bullets int the magazine. At some point it becomes full and you can't put bullets anymore. That's what we call an overflow in programming. You wanna store some data, but you don't have enough available space in the data structure.
You didn't specify mission template id or pasted some code, so i'm just gonna guess.
One of the most common causes of stack overflow is recursion. Recursion means a function calling itself. Scripts are the closest thing to functions in programming, so think about a script calling itself in its code. When you call scripts with parameters, those parameters are stored in the stack. After script ends, those parameters loses their uses and removed from the stack to create space in the stack. While using recursion, parameters are stored without releasing until recursion ends. With enough amount of recursion, the stack will be filled and you will have a stack overflow exception. You may have a script with causing infinite recursion. That's my first guess.
After you spawn an agent (calling spawn_agent operation) in a mission_template, triggers with ti_on_agent_spawn interval execute. If you call spawn_agent operation here in a wrong way something like this may happen.
- Agent is spawned.
- Spawned agent caused on_agent_spawn trigger to execute.
- Executed trigger spawned another agent.
- Spawned agent caused on_agent_spawn trigger to execute.
- Executed trigger spawned another agent.
- Spawned agent caused on_agent_spawn trigger to execute.
- Executed trigger spawned another agent.
.
.
.
This is some sort of indirect recursion of on_agent_spawn trigger. (It probably stores spawned agent data on stack.) If it's called enough, it'll fill stack and cause overflow. That's my second guess.
Other then these it might be game engine bug or mod is too resource intensive and there isn't enough memory available. (stack takes place in system memory) I hope it helps.