Skip to content

Scripts for beginners.

User Avatar
#369
Auto-translated
AngryTapok1337

Hello. Can anyone help me with a script? I don't understand how the StartCombat command works at all. For example, I want a message to appear when entering a region, and then a battle to begin. I came up with the following script:

 

function Region1F()
   
    sleep(5);
    MessageBox ("/Maps/SingleMissions/MapochkaTEST3/battletext.txt");
    sleep(5);
    StartCombat ( "RedHeavenHero04", "Ottar", 4, 166, 100, 166, 100, 167, 75, 169, 50, 170, 15);
    Trigger(REGION_ENTER_AND_STOP_TRIGGER,"Region1",nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"Region1","Region1F");

 

But it doesn't work - the message appears, but the battle doesn't start.

 

And my second question is - how can I make creatures play animations on the map? For example, I want two stacks of creatures on the map to play attack animations against each other. Please tell me how I can implement this.

 

Thank you in advance.

Try using this instead of your StartCombat:
StartCombat ( "RedHeavenHero04", "Ottar", 5, 166, 100, 166, 100, 167, 75, 169, 50, 170, 15);
If it doesn't work, it means that either the hero Ottar is not on the map at all, or he is not in the enemy player's reserve. If Ottar is on the global map as just a hero, the battle will not start - you need to put him in the enemy player's reserve.

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

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

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