Substantial damage” has been caused by a fire at a former Halifax school which has been used to film two TV shows.