Wake of Gods Forum | Форум Во Имя Богов

Full Version: Школа ERM 2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Hi! I have a question about arrays in ERM 2.
Is it possible to make a variable in a variable with array?

Looks like %(firstLevelMon[%(value)]) is wrong 102
Archer30, nope, ERM is too low level. We have to define pointer to array item and access it indirectly.

In Lua it would be firstLevelMons[value], but in ERM 2:
Hmmm, in this particular case, the name variable is worse than v-variable. I can simplify the code by:

It's awful code. Do not use global variables for almost the same purpose but with invalid logics. You th code I gave above, press F11 and see, what it's compiled too.
Even better try this code for testing:

You'll see something like
Berserker, I understand you are not a fan of mixing variable type. I myself never want to mess up with that, but it's sometimes necessary to use v. Check this:


The command uses v index. What should I do to get rid of v-variable in this case? 102
Array access code via pointers does not need v-vars at all. The code above can be converted to safe:
Hmmm, maybe I was wrong about coding. I thought your code would require much more calculation (as you loop through all heroes) and may extend the time of passing the day a little bit.
Try it, it won't. 255 iterations, 2 commands and one condition evaluation. ERM speed is about 400 000 lightweight receivers/sec.
In response to igrik and Archer30 array indexing request, ERA Team presents v3.3.7:
Berserker, что за -1? прочитал в теме обновления.
Божечки, скоро ERM превратится в c++96-copy

P.S: вместо гномов кентаврыYes
daemon_n, 5-й параметр был введён сто лет назад. Конечное значение счётчика всегда ограниченно суммой пятого и третьего параметра.
Большинство цикло идут от 0 до КОЛВО_ЧЕГО-ТО - 1. Иногда нужно пропустить последний элемент вообще. Тогда будет -2.
(11.03.2021 18:03)Berserker Wrote: [ -> ]
119 Аллилуйя!
igrik, ты теперь часть ERA Team, как я понимаю, а потому все твои взывания к неким нужностям будут так или иначе воплощаться в ERA3 Spiteful Пора засчехлять мешок с отложенными хотелками Spiteful
Bes, не поверишь, но хотелок у меня больше нет.
Раньше были 3: расширенное UN:C, получение структуры героя и стека. Теперь они есть.

В ERM2 сложно работать с массивами в циклах. Решение тут крайне необходимо. Надеюсь оно в скором времени появится в реальности.
Итого - мой мешок с хотелками пуст ))

Вот WoG Scripts 2 допилю (через год, два) и вообще на пенсию уйду.
igrik Wrote:Надеюсь оно в скором времени появится в реальности.
Так уже же: https://mods.hmm35.ru/Era%20Update.exe
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Reference URL's