Place: South Dakota, US
Googled: child custody (got way too many divorce hits), mental illness, parental rights; SD laws on parental rights, involuntary commitment, etc. (any suggestions for better search terms appreciated)
Question: My character is mentally ill, a widower, and has two tween-age children. He has a best friend (not a blood relative) who wants him committed because he is posing a danger to the children. Can that friend get custody of the children? If so, how? (Would he need the father's permission? Would he need to work with CPS, have a home study, and be approved as a foster parent?) (And my googling suggests that the character wouldn't be committed for longer than several months, and then be treated on an outpatient basis. Assuming this is correct, his friend would like to keep custody of the children, for their sake, until my character is well back on his feet and able to take care of them).
SD laws relating to mentally ill persons
SL laws re veterans' guardianships for mentally ill veterans
SD laws relating to guardianship of children