Skip to content

Current questions and answers regarding the map editor.

User Avatar
#4007
Auto-translated
RedHeavenHero, the script didn't work =( Now it doesn't crash, but it also doesn't work. I was getting the city name with the script
@print(GetObjectNamesByType('TOWN'))
The name turned out to be AdvMapTown-12119 (the city of Angelat, the one in the upper right corner of the map). Here's the code:
function AddArchangelsSpecialization()
if GetObjectDwellingCreatures('AdvMapTown-12119', CREATURE_ANGEL) ~= -1 then
local add = 1
if grail_built == 1 then
add = add + 3
end
SetObjectDwellingCreatures('AdvMapTown-12119', CREATURE_ANGEL, GetObjectDwellingCreatures('AdvMapTown-12119', CREATURE_ANGEL) + add)
end
end

function NewDay();
-- ... --
if GetDate(DAY_OF_WEEK) == 1 then
AddArchangelsSpecialization()
end
-- ... --
end

Trigger(NEW_DAY_TRIGGER, 'NewDay')

grail_built = 0

function WaitForBuildGrail()
while GetTownBuildingLevel('AdvMapTown-12119', ID_14) == 0 do
sleep(10)
end
grail_built = 1
end

startThread(WaitForBuildGrail)
Could you please take a look and see what I did wrong? I think I did everything as you suggested... Please correct it if I made a mistake. :) I have a deadline for the map, and I really wanted to create mods for it... +++ upd I figured it out, the mistake was in the name))) I put Dunhart - everything started working, thank you)) Now the question is - why does the increase work ONLY if creatures were not bought in the garrison? Is it possible to make it so that it increases regardless of whether they were bought or not? (that is, if they were not bought, then +3,+6,+9 etc., as it should be... and so that it is exactly the same if they are bought). Or did I misunderstand the logic?
++
And one more question... where can I find descriptions of artifact sets? (and how to create my own set?) I found descriptions of set bonuses in the Artifacts.xdb file, but there is no mention of where the sets themselves are stored. I decided to create my own set (for example, Angel Wings + Ring of Swiftness +20% initiative + Horseshoe + Crown of Leadership + Armor of the Forgotten Hero), but I ran into a problem - how will the game understand the new set, and most importantly - how to name it in the Artifacts.xdb file? There is no mention anywhere of where the functions responsible for sets are stored. The description in the artifact is okay... For now, I see one option - to collect the Artifact.xdb file and record the set there... upd. I found it) the descriptions of their sets are in DefaultStats.xdb))) you can edit them)
I sketched out a set, but there is a problem - I couldn't make the set description appear + the 7th level creatures are not added (yes, I decided to clone the dragon set, but with different artifacts).
Attachments 2
2 files attached • Total size: 616.3 KB