Skip to content
User Avatar
#122
Auto-translated
I'm posting it here as requested :)
EnableAIHero( "RedHeavenHero04", false );
EnableAIHero( "RedHeavenHero06", false );
EnableAIHero( "RedHeavenHero03", false );
EnableAIHero( "Duncan", false );
EnableAIHero( "Freyda", false );

There's an error here: EnableAIHero. It should be EnableHeroAI
function death2 ()
PlayObjectAnimation ("golem", "death", ONESHOT_STILL);
end;
startThread(death2);

function death3 ()
PlayObjectAnimation ("gremlin", "death", ONESHOT_STILL);
end;
startThread(death3);

The golem doesn't have a death animation in its model (I don't know about the gremlin). And this function takes the animation from there. I don't know why it's done this way, but many creatures lack a death animation. You'll have to change the creatures to others.
And the main map script - the hero (Zehyr) enters an area, a cutscene plays, the hero who was in that area is moved to another point (as if teleported), the player (Zehyr) gains control of the cities and troops of another player, and in the subsequent turn of the opponent, the enemy heroes attack the cities (the human will be slightly stronger).

Let's break it down into a couple of points.

First, about entering the region, playing cutscenes, moving the hero, and giving him the city. A simple standard trigger is used:

Change PlayerHero to the new one.
START_DIALOG, the variable contains the address of your cutscene, it looks something like this:

START_DIALOG = "/DialogScenes/UC2/M5/S1/DialogScene.xdb#xpointer(/DialogScene)"
function noname(hero)
if hero == PlayerHero then
StartDialogScene( START_DIALOG );
SetObjectPosition( PlayerHero, 34, 6, 1 );
SetObjectOwner("TownSilvan", PLAYER_1);
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "regionname", nil );
end;
end;
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "regionname","noname", nil );

SetObjectPosition

The parameters are as follows: ( heroname, x, y, z )

z - the level (underground or above ground). I don't remember exactly, but I think 1 is underground. Either 0 or 2 is above ground. You can also set it to nil, then it will stay at the same level.

SetObjectOwner

It's simpler here. ( script name of the city (you define it yourself), player )

Secondly, about capturing cities. There are some... uh... well, there are some difficulties.

There is a function like this:

SetAIHeroAttractor("DangeonTown", "Oddrema", 2);

You specify the city, the hero, and the priority. 2 is the highest (meaning it will capture it regardless of the risk of dying).

It looks good, but it doesn't always work as it should.
Клан "Вершители Асхана" - "Masters of Ashan"