save healthstate for C++