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 Before February 2015

Arie2002CSB
Guest

Decoding Room Information about Blocks in Room

I am currently using Capasha's way of decoding room information (http://pastebin.com/9uFrYtYp)
And it works amazingly! The only problem is: With big rooms (I have a 200x400 room) it takes a very long time before it's done...

Is there a different / better way to decode the room information?
Usually I would make the code myself, but I also have no idea how the code works... It just does.

Here is all my code if you need it:
https://www.dropbox.com/sh/rmjrpf4jg6mf … 1gxQa?dl=0
(Coded in C# in Visual Studio 2010)

#2 Before February 2015

Mr. Force
Guest

Re: Decoding Room Information about Blocks in Room

http://pastebin.com/uTZbmdpW
Here is the code.
Capasha's one is a lil bit old i think.

*WARNING*
To complete the code, write in the case "init":

desBlocks(m, 20u);

#3 Before February 2015

Arie2002CSB
Guest

Re: Decoding Room Information about Blocks in Room

forcesniper wrote:

http://pastebin.com/uTZbmdpW
Here is the code.
Capasha's one is a lil bit old i think.

*WARNING*
To complete the code, write in the case "init":

desBlocks(m, 20u);

Thank you!

EDIT:
Is there also a way of doing this so that the code can be used forever? Because now if EE is adding a block with custom variables (rotation etc.) the code doesnt work anymore

Last edited by Arie2002CSB (Dec 9 2014 7:40:18 am)

#4 Before February 2015

Jabatheblob1
Member
Joined: 2015-03-01
Posts: 856

Re: Decoding Room Information about Blocks in Room

Btw that isn't faster, using a threadpool doesn't make it any faster it just makes it skip over it basically so it can do other things, if you try to access the array that has the blocks in it it will throw and error or it will just say that there isn't anything there because you haven't set it yet. Long story short that way isn't any faster.


If you would like me to make a bot for you, go here.

Offline

#5 Before February 2015

TiKen
Member
Joined: 2015-02-24
Posts: 298

Re: Decoding Room Information about Blocks in Room

Arie2002CSB wrote:

Is there also a way of doing this so that the code can be used forever? Because now if EE is adding a block with custom variables (rotation etc.) the code doesnt work anymore

You could jump to i+4 if you don't know the block. But it would only work for regular blocks...
Or you could just create a external list that you open and which contains the number of parameters to retrieve for each ID. So that you just have to update the list, and not recompile the code every time.

Offline

#6 Before February 2015

lrussell
Member
From: Saturn's Titan
Joined: 2015-02-15
Posts: 843
Website

Re: Decoding Room Information about Blocks in Room

If you don't need the live level, you can use my web-based API which gets the world as of its last save.
Everything is still a bit rough, if your request is invalid it returns HTTP Status Code 400 at least.
http://api.everybodyedits.info/WorldDat … dt06vvya0I (just replace the ID with your own).

You'll need Json.Net to deserialize it to a "World" object, just use WebClient's DownloadString to get the data.
Also, you'll need to reference System.Drawing to get Point.

Here's the classes:

public class World         {             public string Id, Name = "Untitled World", OwnerId, Owner;             public int Plays, Width = 200, Height = 200, Woots, TotalWoots;             public bool AllowPotions, Visible;             public Color BackgroundColor;             public List<WorldData> WorldData = new List<WorldData>();         }          public class WorldData         {             public int type, layer, rotation, id, goal;             public string target, text;             public List<Point> locs = new List<Point>();         }

Offline

#7 Before February 2015

TiKen
Member
Joined: 2015-02-24
Posts: 298

Re: Decoding Room Information about Blocks in Room

You can directly get it directly from playerIO, but to increase traffic on lrussell website I'll keep it for me //forums.everybodyedits.com/img/smilies/big_smile

Offline

Arie2002CSB 1423758793202639

Board footer

Powered by FluxBB

[ Started around 1714852918.4595 - Generated in 0.051 seconds, 13 queries executed - Memory usage: 1.46 MiB (Peak: 1.58 MiB) ]