Форум HeroesWorld-а - Показать сообщение отдельно - Текущие вопросы и ответы по редактору карт
Показать сообщение отдельно
#4643
Старый 25.04.2018, 08:35
  #4643
^
am-wrag
📖
Регистрация: 22.03.2018
Сообщения: 11
Регистрация: 22.03.2018
Сообщения: 11
По умолчанию
Re: Текущие вопросы и ответы по редактору карт

Написал скрипт, тред который проверяет посещены ли определенные хранители ключей и в зависимости от условий выдаёт сообщение. Он работает так как мне надо, но почему-то полностью засирает консоль варнингами. Помогите разобраться, что не так.
Скрипты:
	
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;
Варнинги:
am-wrag вне форума
Ответить с цитированием