Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
7 years ago
Auto-translated
Is it possible to track the effects on units within a combat script? For example, the Berserk effect.
In reply to AstralLein
User Avatar
7 years ago
Auto-translated
AstralLein
Is it possible to track effects on units within a combat script? For example, Berserk.
There is no function that would provide a list of effects currently applied to units. It might be possible to track some effects based on indirect indicators, but this would likely only be possible during the unit's turn, and it's not certain that such guesswork would be accurate.
User Avatar
7 years ago
Auto-translated
Thank you. And can the spell cast by a hero be checked during the turn?
In reply to AstralLein
User Avatar
7 years ago
Auto-translated
AstralLein
You're welcome.

And can you check the spell cast by a hero during the turn?
Only indirectly.
User Avatar
7 years ago
Auto-translated
So, it won't be possible to create a counterattack by applying a general speed boost to offset the player's general slowdown... okay.

Then, here's another question: on the Echo of the Void map, Ishkibal casts various spells on all enemy stacks in the final battle... I'd like to make it so that the AI hero similarly casts Overseer on all of its units. How do I do that?

Added 42 minutes later
Damn, I implemented it, but I completely forgot that it's not possible to cast it on all of them due to the mechanics of Overseer itself... But still, thanks for the help, RedHeavenHero).
7 years ago
Auto-translated
Guys, help me out! Can you write a combat script: a neutral army has archers, clerics, swordsmen, and militia. After the militia die, bone warriors appear in their place; after the archers die, bone archers appear; after the clerics die, liches appear; and after the swordsmen die, zombies appear. Please help.
In reply to Kartoha
User Avatar
7 years ago
Auto-translated
Through the DefenderCreatureDeath(creature) function:
if GetCreatureType(creature) == Unit ID then
SummonCreature(....)
end
User Avatar
7 years ago
Auto-translated
I have a very complex task. I need to implement a system where, if a player completes a quest in one mission, a specific script is triggered or a bonus is awarded in another mission.
In reply to DarkLordax
7 years ago
Auto-translated
DarkLordax
I have a very complex task. I need to implement a system where, if a player completes a quest in one mission, a script is triggered or a bonus is given in another mission.

After completing the quest, use SetGameVar("name", "value") (a number, I think). In the next mission: if GetGameVar("that name") == value then...
In reply to AlekseyS
User Avatar
7 years ago
Auto-translated
AlekseyS
We write this after completing the task: SetGameVar("name","value") (a number, I think), and for the next mission: if GetGameVar("that name") == value then...
Thank you)
I didn't think this function was capable of so much!
User Avatar
7 years ago
Auto-translated
Dear friends, is it possible to solve a couple of my problems?
1) I need three specific heroes to simply stand in place and pass their turn – like in "Will of Ashtar" - "Beasts and Bones" - the orcish hero stands in the swamps until Arantir comes there himself.
2) Is it possible to make it so that when a player's hero enters a certain zone, other heroes located there stop their activities of gathering resources and running around houses, and run to attack the intruder?
User Avatar
7 years ago
Auto-translated
Here's what's wrong here! function pobor1() if GetObjectiveState("SQ1", 1) == OBJECTIVE_UNKNOWN then SetObjectiveState("SQ1", OBJECTIVE_ACTIVE, 1); MessageBox("Maps/SingleMissions/C1W1/poborQ1.txt", "nothing"); if IsObjectExists("pobornik1") == false then if IsObjectExists("pobornik2") == false then if IsObjectExists("pobornik3") == false then SetObjectiveState("SQ1", OBJECTIVE_COMPLETED, 1); SetObjectEnabled("dwellquest1", true); SetObjectOwner("dwellquest1", 1); Trigger(OBJECT_TOUCH_TRIGGER, "dwellquest1", nil) end; end; end; elseif GetObjectiveState("SQ1", 1) == OBJECTIVE_ACTIVE then if IsObjectExists("pobornik1") == false then if IsObjectExists("pobornik2") == false then if IsObjectExists("pobornik3") == false then MesageBox("Maps/SingleMissions/C1W1/poborEND.txt", "nothing"); SetObjectEnabled("dwellquest1", true); SetObjectOwner("dwellquest", 1); SetObjectiveState("SQ1", OBJECTIVE_COMPLETED, 1); Trigger(OBJECT_TOUCH_TRIGGER, "dwellquest1", nil) end; end; end; end end Trigger(OBJECT_TOUCH_TRIGGER, "dwellquest1", "pobor1") The almighty console writes: ERROR attempt to call a nil value. But where is this nil value? In short, everything works only if all three enemies (pobornik) are killed before taking the quest; then, it will be completed. If you take the quest first, then some nil value error appears!
User Avatar
7 years ago
Auto-translated
I will add to this list with other silly, but challenging questions for me. Thank you for your understanding, and I hope it won't be too much trouble for you to provide an answer.
In reply to inQizitOr
User Avatar
7 years ago
Auto-translated
inQizitOr
I'll add to this list with other silly, but complex questions for me. Thank you for your understanding, I hope it won't be difficult for you to provide an answer.
Should I provide the script itself or explain the actions of the script (more literally)?
In reply to DarkLordax
User Avatar
7 years ago
Auto-translated
DarkLordax
Would you prefer I provide the script itself or explain what the script does (more literally)?
Whatever is more convenient for you.

Statistics

Welcome our newest member: recijeb