Skip to content

Current questions and answers regarding the map editor.

#4730
Auto-translated
I wrote a script, a thread that checks if certain key guardians have been visited, and displays a message depending on the conditions. It works as I need it to, but for some reason, it completely floods the console with warnings. Help me figure out what's wrong. Scripts: ``` function StartKeyMasterObserv() Trigger(NEW_DAY_TRIGGER, "StartKeyMasterObserv", nil); print("Start keymaster observe thread"); startThread(CheckKeyMasterFoundThread); end; function CheckKeyMasterFoundThread() GreenKeymasterMessageNotShow = true; RedKeymasterMessageNotShow = true; TanKeymasterMessageNotShow = true; repeat if HasBorderguardKey(PLAYER_1, GREEN_KEY) and GreenKeymasterMessageNotShow then GreenKeymasterMessageNotShow = false; MessageBox(GetMapDataPath().."KeymasterMessage/Green.txt"); end; if HasBorderguardKey(PLAYER_1, RED_KEY) and RedKeymasterMessageNotShow then RedKeymasterMessageNotShow = false; MessageBox(GetMapDataPath().."KeymasterMessage/Red.txt"); end; if HasBorderguardKey(PLAYER_1, TAN_KEY) and TanKeymasterMessageNotShow then TanKeymasterMessageNotShow = false; MessageBox(GetMapDataPath().."KeymasterMessage/Tan.txt"); end; sleep(5); until(HasAllKeymasterFound()) end; function HasAllKeymasterFound() if HasBorderguardKey(PLAYER_1, GREEN_KEY) and HasBorderguardKey(PLAYER_1, RED_KEY) and HasBorderguardKey(PLAYER_1, TAN_KEY) then MessageBox(GetMapDataPath().."KeymasterMessage/All.txt"); print("Keymaster thread finish"); return true; end; return false; end; ``` Warnings: