Posts from Scripts
SinglePlayer: Выбор Зехира
Падение Стедвика(pre-release)
Готовится: Зима Титанов, Столетняя война
SinglePlayer: Выбор Зехира
Падение Стедвика(pre-release)
Готовится: Зима Титанов, Столетняя война
SinglePlayer: Выбор Зехира
Падение Стедвика(pre-release)
Готовится: Зима Титанов, Столетняя война
Trigger(NEW_DAY_TRIGGER, "hello")
function hello()
if GetDate(DAY) == 2 and h==1 then
RemoveHeroCreatures(...);
elseif GetDate(DAY) == 3 and h==1 then
RemoveHeroCreatures(...);
and so on
end;
end;
but this way, you have to specify it for each day. Is there a way to reset the day count at a certain point so that you don't have to write so much?
I have a question. Let's say, according to the plot, the hero has to choose which path to take. If he goes down a certain road, his army will decrease each day. This can be done using New_day_trigger. Let's assume that in this case, the variable h is assigned the value 1. Then
Trigger(NEW_DAY_TRIGGER, "hello")
function hello()
if GetDate(DAY) == 2 and h==1 then
RemoveHeroCreatures(...);
elseif GetDate(DAY) == 3 and h==1 then
RemoveHeroCreatures(...);
and so on
end;
end;
but this way you have to write it for each day. Is there a way to reset the day count at a certain point so that you don't have to write so much?
well, if you have a variable h=1, then it will indeed remove a portion of the army every day. And there's no need for these complicated date calculations. If the feature becomes unnecessary, you can change the value of h to any number other than one.
If my line of thinking is correct, then:
h = 0
function RemoveCreaturesStart()
h = 1
startThread(RemoveCreatureProgress)
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,'RC1', nil)
end;
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,'RC1','RemoveCreaturesStart')
function RemoveCreatureProgress()
while 1 do
if h == 1 then
RemoveObjectCreatures('Oddrema', CREATURE_CERBERI,28)
end;
sleep(1)
end;
end;
function RemoveCreatureStop()
if h == 1 then
h=2
else
if (h == 2) or (h == 0) then
h = 1
end;
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,'RC2',nil)
end;
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,'RC2','RemoveCreatureStop')
Sincerely.
SinglePlayer: Выбор Зехира
Падение Стедвика(pre-release)
Готовится: Зима Титанов, Столетняя война
function regf()
h=1;
Trigger(trololo, nil);
end;
Trigger(trololo);
function hello()
if h==1 then
RemoveCreatures ("Oddrema", 20, 1);
end;
end;
Trigger (NEW_DAY_TRIGGER, "hello");
How to set up spawning only certain creatures at the beginning of the week? And, preferably, in a specific location?
CreateMonster
--Example
function NewDay()
if GetDate(DAY_OF_WEEK) == 1 then
CreateMonster('mob1', CREATURE_PEASANT, 50, 45, 51, GROUND);
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDay")
Function
CreateMonster
--Example
function NewDay()
if GetDate(DAY_OF_WEEK) == 1 then
CreateMonster('mob1', CREATURE_PEASANT, 50, 45, 51, GROUND);
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDay")
Thank you. But how do I disable spawning on a new week then? For example, Lich week has arrived, and no monsters are spawning?
Then you'll have to do it like this:
function NewDay()
if GetDate(DAY_OF_WEEK) == 1 and GetCurrentMoonWeek() < 84 then
CreateMonster('mob1', CREATURE_PEASANT, 50, 45, 51, GROUND);
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDay")Then, if a week of some creature happens, the monster won't be placed on the map.