seeh Posted August 10, 2023 Report Share Posted August 10, 2023 (edited) I'm trying to find out if I'm a host. a function does not return an error. But sometimes returns true when false would have been expected. works no problem. thank you (23-0811_1534-51) /** * Determine if the current player is the host player. */ function isSelfHost(){ // maybe call it in a settimeout assync function const selfGUID = Engine.GetPlayerGUID() const firstPlayerGUID = Object.keys(g_PlayerAssignments)[0]; const selfPlayerAssignment = g_PlayerAssignments[Engine.GetPlayerGUID()]; const hostPlayerAssignment = g_PlayerAssignments[firstPlayerGUID]; g_selfInHost = selfGUID == firstPlayerGUID; const bugIt = true // new implementation so i will watch longer if(bugIt){ warn(`42: selfPlayerAssignment.name = ${selfPlayerAssignment.name}`); warn(`43: hostPlayerAssignment.name = ${hostPlayerAssignment.name}`); warn(`44: g_selfInHost => ${g_selfInHost}`); } warn(`45: g_selfInHost => ${g_selfInHost}`); return g_selfInHost } Edited August 11, 2023 by seeh Quote Link to comment Share on other sites More sharing options...
seeh Posted August 14, 2023 Author Report Share Posted August 14, 2023 g_IsController Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.