Skip to content
User Avatar
#3837
Auto-translated
Azgalor

Because, according to the condition (else), if the object (city?) "castle" does not belong to player 2, then the video is played.

If you need it to play after capturing the city, you need to add a script for capturing the city with the activation of a function through OBJECT_CAPTURE_TRIGGER, where we check that the city has been captured and who the new owner is, and then we will play the video if the city was taken by the player who owns the hero you need. Something like this:
function TownCaptured( oldowner, newowner )
if IsHeroAlive("Hafad") then
if IsHeroAlive("Christian") then
if ( newowner == GetObjectOwner("Christian") ) then
StartDialogScene("/DialogScenes/FallenKnight/S3/DialogScene.xdb#xpointer(/DialogScene)")
sleep(1)
SetObjectiveState("prim5", OBJECTIVE_COMPLETED, 1)
SetObjectiveState("prim6", OBJECTIVE_ACTIVE, 1)
elseif newowner == PLAYER_2 then
SetObjectiveState("prim5", OBJECTIVE_FAILED, 1)
sleep(10)
loose()
end
end
end
end

Trigger( OBJECT_CAPTURE_TRIGGER, "castle", "TownCaptured" );

Thus, after MoveHero from the function with the hero's respawn, the conditions and actions can be removed)

You didn't quite understand me. After a human player captures the city, a quest to hold the city is activated. Vittorio is placed on the map and begins to move towards our city. If we defeat Vittorio, a video is played. If Vittorio captures the city, we lose.
By the way, a similar problem arose with another function - a cutscene is played, then a battle begins, and AFTER the battle, a text message appears. But - the cutscene is played, and the text message appears BEFORE the battle. How can this be fixed?

Мои карты:
Падший рыцарь
Сердце Хаоса

Мои моды:
Визуальные:
Изменение внешнего вида героев-некромантов
Существа-жители и кое-что по мелочи в городах Ордена Порядка, Некрополиса и Инферно

NCF-существа:
Странствующие рыцари
Наемники