Skip to content

Current questions and answers regarding the map editor.

User Avatar
#2728
Auto-translated
That is, it is written in the creature's script?... Yes, I'm an idiot.
function InitBuildings() for i, building in GetObjectNamesByType"PEASANT_HUT" do Trigger(5, building, "TransformBuilding") end for i, building in GetObjectNamesByType"ARCHERS_HOUSE" do Trigger(5, building, "TransformBuilding") end for i, building in GetObjectNamesByType"BARRACKS" do Trigger(5, building, "TransformBuilding") end for i, building in GetObjectNamesByType"HEAVEN_MILITARY_POST" do Trigger(5, building, "TransformBuilding") end end function TransformBuilding(_, _, hero, building) if hero == "Pelt" then ReplaceDwelling(building, TOWN_NECROMANCY) end end function TransformHavenTown(_, _, hero) if hero == "Pelt" then TransformTown("Sian", TOWN_NECROMANCY) sleep(10) SetObjectPosition("Pelt", GetObjectPosition("Sian")) end end startThread(InitBuildings) Trigger(5, "Sian", "TransformHavenTown") function InitDungeonCreatures() for i, mob in GetObjectNamesByType"CREATURE" do local type = GetObjectArmySlotCreature(mob, 0) if (type >= CREATURE_SCOUT and type <= CREATURE_BLACK_DRAGON) or (type >= CREATURE_STALKER and type <= CREATURE_RED_DRAGON) then SetObjectEnabled(mob, nil) Trigger(4, mob, "TouchDundeonCreature") end end end function TouchDundeonCreature(hero, monster) if hero == "Dalom" then SetMonsterCourageAndMood(monster, 1, 0, 0) end SetObjectEnabled(monster, 1) Trigger(4, monster, nil) sleep(1) MakeHeroInteractWithObject(hero, monster) end startThread(InitDungeonCreatures)
And regarding the region... he just selected a region for me, and that's it. I can't access its properties, and the tree doesn't react to it...
Правило во взгляде...