Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
13 years ago
Auto-translated
You don't even need an extra variable for the region; you can simply call the `SetRegionBlocked` function with the necessary arguments within the function that the trigger references.
User Avatar
13 years ago
Auto-translated
I have a question: is it possible to influence the attitude of a specific type of monster present on the map in any way? For example, let's say that at the moment this script is executed, there are 50 creatures of type 1 (peasants) on the map. And using the script, I set their attitude to "always join." It would be very important and convenient if this were possible...
In reply to Heroist
User Avatar
13 years ago
Auto-translated
for i, mob in GetObjectNamesByType("CREATURE_PEASANT") do
SetMonsterCourageAndMood(mob, PLAYER_1, MONSTER_COURAGE_ALWAYS_JOIN, MONSTER_MOOD_FRIENDLY)
end
However, this will not affect creatures that appeared on the map during gameplay.
User Avatar
13 years ago
Auto-translated
Can the name of the monster in quotes be replaced with its ID? If so, should the quotes be removed?
In reply to Heroist
User Avatar
13 years ago
Auto-translated
No. It requires a string containing the name.
User Avatar
13 years ago
Auto-translated
Thank you.
13 years ago
Auto-translated
Is it possible to set it up so that player_6 can survive without a town for more than 7 days? I don't want to exceed the town limit on the map.
In reply to advencher
User Avatar
13 years ago
Auto-translated
advencher
Is it possible to make it so that player_6 can survive without a town for more than 7 days? I don't want to exceed the town limit on the map.
Open the map properties tree -> objectives -> primary -> player_specific.
Select the tab under number five, and set die_in_week_without_towns to false.
User Avatar
13 years ago
Auto-translated
If a hero who was in reserve comes out of reserve, levels up to level 30, then dies, and then revives again, will he lose his level and artifacts?
In reply to Heroist
User Avatar
13 years ago
Auto-translated
The level will remain, but the artifacts will be lost.
User Avatar
13 years ago
Auto-translated
Oh, that’s interesting, thanks. I’ll need to rewrite the scripts…
User Avatar
13 years ago
Auto-translated
How can I make the computer target a player's hero? P.S. The manual says that the attractor only works on stationary objects.
In reply to Warrior777
User Avatar
13 years ago
Auto-translated
It says there that it "correctly" works on stationary targets, and it will also work on moving targets.

Added after 41 minutes
Another option: each turn, force the AI to move towards the player using MoveHero.
In reply to RedHeavenHero
User Avatar
13 years ago
Auto-translated
RedHeavenHero

[/U]Here's another option. Each turn, force the AI to move towards the player using MoveHero.
Then you'll have to determine the player's coordinates. How can this be done?
User Avatar
13 years ago
Auto-translated
local x, y = GetObjectPosition ('hero1name')

then

MoveHero ('hero2name', x, y)

hero1name --- the name of the hero to attack (determines its coordinates)
hero2name --- the name of the hero that will move to the specified coordinates each turn.

Statistics

Welcome our newest member: recijeb