Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
5 years ago
Auto-translated
RemoveHeroCreatures("Hero Name", i)
User Avatar
5 years ago
Auto-translated
Is it possible to move a hero's castle from one location to another, or to create it when entering a certain region, just like CreateDwelling creates a building?
User Avatar
5 years ago
Auto-translated
Probably, it is possible. SetObjectPosition
User Avatar
5 years ago
Auto-translated
How can I remove a building? For example, there's a Necropolis on the map that gives the player zombies, and I need to remove it. Usually, to remove an object from the map, like trees, creatures, or anything else, I use RemoveObject, but this script doesn't work on the Necropolis and gives an error.
User Avatar
5 years ago
Auto-translated
Strange.
User Avatar
5 years ago
Auto-translated
I carefully reviewed the properties of the Necropolis, but I couldn't find the IsRemovable property.
User Avatar
5 years ago
Auto-translated
Then you can use SetObjectPos to place it in a secluded corner of the map.
User Avatar
5 years ago
Auto-translated
Good day.
I couldn't find an example script anywhere, so I'm posting my problem here:
I need to spawn a hero from the reserve onto the map, but not at a specific point, but inside a town's garrison.
Do you have any ideas on how to do this, and is it even possible?
In reply to Лоли Никита
User Avatar
5 years ago
Auto-translated
Loli Nikita
How can I remove a building? For example, there's a Necropolis on the map that gives the player zombies, and I need to remove it. Usually, to remove an object from the map, like trees, creatures, or anything else, I use RemoveObject, but this script doesn't work on the Necropolis and gives an error.
You need to use RazeBuilding in this case.
User Avatar
5 years ago
Auto-translated
I think I wrote everything correctly, but it gives an error: "Not enough arguments when calling function GetHeroCreatures" function portals()    SetObjectPosition ('Duncan',121,123,-1,4);    AddHeroCreatures("Duncan", 1, 3)  for i=1, 179 do  if GetHeroCreatures(i)>=1 then  RemoveHeroCreatures('Duncan',i);  end;  end;    end;    Trigger( OBJECT_TOUCH_TRIGGER, 'PORT_1','portals');
User Avatar
5 years ago
Auto-translated
GetHeroCreatures("Hero Name", i)
User Avatar
5 years ago
Auto-translated
function portals()
   SetObjectPosition ('Duncan',121,123,-1,4);
   AddHeroCreatures("Duncan", 1, 3)
  for i=1, 179 do
  if GetHeroCreatures('Duncan',i)>=1 then
  RemoveHeroCreatures('Duncan',i);
  end;
  end;
   end;
   Trigger( OBJECT_TOUCH_TRIGGER, 'PORT_1','portals');

The same error occurs - "Not enough arguments when calling function GetHeroCreatures".
User Avatar
5 years ago
Auto-translated
The GetHeroCreatures function requires only two parameters: the hero's name and the creature ID.
User Avatar
5 years ago
Auto-translated
Could you provide a script that would rebuild the Capitol in a Castle if it was destroyed and the Castle was captured by another player?
User Avatar
5 years ago
Auto-translated

Hello everyone!

Please tell me how to make it so that in the battle function (when a player enters a specific area and fights creatures), it's the player's heroes (Red, Blue, Purple), and not just one specific hero, who engage in battle when entering that zone.

Statistics

Welcome our newest member: recijeb