I've been searching for a way to auto spawn marines(A custom unit in the future) from a barracks(Owned by a computer) and then set them on a predetermined route to defend certain areas of a defense map but no matter what I try I can't seem to get it to work I've tried using behaviors I've also gotten it to partially work with triggers but It wasn't very good. I was hoping someone could tell me how to do what I have outlined above but dumb it down a bit since I am pretty new to this.
You could certainly use triggers. There are a lot of tutorial videos out there.
So you could just have a train unit ability on the barracks with auto cast enabled. You're probably going to have to use triggers to have the units patrol a specific area. I don't know how else you'd do that part with the data editor. Unfortunately I know almost nothing about triggers.