Skip to content

Current questions and answers regarding the map editor.

User Avatar
#2595
Auto-translated
No, of course not.
Trigger(REGION_ENTER_AND_STOP_TRIGGER , 'trigger name' , 'function name')

function function name ()
--This is where the check is triggered when any hero enters the region. Write whatever you want here. If you need to complete a quest:
SetObjectiveState ('objname' , OBJECTIVE_COMPLETED)
Trigger(REGION_ENTER_AND_STOP_TRIGGER , 'trigger name' , nil)
end

Now, this function will react to any contact with this region. The only thing is, the computer might also enter this region, and then the function will trigger for it. If you do it like this:
Trigger(REGION_ENTER_AND_STOP_TRIGGER , 'trigger name' , 'function name')

function function name ()
if GetCurrentPlayer() == 1 then
--This is where the check is triggered when any hero of the first player enters the region. Write whatever you want here. If you need to complete a quest:
SetObjectiveState ('objname' , OBJECTIVE_COMPLETED)
Trigger(REGION_ENTER_AND_STOP_TRIGGER , 'trigger name' , nil)
end
end

Then the function will work for any hero of the first player - by default, a human.

Whatever

Statistics

Welcome our newest member: artem

Users Online 2 users 1527 guests