Current time: 29.11.2024, 01:16 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
Ваши вопросы по ERM-скриптам
Author Message
Bes Offline

Posts: 5422
Post: #2806

(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 для отключения иммуна к огню
Mail1
30.06.2014 01:12
Visit this user's website Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3881
Post: #2807

Как в общем случае (а к частностям привыкать не стоит) можно быть уверенным что те флаги у существа точно есть?


BattleHeroes Rus/Eng | ERA scripts (+ReMagic) Rus/Eng
30.06.2014 01:28
Visit this user's website Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #2808

(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
Find all posts by this user Quote this message in a reply
gamecreator Offline

Posts: 7107
Post: #2809

(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?


When all gods have burnt to ashes in eternity of sorrow,
Demons gonna tear your soul because there is no tomorrow.
30.06.2014 03:17
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #2810

147

Good idea, I am getting old. Thanks.
30.06.2014 03:21
Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3881
Post: #2811

Valery, in your case may be the most equitable "random" distribution is:


BattleHeroes Rus/Eng | ERA scripts (+ReMagic) Rus/Eng
30.06.2014 11:25
Visit this user's website Find all posts by this user Quote this message in a reply
Bes Offline

Posts: 5422
Post: #2812

(30.06.2014 01:28)Algor Wrote:  Как в общем случае (а к частностям привыкать не стоит) можно быть уверенным что те флаги у существа точно есть?
в рамках своего мода (карты) думаю вполне можно быть уверенным.
без нижестоящих модов в списке конечно
30.06.2014 19:02
Visit this user's website Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3881
Post: #2813

(30.06.2014 19:02)Bes Wrote:  в рамках своего мода (карты) думаю вполне можно быть уверенным.
без нижестоящих модов в списке конечно
Кхм... а как можно быть уверенным, что твоя карта/мод будет использоваться без сторонних модов? Некоторые вон даже стандартные карты вогифицируют. Потому я и написал "к частностям привыкать не стоит". Тем более, что трудозатрат написать |2-2 никаких практически, а уверенность будет.


BattleHeroes Rus/Eng | ERA scripts (+ReMagic) Rus/Eng
01.07.2014 06:05
Visit this user's website Find all posts by this user Quote this message in a reply
fatsawhorse Offline

Posts: 1022
Post: #2814

Здравствуйте.. Спасибо большое Вам всем за совет и помощь..
(This post was last modified: 01.07.2014 19:46 by fatsawhorse.)
01.07.2014 19:45
Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #2815

(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? Spiteful
01.07.2014 21:50
Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3881
Post: #2816

(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? Spiteful

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.


BattleHeroes Rus/Eng | ERA scripts (+ReMagic) Rus/Eng
02.07.2014 00:30
Visit this user's website Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #2817

No, I understand everything, only the %4 part confuses me.
02.07.2014 00:58
Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3881
Post: #2818

(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,...


BattleHeroes Rus/Eng | ERA scripts (+ReMagic) Rus/Eng
02.07.2014 01:25
Visit this user's website Find all posts by this user Quote this message in a reply
Valery Offline

Posts: 2196
Post: #2819

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
Find all posts by this user Quote this message in a reply
gamecreator Offline

Posts: 7107
Post: #2820

159 divided by 4 is 39 and remainder is 159-4*39=3. 3 belongs to the interval 0-3.


When all gods have burnt to ashes in eternity of sorrow,
Demons gonna tear your soul because there is no tomorrow.
02.07.2014 02:55
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