It is possible to create traits and triggers. I'm not 100% sure of how to activate a trait-trigger in a certain settlement though (I've thought about it, but never tried it).

There are people who can describe how to create traits and triggers better then me, so I won't even try it as my descriptions would only confuse you.
I can say this though: It's possible, and quite easy. And remember to backup your files before changing anything.