Skip to content

Posts from The script is not working. Auto-translated

No ratings yet — be the first to rate!
#1
Auto-translated
In a custom map, a script is written to prevent the enemy hero from passing through a specific area. However, the script is not working. Could you please advise on what the problem might be? I apologize in advance for not finding the tag for the script. function pregrada () SetRegionBlocked("xxx", on, PLAYER_2); end; Trigger(REGION_ENTER_AND_STOP_TRIGGER, "xxx", "pregrada" );
User Avatar
#2
Auto-translated
1. You are blocking the region based on a trigger that activates when entering the region, meaning that at the moment of blocking, the hero will already be inside the region and will be able to pass through it. You need to write the blocking condition outside the region, without any conditions.
2. The second parameter of the function is a boolean; you need to pass nil or not nil. The keyword "on" does not exist.
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо
In reply to Jack_of_shadows
#3
Auto-translated
Jack_of_shadows
1. You are blocking the region using a trigger that activates when entering the region, meaning that at the moment of blocking, the hero will already be inside the region and will be able to pass through it. You need to write the blocking condition outside, without any conditions.
2. The second parameter of the function is boolean; you need to pass nil or not nil. The keyword "on" does not exist.

Thank you very much, it helped.
There was simply not enough information in the documentation attached to the game files.