There aren't that many things you need to know to make up bass lines with ease. Learn exactly what they are in this video lesson.
Chords From A Scale
One thing you have to know is how to harmonise a scale. Check these videos out:
Important Bass Guitar Scales
Note selection is all about knowing what scales to know in what positions. The most common scales are probably these ones:
Modes also show up a lot in famous bass lines.
Soul Bass Patterns
When you listen very closely to individual styles of music you start to see (and hear) the characteristics of that style. For example, soul/RnB/blues bass playing uses quite a specific set of notes and patterns. You can see them on this video and download the shapes here.
Know your fretboard and your scales well and work on your timing and groove. These areas will make it much easier for you to improvise bass lines. Above all, keep listening to different styles and work out as many bass lines by ear as you can.