I need to implement a couple of functions: 1) a text message should pop up only when a specific hero approaches a certain location, and 2) after capturing a town, a quest should be activated: "prevent the town from being captured" (by other players).
Please refer to the guide by Ogo-i and the FAQ by JackofShadows; they contain similar examples.
Code 1:
function Message(hero)
if hero==Hero Name then
MessageBox("/Path/File.txt")
end;
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "Region Name", "Message")Code 2: function DefendtownObjectiveActivate()
SetObjectiveState("Quest Name", OBJECTIVE_ACTIVE, PLAYER_1)
end;
Trigger(OBJECT_CAPTURE_TRIGGER, "Castle Name", "DefendtownObjectiveActivate");Don't forget that the quest in MapPropertiesTree should have IsInitialyActive=false in its properties.
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________