Many shootings at military bases have involved troops bringing guns they purchased onto base grounds and opening fire on fellow service members.