Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2017-01-19 22:38:47

Firecrackericebreak
Member
Joined: 2015-02-15
Posts: 616

Saving Worlds

   public void saveLevel(string fileName)
        {
            string text = "";
            foreach(block b in blocks.Values)
            {
                if (b.fg != 0)
                {
                    text += "0,"+b.x+","+b.y+","+b.fg+"|";
                }
                if (b.bg != 0)
                {
                    text += "1," + b.x + "," + b.y + "," + b.fg+"|";
                }
            }
            using (StreamWriter sw = new StreamWriter(Environment.CurrentDirectory + @"\Levels\" + fileName + ".txt"))
            {
                sw.Write(text);
            }
        }

Why is it that when I save a world with this code all bg blocks get a layer of 0?

Offline

#2 2017-01-19 22:51:48

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: Saving Worlds

Shouldn't text += "1," + b.x + "," + b.y + "," + b.fg+"|";
Be, b.bg?

Offline

#3 2017-01-19 22:54:33

Firecrackericebreak
Member
Joined: 2015-02-15
Posts: 616

Re: Saving Worlds

capasha wrote:

Shouldn't text += "1," + b.x + "," + b.y + "," + b.fg+"|";
Be, b.bg?

I tried that and it made no difference and either way that is the block id not layer

Offline

#4 2017-01-19 23:05:43

Firecrackericebreak
Member
Joined: 2015-02-15
Posts: 616

Re: Saving Worlds

solved

Offline

Firecrackericebreak1484863543643681

Board footer

Powered by FluxBB

[ Started around 1713569414.299 - Generated in 0.091 seconds, 12 queries executed - Memory usage: 1.39 MiB (Peak: 1.49 MiB) ]