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 2015-09-03 19:36:41

Soubr
Member
Joined: 2015-02-18
Posts: 36

[help] get map data

Hi,

I used to have a function "desblocks" in my code wich gets all the blocks id's on the room, but it seems not to be working anymore:

public void desBlocks(PlayerIOClient.Message m, uint start)
        {
            System.Threading.ThreadPool.QueueUserWorkItem(delegate
            {
                try
                {
                    uint messageIndex = start;
                    while (messageIndex < m.Count)
                    {
                        if (m[messageIndex] is string)
                        {
                            break;
                        }

                        int blockId = m.GetInteger(messageIndex);
                        messageIndex++;

                        int z = m.GetInteger(messageIndex);
                        messageIndex++;

                        byte[] xa = m.GetByteArray(messageIndex);
                        messageIndex++;

                        byte[] ya = m.GetByteArray(messageIndex);
                        messageIndex++;

                        if (blockId == 242 || blockId == 381)
                        {
                            messageIndex += 3;
                        }
                        else if (blockId == 374 || blockId == 43 ||
                                 blockId == 165 || blockId == 83 ||
                                 blockId == 77 || blockId == 361 ||
                                 (blockId > 374 && blockId < 381) ||
                                 blockId == 213 || blockId == 214 ||
                                 blockId == 1000 || blockId == 385)
                        {
                            messageIndex++;
                        }
                        int x = 0, y = 0;

                        for (int pos = 0; pos < ya.Length; pos += 2)
                        {
                            x = (xa[pos] * 256) + xa[pos + 1];
                            y = (ya[pos] * 256) + ya[pos + 1];

                            if (blockId < 500)
                            {
                                Bricks[x, y] = blockId;
                            }
                            else
                                Bg[x, y] = blockId;
                        }
                    }
                }

                catch (Exception e)
                {
                    Console.WriteLine("Error loading existing blocks:\n" + e);
                }
            });
        }

Does anyone have a function to replace that one?

Offline

#2 2015-09-03 19:43:18

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

Re: [help] get map data

Use http://forums.everybodyedits.com/viewtopic.php?id=26792 instead. No need to update the new blocks.

Offline

#3 2015-09-03 19:44:05

ZeldaXD
EE Homeboy
From: Cyprus
Joined: 2015-02-15
Posts: 1,539
Website

Re: [help] get map data

Use InitParse


gLjTZE1.png

Offline

#4 2015-09-03 20:03:22, last edited by Soubr (2015-09-03 20:03:39)

Soubr
Member
Joined: 2015-02-18
Posts: 36

Re: [help] get map data

ZeldaXD wrote:

thx

capasha wrote:

Use http://forums.everybodyedits.com/viewtopic.php?id=26792 instead. No need to update the new blocks.

o.o capasha. thank you

Offline

Soubr1441307002538134

Board footer

Powered by FluxBB

[ Started around 1732781783.4695 - Generated in 0.050 seconds, 14 queries executed - Memory usage: 1.41 MiB (Peak: 1.52 MiB) ]