1. VR:C does not allocate any memory. It's just a faster way to initialize array of y or v-vars.
SN:M is allocated dynamically (on demand) and freed afterwards. In Lua all arrays are allocated dynamically.
SN:M is slower, but it's real array with API and possibility to pass it to other functions.
2. It shuffles all array items so that each item has new random position.
like 1 2 3 4 may become 4 1 3 2 or 3 4 1 2 or even stay the same 1 2 3 4.
3. VR:C works with up to 16 arguments.
SN:M, em, allows to handle arrays of arbitrary size. SN:V can take up to 16 arguments and allows to start reading/writing from any index.
wessonsm, my test might not be legit, sorry for the trouble, it looks just fine now.
Berserker, thanks! So basically all the array commands like Array_Push cannot be used on VR:C. VR:C is only prefered when we need a static array, right
Archer30, I think, VR:C is not directly related to arrays. It's just the same as repeating !!VR:S multiple times.
If it's enough to use an array of y-variables like !#VA(var[10]:y), then you should.
In more complex cases, you may need to use SN:M.
The code of all functions like FU(Array_Push) can be found in 9999 era - stdlib.erm
wessonsm, yup, I use quite a lot of array functions from Era Erm Framework in my scripts
And I found the reason I had issue with the position check function. It looks like in seige battles, Wallls haven't been placed at BF.
Script for testing:
To avoid placing a stack with BU:S at BF on the positions of walls, my suggestion is to make an array for the positions of walls. What do you think about it?
SN:M or SN:V (vector) for UN:C like access to multiple array items.
Здравствуйте
wessonsm и
Bes
wessonsm, очень Вам благодарен за этот чудесный рабочий код, спасибо от всего сердца
Bes спасибо Вам также за неплохой пример использования..
Плохо мне так всё даётся
P.S.
Quote:я по прежнему не понимаю смысла подобного скрипта
- пытаюсь создать боевые статы у героя при нажатии на значок опыта кнопкой мыши, силовой удар, критический удар, магический удар, броня, уклонение, блокировка, скорость и т. д. с просчётом всех данных кол-во атак героя + эксперт нападения + данные от существ, от артефактов, вторнавыков, от заклинаний и т. д. (наворот можно сказать почти бесполезный, когда и так все данные на ладони). Ну как-то так..
1. Как правильно это записать !!co&y9<>66:; или всё-таки так !!co&y9<>66; без двух точек.. У меня такой выход с функций не срабатывал и я оставил такой старинный !!FU:E; ?
2. Существует ли простенький вариант заблокировать действие духа уныния и часов недоброго часа в бою, чтобы во время битвы не удалять их у героя и не давать после окончания битвы снова?
fatsawhorse, co is for "the next item in the loop". It is only used in "re en" and has different meaning with FU:E. For example,
Any :; can be replaced with ; now.
fatsawhorse, везде можно ":;" заменять на ";".
Quote:!!IF:M^The end of the %i loop^; [You won't see "The end of the 2 loop" as it's been co and skipped]
- It turns out that only the first and third cycles will work here, and the second will fly by!
Archer30 thanks for the reply. I will know now.
Berserker спасибо Вам также за разъяснение.
Archer30, I haven't tested the script yet, but it looks like the function names don't match here:
!!FU(hench_IfHexIsFree) and !?FU(wss_IfHexIsFree)
fatsawhorse, в последних версиях Эры везде можно заменять ":;" на ";", но я не был уверен в этом для Эра 3.0.5, поэтому на всякий случай использовал старый синтаксис.
Quote:fatsawhorse, в последних версиях Эры везде можно заменять ":;" на ";", но я не был уверен в этом для Эра 3.0.5, поэтому на всякий случай использовал старый синтаксис.
- а, вот оно что! Теперь мне ясно.. У меня же 3.0.5 эра и здесь
; выход не действует.. Надо скорее всего прописывать именно так
:;, хотя я привык ставить именно так !!FU:E;
wessonsm благодарю за поправку..
wessonsm, hi, sorry for messing up the names, I have the same function with different names. The conclusion is still valid though
Archer30, looks like BU:O doesn't work properly in !?FU(OnSetupBattlefield);
Other than walls, common obstacles like rocks are also not detected.
The same is SoD function 0x004695F0 (SN:E4625904).
I would suggest using !?FU(OnBattlefieldVisible) or later triggers.
I also suggest making one change to the !?FU(wss_IfHexIsFree);
string
change to
This is due to the fact that ordinary (non-magical) obstacles can have one "magic" cell, which is available and does not affect the course of the battle, but is treated by BU:O as a magical obstacle (obstacle flag 1).
wessonsm, I agree that !?FU(OnBattlefieldVisible) is a better timing for placing a stack as soon as entering the battlefield. Thanks for the suggested edits!
Is there a way to add/remove a lock from an artifact slot of a hero?