Skip to content

Posts from Scripts Auto-translated

4.8 (8 ratings)
User Avatar
#1459
Auto-translated
Okay, I didn't know where to post this, so I'll post it here: Is it possible to make a hero gain levels after level 40? I know it's probably a silly idea, and I'll have to manually adjust the amount of experience gained, but still.

Whatever
In reply to Олегарх
User Avatar
#1460
Auto-translated
Oligarch
I was thinking... I'll place the objects and then just move them around. It will be easier, IMHO.
In Resources\pointLights\, you just need to set the light points, like in the object properties, and give them a name, and then call the function SetObjectFlashlight("object name", "light point name")
to disable it, the second parameter should be ""

Added 4 minutes later
Heroist
Okay, I didn't know where to write this, so I'll write it here: Is it possible to make a hero gain levels after level 40? I know it's probably nonsense, and I'll have to manually work with the amount of experience gained, but still.
For now, there is no way to influence this.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#1461
Auto-translated
Not good, I'd say. It seems like the amount of experience needed has increased; it was 1..., and now it's 2... (million/billion, I'm not sure). In that case, we'll just have to reduce the amount of experience on the map. Thanks.

Whatever
In reply to RedHeavenHero
User Avatar
#1462
Auto-translated
Thank you, I will keep that in mind.
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля
User Avatar
#1463
Auto-translated
Is it possible to use the same name for an object ('druid1') and a variable (druid1 = 0) in a script? I did this with a druid, and now the console says "object 'druid1' does not exist or is not interactive." Is this the problem, or should I check the script?

Whatever
In reply to Heroist
User Avatar
#1464
Auto-translated
Is it possible to determine if a tile is occupied?
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля
In reply to Heroist
User Avatar
#1465
Auto-translated
Heroist
Is it possible to use the same name for an object ('druid1') and a variable (druid1 = 0) in a script? I did this with a druid, and now the console says "object 'druid1' does not exist or is not interactive." Is this the problem, or should I check the script?
Yes, you can. :) The error is most likely in the SetObjectEnabled function or a Trigger.

Added 1 minute ago
Oligarch
Is it possible to determine if a tile is occupied?
IsTilePassable(x, y, floor) returns:
1 - if not occupied
nil - if occupied

It considers water impassable by default.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#1466
Auto-translated
Hmm, thank you.

Added 37 minutes ago
here are a couple more questions:

1) Where is the error? The script doesn't work at all, it doesn't even try.


---transformation (trans)---

trans = 0

function trans()
while 1 do
sleep(1)
if GetObjectOwner ('elftown') == 1 and trans == 0 then
sleep(1)
ShowFlyingSign(GetMapDataPath().."trans1.txt", "Berein", -1, 7);
sleep(5)
TransformTown ('elftown' , 4)
ReplaceDwelling ('elfdwel1' , 4)
ReplaceDwelling ('elfdwel2' , 4)
ReplaceDwelling ('elfdwel3' , 4)
ReplaceDwelling ('elfdwel4' , 4)
trans = 1
end
end
end
startThread (trans)


(Everything is named correctly, as in the editor)

2) Can I immediately destroy the tavern in the town right after the transformation? (I remember asking a similar question, but I didn't quite manage it, or I was just lazy)

Whatever
In reply to Heroist
User Avatar
#1467
Auto-translated
Heroist
Hmm, thank you.

Added 37 minutes ago
here are a couple more questions:

1) Where is the error? The script doesn't work at all, it doesn't even try.


---transformation (trans)---

trans = 0

function trans()
while 1 do
sleep(1)
if GetObjectOwner ('elftown') == 1 and trans == 0 then
sleep(1)
ShowFlyingSign(GetMapDataPath().."trans1.txt", "Berein", -1, 7);
sleep(5)
TransformTown ('elftown' , 4)
ReplaceDwelling ('elfdwel1' , 4)
ReplaceDwelling ('elfdwel2' , 4)
ReplaceDwelling ('elfdwel3' , 4)
ReplaceDwelling ('elfdwel4' , 4)
trans = 1
end
end
end
startThread (trans)


(Everything is named correctly, as in the editor)

2) Can I immediately destroy the tavern in the town right after the transformation? (I remember asking a similar question, but it didn't quite work out, or I was just too lazy)


In the StartTread line, there is a syntax error. The function is written with a lowercase letter
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
User Avatar
#1468
Auto-translated
That's not the point. I have everything written like that.)))

I'll check it now, but I'm already used to writing it this way; it doesn't seem to depend on whether it's uppercase or lowercase...

Whatever
User Avatar
#1469
Auto-translated
I mean, the StartTread itself is written with a lowercase letter. I think it shouldn't be like that.
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
User Avatar
#1470
Auto-translated
Well, that’s what I’m saying, it’s always written that way for me, and it works. I don’t think the script checks for that.

Now I’ll try writing it with a capital letter, but this 93.734% won’t help, unfortunately.

Added 4 minutes later
No, I wrote it with a capital letter, and now the script is complaining about the function altogether.

Whatever
User Avatar
#1471
Auto-translated
I don't quite understand this function, unfortunately. As I understand it, the condition in the trans function's loop is false from the very beginning of the game (if elftown doesn't belong to player 1). Doesn't this cause StartThread to stop working?

Added 1 minute later
although, no, I probably said something nonsensical.
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
User Avatar
#1472
Auto-translated
startThread simply launches a function. It's like a trigger, but it doesn't depend on anything. Moreover, if you put a while loop, the function will be checked endlessly immediately after launch. I think the problem might be with sleep, as the script might simply not have enough time to execute))

Added 1 minute ago
Although, actually, no, that's not the problem. There are plenty of sleeps there... There's also a pop-up message...

Added 2 minutes ago
Damn, I changed the variable name, and it all started working. What a load of nonsense...

There's still a second question...

Added 22 minutes ago
I'm completely confused..

SetTownBuildingLimitLevel('elftown', TB_TAVERN, 0)
SetObjectDwellingCreatures('elftown' , 2, 100)

In the first case, it doesn't understand the building type, and I can't find another one. It also doesn't work with quotes.
In the second case, it doesn't want to add creatures for recruitment. Although all the creature dwellings are built.
It's terrible

Whatever
In reply to Heroist
User Avatar
#1473
Auto-translated
Heroist

In the first case, it doesn't recognize the building type, and I can't find another one. It also doesn't work with quotes.
Try one of these options:
TOWN_BUILDING_TAVERN = 4
Карты для Heroes of Might and Magic V
Цикл "Закадычные враги": "Особенное гостеприимство, "Супероружие", "Меж молотом и наковальней"
"Падение Шантири"

Кампания для "Кодекса Войны"
"Выбор Сагиттеля"