Running a script on the server, not on one of the clients

nmkdnmkd
So, I have an infinite world generator set up.
It's rather simple, it works by picking a random tile from an array.

Now, the problem is: If a new player joins, he won't have the world synced. Even if I'd buffer the world gen RPC, it would only work as long as the player who triggered the world generator is still online.

A solution would be to simply store the tile positions and array indexes in a global script.
Now, to the actual question: How can I run this script (or store data in a different way) on the server - per room, if possible - so any player can download it, without depending on other clients?

It wouldn't be a lot of data, less than 5000*4 ints (= 80kb), or even less if I used short/byte.

Comments

  • Hi @nmkd,

    It's rather simple, it works by picking a random tile from an array.


    You can store the array index of the randomly picked tile in the Room Properties if this is enough to generate the world. Please correct me if I misunderstood the problem.
  • Hi @nmkd,

    It's rather simple, it works by picking a random tile from an array.


    You can store the array index of the randomly picked tile in the Room Properties if this is enough to generate the world. Please correct me if I misunderstood the problem.
    I solved the problem, I am now using a seed that is generated by the 1st player and is then sent to all new players with a buffered RPC.
Sign In or Register to comment.