#Error with Proc Map Gen in mobile

1 messages · Page 1 of 1 (latest)

kind jetty
#

I am using Godot on Android (Galaxy Tablet) , v4. 3

When I start the game, Godot crashes. When I restart it, I see the following Error Msg in the log:

scene/gui/text_edit.cpp:5781 - Index p_line = 31 is out of bounds (text.size() = 31).

My code:

extends Node2D

@export var noise_height_text : NoiseTexture2D
var noise : Noise

var width : int = 10
var height : int = 10

@onready var tile_map = $TileMapLayer

var source_id = 0
var grass_atlas = Vector2i(0,0)
var forest_atlas = Vector2i(2,0)


func _ready():
    noise = noise_height_text.noise
    generate_world()
     
func generate_world():
    for x in range(width):
        for y in range(height):
            var noise_val = noise.get_noise_2d(x,y)
            if noise_val >= 0.0:
                tile_map.set_cell(0, Vector2(x, y), source_id, grass_atlas)
            elif noise_val < 0.0:
                tile_map.set_cell(0, Vector2(x, y), source_id, forest_atlas)
                        
neon tendon
#

I don't think the error you're seeing is to do with the code you posted - do you have any other scenes that get loaded, that gave a TextEdit node in them?