Posts from Scripts for beginners.
Auto-translated
HeroOfDestiny, what is the console complaining about?
Auto-translated
Function MakeHeroes not defined, line 13. That's how it is; I don't know what this means.
Auto-translated
Function MakeHeroes not defined, line 13
That's what happened, I don't know what it is.
Auto-translated
SetPlayerStartResources(1, 0, 0, 0, 0, 0, 0, 0);
function Bitwa()
StartCombat("Ottar", nil, 2, 29, 1000, 29, 1005, nil, nil, nil);
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "bitva", nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "bitva", "Bitwa");
function MakeHeroes()
DeployReserveHero("Itil", 127, 74, 0);
ChangeHeroStat("Itil", 0, 90000);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "geroy", "MakeHeroes")
As I understand, you are referring to this.
These are all the scripts that exist.
function Bitwa()
StartCombat("Ottar", nil, 2, 29, 1000, 29, 1005, nil, nil, nil);
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "bitva", nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "bitva", "Bitwa");
function MakeHeroes()
DeployReserveHero("Itil", 127, 74, 0);
ChangeHeroStat("Itil", 0, 90000);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "geroy", "MakeHeroes")
As I understand, you are referring to this.
These are all the scripts that exist.
Auto-translated
SetPlayerStartResources(1, 0, 0, 0, 0, 0, 0, 0);
function Bitwa()
StartCombat("Ottar", nil, 2, 29, 1000, 29, 1005, nil, nil, nil);
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "bitva", nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "bitva", "Bitwa");
function MakeHeroes()
DeployReserveHero("Itil", 127, 74, 0);
ChangeHeroStat("Itil", 0, 90000);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "geroy", "MakeHeroes")
As I understand it, you're talking about this.
These are all the scripts that are available.
Auto-translated
Hello! I have a question. How can I make it so that when all the creatures of the final boss in the castle are killed, angels appear on his side?
I know that this is done through combat scripts, but I don't know exactly how it's done and how to link them specifically to this hero.
Added after 10 minutes
function DefenderCreatureDeath(unit_name)
Added after 10 minutes
function DefenderCreatureDeath(unit_name)
if GetDefenderCreatures()[0]==nil and stage==1 then
SummonCreature(DEFENDER, CREATURE_ANGELS, 250, 12, 2);
Auto-translated
That’s strange; it works for me. Please send a screenshot of the error from the console.
Here's some kind of error.
I had to cut out some things to add it because the file size was too large
Auto-translated
BlueHeavenHero, try this:
Added 1 minute ago
HeroOfDestiny, did you add Ilfin to the reserve for the desired player?
spawn_angels = 0
function DefenderCreatureDeath()
local boss_creatures = GetDefenderCreatures();
if (length(boss_creatures) == 0) and stage == 1 then
if spawn_angels == 0 then
spawn_angels = 1
SummonCreature(DEFENDER, CREATURE_ANGEL, 250, 12, 2);
end
end
end
Added 1 minute ago
HeroOfDestiny, did you add Ilfin to the reserve for the desired player?
Auto-translated
Ah, I definitely didn't do that.
But how? Can you give me a hint?
Auto-translated
Aha, I definitely didn't do that.
But how? Can you give me a hint?
Auto-translated
In Map Properties, go to the Players Properties section, select the player you need, and add a hero to the Reserve Heroes List using the Add button. Your scripted hero is Ilfina.
Is it okay if I come here often? I'm a newbie when it comes to scripting in the editor, and I'll need help.
Auto-translated
Thank you! Everything works for me now! You are the best!
Is it okay if I come here often? I'm a newbie when it comes to scripting in the editor, and I'll need help.
Auto-translated
BlueHeavenHero, try this:spawn_angels = 0 function DefenderCreatureDeath() local boss_creatures = GetDefenderCreatures(); if (length(boss_creatures) == 0) and stage == 1 then if spawn_angels == 0 then spawn_angels = 1 SummonCreature(DEFENDER, CREATURE_ANGEL, 250, 12, 2); end end end
Added 1 minute ago
HeroOfDestiny, did you add Ilfin to the reserve for the desired player?
Added 2 hours 37 minutes ago
By the way... How do I attach a combat script to a town?
And another question - how do I make the knight-defender of the castle cast a prayer at the beginning?
Added 2 hours 14 minutes ago
Good day. How do I make a certain function run after a video plays?
Auto-translated
By the way... How do you attach a combat script to a town?
And another question - how do you make it so that at the beginning, the knight-defender of the castle casts a prayer?
How do you make it so that after the video plays, some function is executed?
2. I don't know if it will work with prayer, but try UnitCastGlobalSpell(GetDefenderHero(), SPELL_PRAYER). Don't forget to give the hero the Prayer skill.
3. StartDialogScene("link to the video", "function")
Auto-translated
I have a question! How can I make a hero stay in a castle?
Statistics
Welcome our newest member:
Emil