Upon the action being dismissed, or the defendant dismissing the same for want of prosecution, the defendant shall recover against the plaintiff full costs; and in all other civil cases, not otherwise directed by law, it shall be in the discretion of the court to award costs or not; and the payment of costs, when awarded, may be collected in the same manner as judgments for the payment of money are enforced.
735 ILCS 5/5-118