Good afternoon. Could you please advise me on how to implement army upkeep costs? I'm not sure how to do it. Could you please tell me, for example, how to make it so that each day the number of peasants in the hero's army is checked, and then one coin is deducted for each peasant. Thank you in advance.
function NewDay()
local peas=GetHeroCreatures(hero name, CREATURE_PEASANT)
local cons=GetHeroCreatures(hero name, CREATURE_CONSCRIPT)
local landl=GetHeroCreatures(hero name, CREATURE_LANDLORD)
sleep(1)
if GetPlayerResource(1,6)>(peas+cons+landl) then
SetPlayerResource(1, GOLD, GetPlayerResource-(peas+cons+landl))
else
Your code for the case when the player doesn't have enough money to pay for the peasants.
end;
end;
Trigger(NEW_DAY_TRIGGER, "NewDay")However, the coin deducted for each peasant will only negate the Tax Collector ability. Also, at the end of the turn, the player can unload peasants into a sawmill or somewhere else and not pay. The system for paying for troops is very well implemented in Mercenaries; I recommend looking at the script for that map.
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________