Bes
Posts: 5422
|
(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 01:12 |
|
Valery
Posts: 2196
|
(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.
(This post was last modified: 30.06.2014 02:36 by Valery.)
|
|
30.06.2014 02:34 |
|
gamecreator
Posts: 7107
|
|
30.06.2014 03:17 |
|
Algor
Posts: 3881
|
Valery, in your case may be the most equitable "random" distribution is:
|
|
30.06.2014 11:25 |
|
Bes
Posts: 5422
|
(30.06.2014 01:28)Algor Wrote: Как в общем случае (а к частностям привыкать не стоит) можно быть уверенным что те флаги у существа точно есть?
в рамках своего мода (карты) думаю вполне можно быть уверенным.
без нижестоящих модов в списке конечно
|
|
30.06.2014 19:02 |
|
fatsawhorse
Posts: 1022
|
Здравствуйте.. Спасибо большое Вам всем за совет и помощь..
(This post was last modified: 01.07.2014 19:46 by fatsawhorse.)
|
|
01.07.2014 19:45 |
|
Algor
Posts: 3881
|
(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.
|
|
02.07.2014 00:30 |
|
Valery
Posts: 2196
|
No, I understand everything, only the %4 part confuses me.
|
|
02.07.2014 00:58 |
|
Algor
Posts: 3881
|
(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,...
|
|
02.07.2014 01:25 |
|
Valery
Posts: 2196
|
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.
(This post was last modified: 02.07.2014 02:33 by Valery.)
|
|
02.07.2014 02:07 |
|
gamecreator
Posts: 7107
|
|
02.07.2014 02:55 |
|