Current time: 18.04.2024, 20:24 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
ГСЧ - Генератор случайных чисел & ЕРМ
» Готовые решения, вопросы, обсуждение и т.п.
Author Message
Bes Offline

Posts: 5422
Post: #16

in PM using this simple code
(This post was last modified: 17.07.2016 21:20 by Bes.)
17.07.2016 21:16
Visit this user's website Find all posts by this user Quote this message in a reply
gamecreator Offline

Posts: 7107
Post: #17

You can do something like this instead:


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

Posts: 2196
Post: #18

In fact I have 3 random values to get in a row (v2-v4), so I thought time based will give same values.
17.07.2016 22:05
Find all posts by this user Quote this message in a reply
gamecreator Offline

Posts: 7107
Post: #19

That's why bugyboy and I didn't suggest it.


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

Posts: 2196
Post: #20

Not sure how to use your code: I want random level 8 monster (150-158)

!!VRv1:S0 T2147483647 &2147483647 R0/v1; set random seed to current time

I am lost, don't understand the bit part
(This post was last modified: 17.07.2016 23:37 by Valery.)
17.07.2016 23:27
Find all posts by this user Quote this message in a reply
gamecreator Offline

Posts: 7107
Post: #21

Both my and bugyboy's code are initialization-type. You only need to run it once, then you are free to generate whatever and however many times you need.


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

Posts: 2196
Post: #22

ah now makes sense. Thanks both.

I put it in a timer and it runs once a week, before randomizer. When you said "one time", means really one time, in PI or so?
(This post was last modified: 18.07.2016 01:43 by Valery.)
18.07.2016 01:42
Find all posts by this user Quote this message in a reply
gamecreator Offline

Posts: 7107
Post: #23

Most likely. VR:R is essentially SoD random, I'm not sure if it's saved in the save file.

But you can execute it several times if you like, just not too often.


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

Posts: 2196
Post: #24

But if it is not saved then I need to recall it in GM, like UN hacks? Will be executed quite often then.
18.07.2016 02:34
Find all posts by this user Quote this message in a reply
gamecreator Offline

Posts: 7107
Post: #25

You can check easily if it's saved or not. Save the game and generate random value on load.
(18.07.2016 02:34)Valery Wrote:  Will be executed quite often then.
Do you save several times per turn and load every single of those saves?


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

Posts: 2196
Post: #26

No, as quick saves mod replace previous quick save with the new one, so I have only a maximum of two saves daily, the automatic and the manual.
18.07.2016 03:31
Find all posts by this user Quote this message in a reply
gamecreator Offline

Posts: 7107
Post: #27

Then I don't see a problem. You are calling it on load, not on save.


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

Posts: 2196
Post: #28

Right now I only put it in a weekly timer, no on GM. So far there are no problems and random values are really random, I like it.
18.07.2016 04:13
Find all posts by this user Quote this message in a reply
Sedman7 Offline

Posts: 22
Post: #29

катастрофа, сломался рандом

Code:
ZVSE
!#TM20:S2/999/1/1;
!?TM20;
!!VRy1:S0;
!!VRy1:R100;
!!IF:M^%Y1^;
всегда получаю одно и тоже значение - 36
всё работало хорошо, рандом работал как надо, создавал карту, добавлял скрипты и в один день заметил что рандом выдаёт одно и тоже число, в чем может быть причина?

ради эксперимента:
- удалил с карты все скрипты, оставил только этот, один, и всё равно не работает
- создал новую карту, пустую (2 замка только синий и красный), вставил туда этот скрипт, всё нормально работает
(This post was last modified: 10.04.2018 02:52 by Sedman7.)
10.04.2018 02:16
Find all posts by this user Quote this message in a reply
Algor Away
Administrators

Posts: 3880
Post: #30

Sedman7, если у тебя не куча рандом-команд за секунду выполняется, можно использовать VR:T вместо VR:R. Ну или вручную инициализировать генератор можно (доп. синтаксис VR:R).


BattleHeroes Rus/Eng | ERA scripts (+ReMagic) Rus/Eng
10.04.2018 13:34
Visit this user's website 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