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-09-08 05:37:18

italkalotfromee
Member
Joined: 2015-05-08
Posts: 117

Lead me towards the path...

Using world data, how do i check if a block is replacing another block?


You do not have to give me code but please like give a hint like the path i should go.. If this makes sense.


FluxBB bbcode test

Offline

#2 2017-09-08 07:30:13

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

Re: Lead me towards the path...

I guess you are talking about init worlddata? Store them as arrays then check if a block get placed over the array from the "b", "br" and so on.

Offline

Wooted by: (2)

#3 2017-09-08 08:21:55

MartenM
Member
From: The Netherlands
Joined: 2016-03-31
Posts: 978
Website

Re: Lead me towards the path...

Use processors init parsing to get the block data about the world. Then just simpy listen to the block messages and do your checks.


lm3hgg8.jpg

Ingame: marten22        My steam: MartenM

Offline

Wooted by:

#4 2017-09-08 10:09:13, last edited by Tomahawk (2017-09-08 10:13:10)

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,847

Re: Lead me towards the path...

To maintain 100% accurate mapdata you need to listen for all block types.

Currently that's "b", "bc", "br", "bs", "ts", "pt", "wp" and "lb".

Get the coordinate of any block received from those types and put its details into the same coordinate in the mapdata, making sure to also store any additional parameters like rotation.


Additional stuff:

You should take care where in OnMessage you update your mapdata. If you do it right at the start, then send a block in "b", your mapdata is essentially out of date until the message for that block returns. If, for instance, you have a bunch of moving blocks in "b", your mapdata will remain one "frame" behind the actual block positions. This can cause problems when you need the mapdata for something else. Also keep in mind that as blocks can now be sent with almost no delay, a block moving really quickly can be several places away from where the mapdata thinks it is due to the delay in receiving messages.

In certain cases it's worth it to manually update the mapdata when you send a block (or very slightly after). It's a bit risky because there's always a chance that the block won't get placed, but now that the serverside doesn't meddle with placement speeds you can be fairly sure it'll get there.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

#5 2017-09-08 11:19:56

Latif
Member
From: The Netherlands
Joined: 2015-03-13
Posts: 1,206

Re: Lead me towards the path...

It's lots of boring work, I wish it was all in the "b" message.

Let me find some code to post here.

Offline

#6 2017-09-08 11:28:03

Gosha
Member
From: Russia
Joined: 2015-03-15
Posts: 6,211

Re: Lead me towards the path...

Latif wrote:

It's lots of boring work, I wish it was all in the "b" message.

Well, no! You would still need to do a lot of work with just "b" message.
You would need a list of blocks so you can get accruent data from the block id. So it's even worse.

Offline

#7 2017-09-08 22:59:42

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: Lead me towards the path...

block code handler apparently

Offline

#8 2017-09-08 23:07:40, last edited by LukeM (2017-09-08 23:23:07)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: Lead me towards the path...

Do you mean blocks placed by the bot or blocks placed by players, and will you need to know what the blocks are?
Depending on this, a lot of these solutions might not work, or might be overcomplicating it.

Edit: I thought of a few more things:
What exactly do you mean by replaces a block?
Can both players and the bot place blocks?
Do you mind about possible synchronisation issues?
Do you mind about small delays after placing blocks before they are registered as there?

Offline

#9 2017-09-09 05:45:01

italkalotfromee
Member
Joined: 2015-05-08
Posts: 117

Re: Lead me towards the path...

destroyer123 wrote:

Do you mean blocks placed by the bot or blocks placed by players, and will you need to know what the blocks are?
Depending on this, a lot of these solutions might not work, or might be overcomplicating it.

Edit: I thought of a few more things:
What exactly do you mean by replaces a block?
Can both players and the bot place blocks?
Do you mind about possible synchronisation issues?
Do you mind about small delays after placing blocks before they are registered as there?

I meant like if a player tries to replace my basic block [9] or any block with a different block. It keeps the block i placed. Same with everyone else.


FluxBB bbcode test

Offline

#10 2017-09-09 09:21:37, last edited by LukeM (2017-09-09 09:23:24)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: Lead me towards the path...

italkalotfromee wrote:
destroyer123 wrote:

Do you mean blocks placed by the bot or blocks placed by players, and will you need to know what the blocks are?
Depending on this, a lot of these solutions might not work, or might be overcomplicating it.

Edit: I thought of a few more things:
What exactly do you mean by replaces a block?
Can both players and the bot place blocks?
Do you mind about possible synchronisation issues?
Do you mind about small delays after placing blocks before they are registered as there?

I meant like if a player tries to replace my basic block [9] or any block with a different block. It keeps the block i placed. Same with everyone else.

So... If a player places a block on top of an already existing block, the bot replaces it with the old block?

Can players replace their own blocks?

Offline

#11 2017-09-09 13:15:54

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: Lead me towards the path...

destroyer123 wrote:

So... If a player places a block on top of an already existing block, the bot replaces it with the old block?

Can players replace their own blocks?

As he mentions. When anybody places a block over any block italkalotfromee placed, the placement is reverted.
So yes, people can replace their own blocks, but nobody can replace the blocks of somebody else.

Offline

#12 2017-09-09 14:05:42

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: Lead me towards the path...

den3107 wrote:
destroyer123 wrote:

So... If a player places a block on top of an already existing block, the bot replaces it with the old block?

Can players replace their own blocks?

As he mentions. When anybody places a block over any block italkalotfromee placed, the placement is reverted.
So yes, people can replace their own blocks, but nobody can replace the blocks of somebody else.

That could also mean including themselves though, either could be useful depending on what they want to use the bot for.

Thats a good point actually, if you can tell us what youre trying to use the bot for, we might be able to work out some of the answers to the questions

Offline

#13 2017-09-10 09:29:05, last edited by italkalotfromee (2017-09-10 09:30:26)

italkalotfromee
Member
Joined: 2015-05-08
Posts: 117

Re: Lead me towards the path...

destroyer123 wrote:

So... If a player places a block on top of an already existing block, the bot replaces it with the old block?
Can players replace their own blocks?

1. Yes. [I want the method of this so i can experiment with other things around this fundamental idea.]
2. Yes.


FluxBB bbcode test

Offline

#14 2017-09-10 10:33:44, last edited by LukeM (2017-09-10 10:37:20)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: Lead me towards the path...

Ok... So... I think that should be enough info
To do this, you will need to keep an updated record of the world, including all the args and the player that placed the blocks

The first step would be to parse the world, I guess using some world parser someone has made, I think there have been a few suggested above.
You will then need to store this in an array, so I would suggest making a struct to store what you need (id, args, player id), for the parsed world, I guess using pid -1 for blocks that have been there since you joined the world.
You will then need to handle all the block messages, and if the pids are not the same (and id is not zero), replace the previous block, and if they are, update the block in the array. (Ignore blocks placed by the bot)

I think if you do it this way, the world will stay synchronised (desynchronisation can be a huge problem, and could effectively allow people to bypass the block checker thing if you're not careful)

Offline

Wooted by:

#15 2017-09-10 10:51:10

italkalotfromee
Member
Joined: 2015-05-08
Posts: 117

Re: Lead me towards the path...

destroyer123 wrote:

Ok... So... I think that should be enough info
To do this, you will need to keep an updated record of the world, including all the args and the player that placed the blocks

The first step would be to parse the world, I guess using some world parser someone has made, I think there have been a few suggested above.
You will then need to store this in an array, so I would suggest making a struct to store what you need (id, args, player id), for the parsed world, I guess using pid -1 for blocks that have been there since you joined the world.
You will then need to handle all the block messages, and if the pids are not the same (and id is not zero), replace the previous block, and if they are, update the block in the array. (Ignore blocks placed by the bot)

I think if you do it this way, the world will stay synchronised (desynchronisation can be a huge problem, and could effectively allow people to bypass the block checker thing if you're not careful)

Thanks for the help. //forums.everybodyedits.com/img/smilies/cool


FluxBB bbcode test

Offline

italkalotfromee1505037070676837

Board footer

Powered by FluxBB

[ Started around 1732700354.9985 - Generated in 0.203 seconds, 12 queries executed - Memory usage: 1.64 MiB (Peak: 1.86 MiB) ]