#I m getting a index outside of bounds of

1 messages · Page 1 of 1 (latest)

dusk summit
#

ight

dire marsh
#

it looks fine

#

i think you have a logic flaw somewhere else

dusk summit
#

fuuuckkk

dire marsh
#

how are you drawing

#

the map?

dusk summit
#

with tilemaps

dire marsh
#

i mean code wise

dusk summit
#

public void refresh()
    {
        tilemap.ClearAllTiles();
        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < height; y++)
            {
                if (map[x, y] == 1)
                {
                    tilemap.SetTile(new Vector3Int(x, y, 0), worldTiles[0]);
                }
            }
        }
        Debug.Log("Refreshed!");
    }
dire marsh
#

okay thats fine too

#

how are you drawing the walls

#

or how does it know its a wall

#

outer edge

dusk summit
#

line 92

#

if (x == 0 | | x == width - 1 | | y == height - 1 | | y == 0)
{
map[x, y] = 1;
}

dire marsh
#

okay that looks fine too

dusk summit
#

I think I actually tried removing the equals sign originally and put it back when I encountered the chunk bug

dire marsh
#

when is refresh called

dusk summit
#

whenever a chunk is made/loaded

dire marsh
#

also why is this method a coroutine?

dusk summit
#

for timing it

#

Because it's literally required

dire marsh
#

why not just generate the map

dusk summit
#

If I don't do that when I try and generate worlds on the scale that I want to generate it immediately crashes Unity

dire marsh
#

then display it

dusk summit
#

trust me

#

idk if my other thread is still up

dire marsh
#

generate it on the fly

#

don't generate the whole world

dusk summit
#

wha?

#

im not

#

im doing chunks

dire marsh
#

i mean

#

don't even do chunks

#

just generate what you need

dusk summit
#

thats not how my game works

dire marsh
#

but thats a different topic

dusk summit
#

its not like mc

#

its like starbound

#

or terraria

#

the map is pre made on first load

dire marsh
#

then just make it into a task

#

and run it in the background

#

arbitrary yields are kinda pointless

dusk summit
#

this is just what i was told to do

dire marsh
#

whoever told you this is memeing but okay hmm

dusk summit
#

I don't want this script running during gameplay

#

i want it to run on world gen

#

then be dead forever never comming back

dire marsh
#

yeah but this makes world gen a fixed speed

#

rather then as fast as the cpu can do it

dusk summit
#

thats just for debugging

#

im gonna lax it up once the chunks are working

dire marsh
#

i see

dusk summit
#

change it to waitfornextframe

dire marsh
#

thats still making it a fixed speed

#

and makes world gen slow for no reason

dusk summit
#

It's a very very sequential script it has to run in a very particular order

#

as of now with my Knowledge of coding this is what I'm comfortable with\

dire marsh
#

fair enough

#

can you throw a breakpoint

dusk summit
#

with vs?

dire marsh
#

after the array is filled

#

and can you check the right wall

#

coordinates

#

in your map variable

#

either that or you can download teamviewer and i can take a look

#

or discord

#

can do screen share

#

either or

dusk summit
#

does this server have vcs?

dire marsh
#

don't think so

dusk summit
#

no

#

ok well if you want to call over dms im fine with that

#

sorry jitter hands

#

my bad XD