The first step is to define the scale that you want to learn in terms on intervals without a guitar. In other words, a major scale's intervals are whole, whole, half, whole, whole, whole, half.
Start with a note and plug it into this "formula" to get the resulting 7 notes of the scale. To play this on a guitar on one string, start anywhere you'd like. Play the first note, and then jump a whole step (2 frets) to get the 2nd note of the scale.
Now, go another whole step to get the third, move a half step (1 fret) to get the 4th note, and so on. The 8th note, will start you over and will be an octave higher than the 1st.
If you took the time to do this for a single key on every string, then you will see that the resulting notes make up the "box" shapes you are trying to get away from. This is where the box shapes came from in the first place by the way.
Chords are a combination of certain intervals, which you will also see emerge from the method I just described. With chords though, you need to know which degrees of a scale to combine in order to create a chord.