Posts from Current questions and answers regarding the map editor.
Hello, when I was creating a map in the editor, I changed the textures and appearance of recruitable creatures in some buildings using the -Shared string. When I entered single-player mode, I noticed that the changed parameters apply to all maps and scenarios. Questions: Is this how it should be, or am I doing something wrong? And how can I make sure that such changes only apply to one specific map? (only with scripts?). Thank you in advance.
Alternatively, you can create copies of objects, give them unique names so they don't overwrite the game's resources, and then nothing will be affected.
Please advise what to do. I am new to mapmaking. I drew a new map. In one of the towns, when selecting a hero from the menu, it is not possible to choose a hero. In the HeroInTown section, I selected true. I am attaching a screenshot.
Link to the screenshot from the editor: https://yadi.sk/i/miq1TcGOLZHlIw (I couldn't embed the image in the message)
In the other towns, heroes are available.
Please advise what can be done!
Thank you in advance!
How to set a time limit for completing a quest.
quest_start_time = GetDate(ABSOLUTE_DAY);
Using a trigger for a new day, check if the time has expired:
Trigger(NEW_DAY_TRIGGER, 'NewDay');
function NewDay()
if ((check if the quest is active) and (GetDate(ABSOLUTE_DAY) >= (quest_start_time+1))) then
fail the quest
end
end
When you receive the quest, save the current day:
quest_start_time = GetDate(ABSOLUTE_DAY);
Using a trigger for a new day, check if the time has elapsed:
Trigger(NEW_DAY_TRIGGER, 'NewDay');
function NewDay()
if ((check if the quest is active) and (GetDate(ABSOLUTE_DAY) >= (quest_start_time+1))) then
fail the quest
end
end
Thank you.
Added 59 minutes later
How do you create a quest with sub-quests, i.e., so that one quest includes 3 others, for example? And so that it is considered completed when all 3 of these quests are completed.
UPD:
Perhaps my addition wasn't noticed, so I'll duplicate it:
How do you create a task with sub-tasks, i.e., so that one task includes 3 others, for example? And so that it is considered completed when all 3 of these tasks are completed.
The simplest way is to start a thread at the beginning of the main task that checks whether the 3 secondary tasks have been completed. For example, like this:
function CheckSecondaryQuestsCompleted()
while 1 do
if GetObjectiveState('quest_1') == OBJECTIVE_COMPLETED and
GetObjectiveState('quest_2') == OBJECTIVE_COMPLETED and
GetObjectiveState('quest_3') == OBJECTIVE_COMPLETED then
SetObjectiveState('main_quest', OBJECTIVE_COMPLETED)
break
end
sleep()
end
end