I didn't have a purpose in life for a long long time. Hell, can't say I really have it sorted out now, because I'm constantly swinging between being suicidal and putting an effort into living.
I've moved to another country two years ago, and since then all I did was socializing, trying different stuff out. Being depressed and anhedonic most of the time really affected my perception of things - what purpose can you possibly have if absolutely nothing can give you gratification, joy or happiness?
I started my journey trying to understand what I really enjoy in life, what seems cool, interesting or captivating at times when life isn't agonizing. Anything is fine there: whether you enjoy watching movies, using drugs, playing videogames or climbing mountains - anything can be used as a spark. It can be hard to notice at times, at least for me, but once you realize what's makes it click for you this realization sticks with you.
It's important to understand that there are no limits - absolutely anything you enjoy can be percieved as something that gives your life meaning. My family never understood my passion for videogames, so I was raised in the environment where everyone close to me would tell me that I'm wasting my time doing things I like, that there are thing much more important than what I do. As it turns out - time you enjoy wasting isn't wasted time.
Now I'm trying to get my shit together and finish my videogame project, as well as act upon some related ideas.
I guess it is also important to let yourself dream big, even if the dream of yours feels out of reach at times. It can be a bit silly, but I believe in videogames so much that I'd like to become something of a videogame messiah one day. Even though it sounds kind of dumb and maybe lame to other people, it's me who gives this idea a meaning.
So my words of advice would be: dream more, find what you enjoy in this shitty life and stick to it, and work towards it when you're feeling capable. Don't let other people discourage you, or make you do something you don't feel like doing - life is meaningless without your own, silly twist on it.
Stay strong.