Skip to content

Posts from Current questions and answers regarding the map editor. Auto-translated

5.0 (12 ratings)
In reply to Alinksolo
User Avatar
#5508
Auto-translated
Alinksolo
Why does the hero disappear from the map and the quest is marked as completed after using the SetObjectEventState command, which is supposed to trigger the quest to kill a hero?
Show the function that handles the conditions of this quest.
#5509
Auto-translated
Hello everyone, could you tell me if it’s possible to add more than a thousand warriors to each cell in the garrison in the map editor? I wanted to add 3000 warriors, but it only shows 999.
In reply to Alinksolo
User Avatar
#5511
Auto-translated
Alinksolo
Here is
Attachment 66218
I advise you to write the task condition manually. The task type is OBJECTIVE_KIND_MANUAL.
function Brem_Defeat(hero)
if hero=="Brem" then
SetObjectiveState("task name", OBJECTIVE_COMPLETED)
Trigger(PLAYER_REMOVE_HERO_TRIGGER, player number, nil)
print("123")
end
end

Trigger(PLAYER_REMOVE_HERO_TRIGGER, player number, "Brem_Defeat")

Again, there may be errors here
In reply to prostoi988
User Avatar
#5512
Auto-translated
prostoi988
Hello everyone, can you tell me if it's possible to add more than a thousand warriors to each cell in the garrison within the map editor? I wanted to add 3000 warriors, but it only shows 999.
You can do this either through the scripting command AddObjectCreatures, or by clicking on the garrison, finding the ArmySlots parameter in the left window of the editor, right-clicking on it, then clicking Add in the pop-up window, then clicking on the plus sign that appears next to it. In the list, select the parameter and in the Creature field, enter CREATURE_STOUT_DEFENDER (this is the ID for the warriors), and in the Count field, enter the desired number.
Сценарий: "Наследие прошлого"
Кампании:
"
Новый порядок", "Серый Альянс""Поиски Истины"

Трейлер №2 кампании "Дыхание Пустоты": https://www.youtube.com/watch?v=XkHKXk5BctA&ab_channel=%D0%90ndrei_21

In reply to Andrei_21
#5514
Auto-translated
Andrei_21
You can do this either through the script command AddObjectCreatures, or by clicking on the garrison, finding the ArmySlots parameter in the left window of the editor, right-clicking on it, in the pop-up window, clicking Add, then clicking on the plus sign that appears next to it, selecting the parameter from the list, and in the Creature field, specify CREATURE_STOUT_DEFENDER (this is the ID for the Warriors), and in the Count field, specify the desired number.
Thank you.
In reply to Азгалор
User Avatar
#5516
Auto-translated
Azgalor
I understand... So, show me the function that starts this quest.
function CreatureShouldSurvive(hero, id)
  while 1 do
  sleep(10);
    if GetHeroCreatures(hero, id)==0 then
      SetObjectiveState("zadanie4", OBJECTIVE_FAILED)
      sleep(10);
      Loose();
      break
    end;
  end;
end;

function StartScene()
StartDialogScene('/MyScene/StartScene/DialogScene1/DialogScene.xdb#xpointer(/DialogScene)')
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg12", nil);
for i=1,4 do
  SetObjectiveState("zadanie"..i, OBJECTIVE_ACTIVE) 
end
startThread(CreatureShouldSurvive, 'Mardigo', CREATURE_CLERIC)
AddHeroCreatures("Mardigo", 1, 40);
AddHeroCreatures("Mardigo", 5, 10);
AddHeroCreatures("Mardigo", 10, 1);
for i=500,508 do 
  RemoveObject(i)
end
end

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg12", "StartScene");
Here.
In reply to Alinksolo
User Avatar
#5517
Auto-translated
Alinksolo
function CreatureShouldSurvive(hero, id)
  while 1 do
  sleep(10);
    if GetHeroCreatures(hero, id)==0 then
      SetObjectiveState("zadanie4", OBJECTIVE_FAILED)
      sleep(10);
      Loose();
      break
    end;
  end;
end;

function StartScene()
StartDialogScene('/MyScene/StartScene/DialogScene1/DialogScene.xdb#xpointer(/DialogScene)')
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg12", nil);
for i=1,4 do
  SetObjectiveState("zadanie"..i, OBJECTIVE_ACTIVE) 
end
startThread(CreatureShouldSurvive, 'Mardigo', CREATURE_CLERIC)
AddHeroCreatures("Mardigo", 1, 40);
AddHeroCreatures("Mardigo", 5, 10);
AddHeroCreatures("Mardigo", 10, 1);
for i=500,508 do 
  RemoveObject(i)
end
end

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg12", "StartScene");
Here
The error seems to be in the startThread function. It should only require the function name.
User Avatar
#5518
Auto-translated
Grigory Kovalev, startThread accepts any number of parameters.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#5519
Auto-translated
The line that adds the inquisitor should be placed above `startThread`; Azgalor mentioned this to you.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5520
Auto-translated
}{0TT@6bI4
Grigory Kovalev, startThread accepts any number of parameters.
Thank you for the clarification.
User Avatar
#5521
Auto-translated
Alinksolo, it’s likely that one of your four quests has the setting InstantVictory = true, but lacks properly refined conditions, similar to how, in the case of the quest to kill the hero Brem, Brem would be absent or not appear before the quest is issued (this quest is configured correctly; I’m just providing an example of a possible flaw in the quest conditions). As a result, after the task is issued, the scenario ends with the player’s victory. The removal of heroes occurs due to the player’s victory. Please check if all your quests have InstantVictory = false?
In reply to Азгалор
User Avatar
#5522
Auto-translated
Azgalor
Alinksolo, it’s likely that one of your 4 quests has the InstantVictory = true setting, and at the same time, it doesn’t have refined conditions, as if, in the case of the quest to kill the hero Brem, Brem was missing or didn’t appear before the quest was issued (this quest is configured correctly for you; I’m just giving an example of a possible flaw in the quest conditions). Thus, after the assignment is issued, the scenario ends with the player’s victory. The removal of heroes occurs due to the player’s victory. Check if all your quests have InstantVictory = false?
Yes, they do; I just checked.