Is there a way to let AI learn that my Diamond Dragon's breath attack's secondary target won't deal damage to friendly troops (but the main target still will, if it's hypnotized)?
I can write something like this:
This works almost perfect but I want to avoid setting the damage to 0 for the main target. It seems there is no classic erm way to know whether a target is the secondary target of breath attack or main in OnStackToStackDamage.
Edit:
I made it with some enlightenment from daemon_n. A hook at 441487 makes the whole thing very straightforward.
Как получить тип загружаемого ресурса из дерева всех ресурсов по имени?
Проблема в том, что для Pcx и Pcx16 результаты не те, что ожидалось, ведь их типы 2/16 и 0/18 соответственно, если верить IDA
Что не так с кодом, с игрой, с чем-либо ещё?
(23.12.2023 08:16)daemon_n Wrote: [ -> ]Проблема в том, что для Pcx и Pcx16 результаты не те, что ожидалось, ведь их типы 2/16 и 0/18 соответственно, если верить IDA
Что не так с кодом, с игрой, с чем-либо ещё?
1. HD-мод умеет подменять любой pcx на bmp, поэтому при вмешательстве в код Бараторч наверняка добавил собственные типы, чтобы самостоятельно выгружать HD-модовский ресурс (и чтобы сам движок игры его даже не пытался выгружать).
2. era.dll умеет подменять любой pcx на png, поэтому при вмешательстве в код Берсеркер наверняка добавил собственные типы, чтобы самостоятельно выгружать эровский ресурс (и чтобы сам движок игры его даже не пытался выгружать).
Поэтому лучше проверять на pcx, которые на 100% никто не подменяет (а в сборке Лаучера вполне возможно, что скоро будут подменены все pcx в игре).
Quote:2. era.dll умеет подменять любой pcx на png
Я гружу классическую pcx8/pcx16 заглушку из чёрных пикселей. Вся реальная работа через перехват функций отрисовки.
XEPOMAHT, результат не зависит от HD mod, потому подозреваю, что проблема в моём коде
In Campaigns:
Is there a way to get the list of creatures that will be carried over to the next zone?
Is there a way to load a save game with a hotkey, for example, loading Battle!.GM1 with F10?
Guess it should be calling this function:
004BEFF0
But I tried a few times and failed

Да, простого пути вообще нет. Я сам когда-то пытался сделать такое, но потом забил, ибо очень извороченная это задача. Очень!
Is there a way to change the name/creature description of a stack on the battlefield?
igrik, thanks a lot!
Well, looks like I need a hook (or MM0?) here because the description I want to show is dynamic. For example,
Quote:Level %y1
where y1 equals the level of the War Machine/Henchman.
New question:
Is there to get the pointer of a string in json, for example:
Code:
{
"ntsfl": {
"set": {
"altTerrains": "1" // alternative terrains for Castle/Tower
},
"str": {
"grailName": "Eye of Sauron",
}
}
}
What would the pointer to "%T(ntsfl.str.grailName)" be?
No, there is not safe way to get a pointer to such string. Strings are allocated on heap (in dynamical memory) and may be deallocated/relocatted any time.
You can create string array before battle and release it after battle. There is a way to get string address on SN:M array element.
Berserker, very useful, thanks