Jump to content
  • 0

buildin_rand: range (0) is to small. No randomness possible === setarray .Peco[0], 2811;         .size = getarraysize(.Peco); .@mid = .Peco[rand(.size)];


Question

3 answers to this question

Recommended Posts

  • 0
Posted

Just tell what you want and we can try to help you.

If .size is initialized after the rand, it will rand(0), try this instead:

.@mid = .Peco[rand(getarraysize(.Peco))]; // else where in the code

OnInit: // inside the script but at end
setarray .Peco[0], 2811;
end;

If size is 1, rand(1) will give 0, which is first position, no error must be shown.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...