Skip to content

Current questions and answers regarding the map editor.

User Avatar
#5405
Auto-translated
Azgalor does not support this feature in quest descriptions, and besides, you invented the syntax yourself. For it to work (where it can work), it must be written exactly as in the example – in curly braces, separated by semicolons, in the form of an assignment of a name from the text file and a value. But if there are only a few quest progress stages, you can create a separate description for each: "1 out of 3 demons collected," "2 out of 3 demons collected," and so on. This is described in the FAQ in my signature.
Azgalor
Someone should teach me how to properly place the `end` statements.
Just indent all internal code blocks relative to the outer block, for example:
function red3()
  print("Checking how many troops Vlad has collected");
  if red_troops_count ~= 3 then
    red_troops_count = red_troops_count + 1;
    print("Vlad has collected ", red_troops_count, " demons out of 3");
    sleep(1);
    SetObjectiveProgress( "test_obj", red_troops_count );
  else
    if red_troops_count == 3 then
      SetObjectiveProgress( "test_obj", red_troops_count );
      print("Vlad has collected all the demons. Arrivederci, Signor Giocatore!");
    end;
  end;
end;
And there will be no problems with `end` statements; everything will be visually clear.
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо