Current time: 23.03.2024, 15:25 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
Школа ERM 2
» ERM 2.0 для ERA III
Author Message
Berserker Offline
Administrators

Posts: 16449
Post: #226

y(ptr:y) does not allocate anything new. It's the same as yy51, for instance.


Here we use y51 as storage variable and y2 as reusable pointer.

There is possibility to introduce bugs when dealing with y(ptr:y) syntax, because no checks are performed when you increase/decrease/assign pointer value.

Example:



Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
09.03.2022 21:22
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1098
Post: #227

Berserker, I get the idea. I thought the process of converting (var:y) to classic y is kinda random, like (var:y) can be randomly chosen from y1 to y99. But now it looks like we will have y99 only when there are 98 other y variables in the same function. Brillant! Thanks for helping Berserker and wessonsm!


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 10.03.2022 17:10 by Archer30.)
10.03.2022 09:18
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16449
Post: #228

It should be treated as random, but arrays are guaranteed to occupy continuous block of vars.

(arr[10]:y) can be y50..y59 or y65..y74, but not (y50, y52, y97, y3...) and so on.
Thus for arrays pointers and pointer arithmetics works if written carefully.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
10.03.2022 17:06
Find all posts by this user Quote this message in a reply
slater777 Offline

Posts: 136
Post: #229

Вопрос по поводу синтаксиса с переменной, которую необходимо указать 2 раза (диапазон значений одной переменной). Вот такие конструкции не работают:


или


Как можно решить эту проблему? Или придется дублировать код?
(This post was last modified: 16.12.2022 01:19 by slater777.)
16.12.2022 01:16
Find all posts by this user Quote this message in a reply
SergOz Offline

Posts: 1285
Post: #230

slater777, синтаксис работает. Только, если уж вопрос в теме ERM2, то как-то так:


То же самое и с синтаксисом и

P.S. Возможно, не срабатывает то, что ты даёшь/отнимаешь?


Карта-мод "Война на Холсте"
(This post was last modified: 16.12.2022 03:58 by SergOz.)
16.12.2022 03:46
Find all posts by this user Quote this message in a reply
slater777 Offline

Posts: 136
Post: #231

SergOz, да, ошибка была в скрипте. Отдебажил, всё заработало. Просьба эти посты перенести в "Ваши вопросы по ERM-скриптам". Спасибо за помощь!
16.12.2022 05:21
Find all posts by this user Quote this message in a reply
slater777 Offline

Posts: 136
Post: #232

Вопросы по поводу триггеров.

Есть ли в ERM2 аналог FU31200..31399 - Триггер_После_получения_уровня_героем (-1..198) ?
И есть ли триггер (даже в обычном ERM его не увидел, но всё же) при получении вторичного навыка?
18.12.2022 23:45
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16449
Post: #233

Если это не стандартные события, то нет.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
19.12.2022 03:31
Find all posts by this user Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Forum Jump:

Powered by MyBB Copyright © 2002-2024 MyBB Group