Posts from Current questions and answers regarding the map editor.
1) The obelisk should never function in its standard way, so it needs to be disabled at the start of the map.
2) When the obelisk is touched, a battle should start, so a trigger for touching it at the start of the map needs to be assigned to it.
and so on.
Then, simply find the appropriate functions for each step.
A simple answer: turn on the light.
I want to make it so that at a certain point, the AI gets the Tear of Ashera (building or artifact – it doesn't matter).
I tried adding it via a script:
GiveArtefact("Eruina", 53);
The Grail doesn't appear in the AI's inventory, and moreover, it doesn't appear even if I directly check the box for the Tear of Ashera for the hero when creating the map. At the same time, it works for the player's hero.
The standard method of finding it through obelisks is not suitable in this case.
Added 1 minute ago
Please provide the complete function; there might be an error somewhere.
Added 3 minutes ago
Why this trigger specifically? Or was it intended that entering a certain region would grant a Pelt?
Added 1 minute ago
Please provide the complete function; there might be an error somewhere.
The script only doesn't work with the Pelt and only with the AI. With other artifacts, and if the hero is controlled by the player, everything works fine.
function AshaTest()
GiveArtefact("Pelt", 53);
GiveArtefact("Pelt", 47);
MessageBox(GetMapDataPath().."AshaText.txt");
end;
function AshaTest2()
GiveArtefact("Eruina", 53);
GiveArtefact("Eruina", 48);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "GiveArtTestReg", "AshaTest");
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "test1", "AshaTest2");
Added 1 minute ago
Maybe I'm missing something, but why do you need 2 triggers? Perhaps that's why the error is occurring.
Added 47 seconds ago
I understand now.
Added 2 minutes ago
I only have 2 options: make the enemy hero go to a specific point and dig up the tear, or simply place the tear in front of the hero. I'm not sure about the latter, as the tear is an invisible artifact. It might not work.
Added 1 minute ago
Or, you could give the Tear to a hero, and they would stand there with it from the beginning, and then you could make them go to the Castle.
Added 19 hours 7 minutes ago
I need help with a rather complex script:
function halk()
QuestionBox("Maps\SingleMissions\Revenge of the\tsrhsad.txt", "Transform")
end
function Transform()
local gold, wood, ore, mercury, crystal, sulfur, gem = GetPlayerResource(1, GOLD, WOOD, ORE, MERCURY, CRYSTAL, SULFUR, GEM)
if gold >= 15000 then
if wood >= 5 then
if ore >= 5 then
if mercury >= 5 then
if crystal >= 5 then
if sulfur >= 25 then
if gem >= 5 then
SetPlayerResource(1, GOLD, gold - 15000, WOOD, wood - 5, ORE, ore - 5, MERCURY, mercury - 5, CRYSTAL, crystal - 5, SULFUR, sulfur - 25, GEM, gem - 5)
RazeTown("tone1")
else
MessageBox("Maps\SingleMissions\Revenge of the\xfh.txt")
end
end
end
end
end
end
end
Trigger(OBJECT_TOUCH_TRIGGER, "tone1", "halk")
This is the main part of the script. The question is, where do I set IsRemovable? Do I need to click on the town and then in the left part of the screen, or somewhere else? As I understand it, this is what controls whether the town is removed. So, the next question is: how do I place a ruined Human town in the same spot? I think there are people who know. Thanks in advance!
in an if statement, if it gives me an error because of the 3 values.
local x, y, f = GetObjectPosition(objectname);
if ((x == REQUIRED_X) and (y == REQUIRED_Y) and (f == REQUIRED_FLOOR)) then
YOUR CODE
end