The impact of metallicity and X-rays on star formation