Hi, I’m trying to make a game based on randomly generating grids of blocks but running into an issue where it stops spawning in props after 100 props have been generated. Is this a bug or an intended limit?
If it is intended, is there a way that it could be increased? I see how it could cause potential memory issues if the entire island was just spawned in, but maybe a device could be used to set the maximum number of props to be generated and that changes the amount of memory set aside for spawned props. Maybe the limit could be based on which props are actually spawned and stop spawning them after too much space has been used?
Here is my code for reference:
using { /Fortnite.com/Devices }
using { /Verse.org/Native }
using { /Verse.org/Simulation }
using { /Verse.org/Random }
using { /EpicGames.com/Temporary/Diagnostics }
using { /EpicGames.com/Temporary/SpatialMath }
log_minegenerator := class(log_channel){}
minegenerator := class(creative_device):
Logger:log = log{Channel:=log_minegenerator}
@editable
var Blocks:[]creative_prop_asset := array{}
var posx : float = 0.0
var posy : float = 0.0
var posz : float = 0.0
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
SpawnBlocks()
SpawnBlocks()<suspends>:void=
for (A:=0..4):
set posy = 0.0
set posx = posx + 130.0
for (B:=0..4):
set posz = 0.0
set posy = posy + 130.0
for (C:=0..4):
if(Prop := Blocks[GetRandomInt(0, Blocks.Length-1)]):
SpawnPosition:vector3:=vector3{X:=posx, Y:=posy, Z:=posz}
SpawnedProp := SpawnProp(Prop, SpawnPosition, IdentityRotation())
set posz = posz + 110.0
Sleep(1.0)