Skip to content

Posts from Scripts

4.8 (8 ratings)
Auto-translated
Ser9K, I think I understand what the problem is. The archive doesn't contain the text1 and text2 files. I add them, exit, and re-enter, but they're gone. What's the issue?
User Avatar
Auto-translated
Try creating text1 and text2 using the **CustomGoal** feature, which is located just above **Objectives**. Click on the empty field, then click "new" and enter the name of the text message, then the message itself. Click "OK", then "save". The line from **CustomGoal** then needs to be (!) deleted. In my opinion, this is the easiest way.
Клан "Вершители Асхана" - "Masters of Ashan"
Auto-translated
Ser9K, I did as you suggested, but it still doesn't work... Now it really can't create a file named text1, but for some reason, it's still not working...
In reply to Valeonos
User Avatar
Auto-translated
Valeonos
Ser9K, I did as you suggested, but it still doesn't work... Now, it really can't create a file named text1, but for some reason, it still doesn't work...
Try using the program http://hmm5.sklabs.ru/.
Auto-translated
I don't know what else to do. I've tried everything, with and without the program... Maybe someone can take a look and see what's wrong.
Attachments 1
1 file attached • Total size: 177.4 KB
User Avatar
Auto-translated
Damn... well, of course! :D
PlayerHero = the script name of the hero who should enter the region, written in "" (see the Settings -> Script Name tab)

function kamillaF(hero)
if hero == PlayerHero then
MessageBox ("/Maps/SingleMissions/Island_Triads/text1.txt");
Trigger (REGION_AND_STOP_TRIGGER, "kamilla", nil );
end;
end;

Trigger (REGION_AND_STOP_TRIGGER, "kamilla", "kamillaF" );
Клан "Вершители Асхана" - "Masters of Ashan"
Auto-translated
Glad you understood, although I still don't =)

Here's what I did, but it doesn't seem right. The hero's name is something like Nemor.

SetPlayerStartResources(PLAYER_1,0,0,0,0,0,0,0);

function kamillaF(Nemor)
if hero == Nemor then
MessageBox ("/Maps/SingleMissions/Island_Triads/text1.txt");
Trigger (REGION_AND_STOP_TRIGGER, "kamilla", nil );
function aF()
if hero == Nemor then
Trigger(REGION_AND_STOP_TRIGGER,"a1",nil);
MessageBox("/Maps/SingleMissions/Island_Triads/text2.txt");
end;
end;
end;
User Avatar
Auto-translated
Hero's name in quotes: "Nemor" ;)
User Avatar
Auto-translated
Not REGION_AND_STOP_TRIGGER, but REGION_ENTER_AND_STOP_TRIGGER. The ends, in my opinion, are not placed correctly.
 

К А
Стикеры GBF в Telegram
User Avatar
Auto-translated
also, the following lines are missing: Trigger (REGION_AND_STOP_TRIGGER, "kamilla", "kamillaF"); and Trigger(REGION_AND_STOP_TRIGGER,"a1","aF");
Auto-translated
it still doesn't work...

SetPlayerStartResources(PLAYER_1,0,0,0,0,0,0,0);

function kamillaF("Nemor")
if hero == "Nemor" then
Trigger (REGION_ENTER_AND_STOP_TRIGGER, "kamilla",nil);
MessageBox ("/Maps/SingleMissions/Island_Triads/text1.txt");
Trigger (REGION_ENTER_AND_STOP_TRIGGER, "kamilla","kamillaF");
function aF()
if hero == "Nemor" then
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"a1",nil);
MessageBox("/Maps/SingleMissions/Island_Triads/text2.txt");
Trigger (REGION_ENTER_AND_STOP_TRIGGER, "a1","aF");
end;
end;
end;
User Avatar
Auto-translated
Try this:
SetPlayerStartResources(PLAYER_1,0,0,0,0,0,0,0);

function kamillaF("Nemor")
if hero == "Nemor" then
Trigger (REGION_ENTER_AND_STOP_TRIGGER, "kamilla",nil);
MessageBox ("/Maps/SingleMissions/Island_Triads/text1.txt");
end;
end;
Trigger (REGION_ENTER_AND_STOP_TRIGGER, "kamilla","kamillaF");
function aF()
if hero == "Nemor" then
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"a1",nil);
MessageBox("/Maps/SingleMissions/Island_Triads/text2.txt");
Trigger (REGION_ENTER_AND_STOP_TRIGGER, "a1","aF");
end;
end;

Added 3 minutes ago
Oh, I made a mistake. The last two "end" statements are before the last trigger.
User Avatar
Auto-translated
Dude... what are you suggesting? 0_o I already said how it should be done... In your case, if the hero is indeed Nemor (colloquially, Deidra), the script will look like this: PlayerHero = "Nemor" function kamillaF(hero) if hero == PlayerHero then MessageBox ( "/Maps/SingleMissions/Island_Triads/text1.txt" ); Trigger( REGION_ENTER_AND_STOP_TRIGGER, "kamilla", nil ); end; end; Trigger( REGION_ENTER_AND_STOP_TRIGGER, "kamilla", "kamillaF" ); Let me explain. PlayerHero is a variable created for convenience... at least that's how it seems to me and Nival. You can also simply write: if hero == "Nemor" then Or you can write anything in Latin instead of PlayerHero.
Клан "Вершители Асхана" - "Masters of Ashan"
In reply to Ser9K
User Avatar
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"
User Avatar
Auto-translated
Yeah, thanks, just one more (two): after the cutscene, I need to teleport the "Enabled" hero to another position. And regarding the attractor: it should apply to disabled heroes. Will they move on the next turn, or do I need to enable them somehow?

Thank you very much!
Карты для Heroes of Might and Magic V
Цикл "Закадычные враги": "Особенное гостеприимство, "Супероружие", "Меж молотом и наковальней"
"Падение Шантири"

Кампания для "Кодекса Войны"
"Выбор Сагиттеля"

Statistics

Welcome our newest member: Emil