New question:
So I am trying to set up a string array and use it later, yet nothing seems to work.
%(namePtr) %(descPtr) are both 0. What could be wrong?
New question:
Is there a way to make AI heroes more aggressive, like they believe they are stronger and decide to defeat neutral stacks on the map more often?
I tried to place different hooks around AI values calculation, yet those hooks led to crashes.
First of all, warning. Address in SN:M memory is preserved only until game restart/array deallocation (SN:M#

or any operation, changing array size (push, pop, setCount).
You began with array of size 2 and two empty strings from start. Then you pushed another two strings and got addresses of the first two strings.
ntsfl_grailStr = ['', '', 'some name', 'some description'];
Just change !!SN:M(M_AUTO_ID)/2/(M_STR)/(M_STORED)/?i^ntsfl_grailStr^; to
!!FU(NewStrArr):P?i^ntsfl_grailStr^/(M_STORED); create new string array of size 0
And don't change array size anymore. Tell me if you need a function like AllocBattleStr:P^some text^/?(valid address until battle end)
Ah yea that's a simple mistake. Thanks a lot! It's sorted out.
Yet another new question:
Is OnBattlefieldVisible a good timing for playing spell animation?
Here's a debug sent from a player
As we can see, the game crashed exactly when spell animation was played.
This is reported from time to time. I could not reproduce a single crash with that script but I think it would be good to resolve it once and for all.
My questions:
- Is there any alternative timing for spell animation before tactics phases/after entering the battlefield?
- Is playing spell animation after OnBattleRound safer and leads to fewer issues?
Edit: It looks like OnBattlefieldVisible is indeed not safe. Even BM:M at this timing could fail. I plan to abandon this trigger from all scripts.
It seems not stable. Probably, on BeforeBattleAction on Round 0 is better.
Do you mean
is better than
Btw both are after Tactics, which isn't the best solution because you usually want to know most info before setting your troops' positions.
Здравствуйте..
А кто может подсказать, а почему нельзя никак удалить пустую лодку с карты приключений командой !!UN:O ?
В чём тут подвох?
(22.01.2024 18:29)fatsawhorse Wrote: [ -> ]А кто может подсказать, а почему нельзя никак удалить пустую лодку с карты приключений командой !!UN:O ?
В чём тут подвох?
Лодка, как и герой, - объект менеджера окна приключений, а не объект карты. Соотвественно, добавление и удаление - отдельные содовские функции, !!UN:O не увидит лодку, т.к. физически на карте её нет - она отрисовывается поверх карты.
Continue from the topic here
This is a script for adding "TEST" in the description of the first stack of the Defender's side (stack #21). I'd like to know if I am doing this correctly.
Questions:
1. Is there anything to be fixed/optimised?
2. Is both restorations of pointers OnGameLeave and OnAfterBattleUniversal necessary?
It seems, that there is no need to restore descriptions on game leave or even on after battle. Try without restoration code at all.
Berserker, thanks, thought that was necessary. Now it's much simpler.
I use prefix "edu" as "educational" replacement. Just call edu_AllocBattleStr function to get stable address for any text, which will work until battle end.
Berserker, it worked well, thanks. Maybe that should be placed in EEF?
Also any hint
about this?
Yep, you can add the code to EEF.