Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Random Generation

AnAverageGuest
Guest
Quote
2020-03-30 03:53:46

Does anyone know how to make a random terrain generation using cube meshes? If so, please let me know!


AnAverageGuest
Guest
Quote
2020-03-30 20:02:42

i need a reply


AnAverageGuest
Guest
Quote
2020-03-31 01:48:01

Anyone?


just_in_case
Moderator
Quote
2020-03-31 14:40:33

Already answered a similar question asked here https://www.ambiera.com/forum.ph...

hope this helps


Harol
Guest
Quote
2024-04-25 23:54:45

hi is to late?


Guest
Guest
Quote
2024-04-26 12:01:15

Harol wrote:
hi is to late?

No it's just a 4 years old)))


okeoke
Registered User
Quote
2024-04-26 13:37:59

Oh, thats super easy.

You just need to use a 3rd party API like:

https://www.randomnumberapi.com/api/v1.0/random?min=100&max=1000&count=1

So you simply execute http call using ccbDoHTTPRequest, and get the value inside the callback function. Since you're receiving a string which contains an array, you need to deserialize it first. If you only need one value, get the first element.

var randomInt;
ccbDoHTTPRequest('www.randomnumberapi.com/api/v1.0/random?min=100&max=1000&count=1', function(data) {
// deserialize
data = eval(data);
// get first element
randomInt = data[0];
});

It's the most efficient and straight forward way of doing it. 100%.


okeoke
Registered User
Quote
2024-04-26 13:43:02

You can actually get a random number from 0 to 10 using the following code:
Math.round((new Date().getMilliseconds()) / 100)



okeoke
Registered User
Quote
2024-04-26 13:47:12

There is actually a full article on that: https://svijaykoushik.github.io/....
Nice.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact