What should I even do about this problem? Will I have to create another region for the REGION_ENTER_AND_STOP_TRIGGER and somehow get the main character there?
There is such a thing as threads. This is, in essence, a function that is executed periodically.
However, if you don't put a delay (i.e., sleep) in it, the game will crash.
Example:
-- in general, you need to pass all parameters to this function and try to make everything as parameterized as possible,
-- but we're not launching into space, so let's stick to old-school methods
function checkState()
while(1) do
if(GetObjectiveProgress("Quest_Zubec",player) == 3) then
-- Do things
break -- if you don't put a break, it will be painful.
end
sleep(5) -- You can wait longer, it all depends on the needs
end
startThread("checkState")
This method is suitable for checking artifacts or something else non-trivial. In your case, a trigger should be enough (in theory):
Trigger(OBJECTIVE_STATE_CHANGE_TRIGGER ,"Quest_Zubec_Handler","Quest_Zubec")
function Quest_Zubec_Handler(player)
if(player == 1 and GetObjectiveProgress("Quest_Zubec",1) == 3) then
-- Do things
end
endIt is possible that the function called by the trigger is passed the name of the quest, and it doesn't need to be written again, but I have never tested this. Try it.
