Jump to content
Gwynoak

Creating Unit Layout in Editor, Spawning with Trigger Script

Recommended Posts

Hello, I tried to search the forum for something like this but can't find anything that really answers my question, this may belong in the mission scripting section but I don't know what I don't know so sorry if it does.

I know how to spawn ai units using a trigger script, and even how to set their positions using waypoints and get/set POS, and how to change their alertness and guarding behavior.

But Id like to add enemy AI bases that will be subject to additional scripts later on. I want to be able to place my units where I want them through the Eden editor, but set them to only spawn if a trigger and condition is met. For example, lets say we have Airbase 1 and 2. Both have encounters designed within them, but the player must clear airbase 1 before units at airbase 2 can be triggered to spawn.

I'm not so worried about the condition variable, it should be simple enough to pass a Bool when airbase 1 is "captured" that airbase 2 reads, I can figure that out as I go. More importantly, I need the ability to place units in a 3 dimensional space and trigger them to spawn in those exact locations. As far as I know the marker system only works in 2D and while you can pass an elevation variable its not what I'd call accurate when dealing with buildings of different size. The ability to simply create an enemy base with AI in the editor, export it as a module or something and then give it a trigger to spawn would be best for server performance and future adaptation. 

My best guess:
Naming AI and groups, setting some kind of object in their place like an ammo magazine, then on trigger activation replacing the appropriate magazine with the appropriate unit class? But I feel like there is a better way to do this.

Very new to this, so I'm sorry if I'm missing something super basic and obvious, I've only been learning simple mission scripting up to this point and have a little bit C++, JS, python knowledge.
 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×