I know it's late, but I'll jump in...
I think two things are getting slightly conflated here.
Knowledge
Creativity
In my opinion, knowledge of theory is very valuable for starting at a place where you can "color inside the lines." You at least know that the notes you play will fit. It's like a painter choosing a color pallette before beginning a painting. Knowledge also includes knowing what all the notes on the neck sound like-- being able to hear a melody and visualize it on the neck without actually having a bass in your hands. This comes only from lots of practicing, even if it's simply sitting on the couch with a bass and trying to copy the melody of every TV commercial jingle that comes on. You also want to copy whatever ideas your favorite bassists come up with. Do it by ear, no matter how long that takes. It gets easier the more you do it. You specifically asked about bass parts which complement guitar parts. Listen to your favorite bands and study how the various bassists approach this issue. You really have to be patient and use your ears. If it takes six hours to figure out four measures, so be it.
Now, creativity...
With knowledge of the fingerboard, a developed ear and a "database" of bass parts in your head, you'll be surprised how easily new ideas will come to you. Turn off the analytical part of your brain, and let them rise to the surface, which will happen even while you're going for a walk, driving, etc. At this point, you can either "color within the lines" (above) or not! It's up to you. You will find your own voice, which will be a new composite of your favorite bassists' voices.
I really hope this helps. Good luck and have fun!