(30.06.2014 00:45)Algor Wrote: [ -> ] (29.06.2014 22:42)feanor Wrote: [ -> ]потому что лучше использовать не арифметические, а битовые операции.
&-3 для отключения полета
&-9 для сквозного удара
&-16385 для отключения иммуна к огню
а чтобы не путаться "с единичкой" (я постоянно забываю) рекомендую делать так:
|2-2 для отключения полета
|8-8 для сквозного удара
|16384-16384 для отключения иммуна к огню
а чтобы код был ещё компактнее , я всегда делал так (будучи уверенным, что те флаги у существа точно есть)
X2 для отключения полета
X8 для сквозного удара
X16384 для отключения иммуна к огню

Как в общем случае (а к частностям привыкать не стоит) можно быть уверенным что те флаги у существа точно есть?
(30.06.2014 00:45)Algor Wrote: [ -> ]Valery, you get approximately 31 artifact of each type? Or not? Which result means "too many of same artifact", when you select of 5 artifacts?
Well, I wanted every hero to get randomly one of the cornucopia components. So if value was 112, then set to 113 to avoid cart of ore (ID=112).
Then in game I checked and naturally I have more rings of sulphur because of two values possible (112-113), but on 155 heroes I found only 12 crystal cloaks. So 109 went 12 out of 155.
Wondering if there is a better randomizer or I just did not have luck that time. I now fixed the sulphur ring problem by returning with SN:G if ID=112, which should work better.
(30.06.2014 02:34)Valery Wrote: [ -> ]I now fixed the sulphur ring problem by returning with SN:G if ID=112, which should work better.
That's a terrible solution. Why not just generate values from 109 to 112 and replace 112 with 113 like you did earlier?
Good idea, I am getting old. Thanks.
Valery, in your case may be the most equitable "random" distribution is:
(30.06.2014 01:28)Algor Wrote: [ -> ]Как в общем случае (а к частностям привыкать не стоит) можно быть уверенным что те флаги у существа точно есть?
в рамках своего мода (карты) думаю вполне можно быть уверенным.
без нижестоящих модов в списке конечно
(30.06.2014 19:02)Bes Wrote: [ -> ]в рамках своего мода (карты) думаю вполне можно быть уверенным.
без нижестоящих модов в списке конечно
Кхм... а как можно быть уверенным, что твоя карта/мод будет использоваться без сторонних модов? Некоторые вон даже стандартные карты вогифицируют. Потому я и написал "к частностям привыкать не стоит". Тем более, что трудозатрат написать |2-2 никаких практически, а уверенность будет.
Здравствуйте.. Спасибо большое Вам всем за совет и помощь..
(30.06.2014 11:25)Algor Wrote: [ -> ]Valery, in your case may be the most equitable "random" distribution is:
Hmm, I started my first maths with erm, so this %4 reminder I don't get it. Can someone explain me this super complex euclidean algorithm?

(01.07.2014 21:50)Valery Wrote: [ -> ]Hmm, I started my first maths with erm, so this %4 reminder I don't get it. Can someone explain me this super complex euclidean algorithm? 
ERM Help Wrote:%# Set the variable to the reminder from division by #
Algorithm is very simple:
1. FU creates a sequence 109,110,111,113,109,110,111,113,... and add equal artifact to 0,1,2,3,4,5th... hero.
2. "!!VRy1:S0 R3; [random shift for fist hero]" set random shift (0..3) for this sequence.
No, I understand everything, only the %4 part confuses me.
(02.07.2014 00:58)Valery Wrote: [ -> ]No, I understand everything, only the %4 part confuses me.
!!VRy1:Sx1 +x16 %4 +109;
** x1 - shift 0..3
** x16 - hero num 0,1,2,3,4,5,...
** x1 +x16 - hero num with shift
** x1 +x16 %4 - sequence ...0,1,2,3,0,1,2,3,...
** x1 +x16 %4 +109 - sequence ...109,110,111,112,109,110,111,112,...
ok thanks, will look online for an explanation of %. Because I really don't get how you can obtain 0-3 from let's say 159 (xeron + shift) just with %4 operation.
"%# Set the variable to the reminder from division by #" from erm help
makes no sense for me. If we divide 159 by 4, the reminder will not be 0-3.
159 divided by 4 is 39 and remainder is 159-4*39=3. 3 belongs to the interval 0-3.