  In this paper, we broaden the understanding of the recently introduced
concepts of solid-locating-dominating and self-locating-dominating codes in
various graphs. In particular, we present the optimal, i.e., smallest possible,
codes in the infinite triangular and king grids. Furthermore, we give optimal
locating-dominating, self-locating-dominating and solid-locating-dominating
codes in the direct product $K_n\times K_m$ of complete graphs. We also present
optimal solid-locating-dominating codes for the Hamming graphs $K_q\square
K_q\square K_q$ with $q\geq2$.
