Are our regular dreams scripted after we fall asleep or do they unfold randomly? I've been trying to figure this out after an odd LD experience I had awhile back.

I was dreaming that I was in the house I grew up in. I don't remember what exactly happened but something happened to cause me to go lucid. I was only at a low level of awareness and I remember I didn't want to be in my current setting. I was in my old bedroom and looked over to the window for a means of escape. The room was bright as if sunlight were filtering though the blinds, and I had the feeling that it was summertime. I ran over to the blinds and after a lot of effort of digging and clawing at them I was able to get past them to the window. I was still lucid, but without actual action I had managed to get past the window to stand on the roof of the back porch. I was now looking over the backyard in the middle of winter, snow piled on the ground. The stranger thing was that everything had gone from normal lighting and colors to completely black and white. I looked up at the sky to see a completely overcast day compared to the sunlight that had been coming through the blinds earlier. I also had the feeling that I shouldn't be there on that roof, that it was wrong. I contemplated jumping off the roof into the snow (something that I did often as a kid, it isn't a far drop), but as I approached the edge of the roof, the feeling of being out of place intensified and I woke up.

I've been really confused about this ever since. Sometimes I feel like I broke out of the confines of a dream and into an actual memory. It was almost reminiscent to the book “The Giver” by Lois Lowry where the protagonist was given memories that had been handed down for generations.
If anyone has any thoughts on this, please share.
Thank you,
Lemons