This is my forte I guess, bass lines in general.
Can`t really give much better advice than learn music.
There is no set way of doing things.
Learn music, and look at the scales used by "funky" music, preferably not techno.
In fact, just listen to some james brown and some old dub and jazz, and rip off some of their basslines, it`s a good place to start.

Also learning bass guitar works wonders.