My philosophy has always been that the bass is the glue that ties the drums to the rest of the band.
For any chord progression, listen to the drums, if you're like me, your brain will start assigning melodies to the drum parts that goes along with the chord progression. Incorporate any inspiration that comes to you along the way derived from melody parts (guitar, vocals, whatever), and you'll start creating your own groove oriented melodies and counter melodies that tie everything together.
I never think in terms of scales, but rather in terms of rhythm, melodies, and counter melodies. This approach might not work for everybody, but after years of introspection, I've found that this is the way that my brain approaches bass, and it seems to work for me!

Good luck!