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-07-04 12:07:12

OG7DEID8
Member
From: Poland
Joined: 2015-02-18
Posts: 71

Private Blocks

Hey.
I had a idea for blocks that will be great for Roleplay Worlds to make them more compatible.
Please, ignore team text. I don't remember there team blocks already. I'm too lazy to delete the text.

v.1 B5jVRF2.png
v.2 RAATdUR.png

I repeat, ignore team text.
How they are working? Because "private" means strange...
Everybody can place them, don't make them owner-only. Only owner of the block (i mean placer but owner sounds more professional) and world owner can see that block and stand on it. It means, if a PLAYER1 place this block, only he and world owner see it active. Other guys, like PLAYER2 just can't do anything with this. When anybody place other block on it, it just deletes, like other blocks.

What do you think? I think it is very good idea for RPG lovers, to make these blocks like invisible for enemies or make it invisible bridge for only one player.
Waiting for opinions, critize max plz.


If you can do anything,
            Do it, because after u can't do everything,
                   Live isn't infinite,
                        But this isn't too limited!

Offline

#2 2015-07-04 12:53:00

Era
Member
From: ::1
Joined: 2015-05-06
Posts: 884

Re: Private Blocks

No , would require way too mcuh of the gamecode to change i could expliain it in more deatil but im bitz too lazy atm.

Offline

#3 2015-07-04 20:10:39

ProTest
Member
Joined: 2015-06-10
Posts: 11

Re: Private Blocks

Era wrote:

No , would require way too mcuh of the gamecode to change i could expliain it in more deatil but im bitz too lazy atm.

Actually, it wouldn't require too much code changes...

Offline

#4 2015-07-04 22:52:47

Minimania
Moderation Team
From: PbzvatFbba 13
Joined: 2015-02-22
Posts: 6,393

Re: Private Blocks

because secret blocks weren't enough


21cZxBv.png
Click the image to see my graphics suggestions, or here to play EE: Project M!

Offline

Wooted by:

#5 2015-07-04 23:00:31

Era
Member
From: ::1
Joined: 2015-05-06
Posts: 884

Re: Private Blocks

ProTest wrote:

Actually, it wouldn't require too much code changes...

Yea it would only require the physicks and safe format to change tying every used to every world they have ever placed a block in.

Offline

#6 2015-07-05 01:20:13, last edited by ProTest (2015-07-05 01:21:29)

ProTest
Member
Joined: 2015-06-10
Posts: 11

Re: Private Blocks

Era wrote:
ProTest wrote:

Actually, it wouldn't require too much code changes...

Yea it would only require the physicks and safe format to change tying every used to every world they have ever placed a block in.

mhm... i have no idea what you just said, but never mind...

so... u want blocks that only placer of that block and world owner see?

k, here is example code:
[block placing - server]

if (bid == PRIVATE_BLOCK) {
    pl.Send("b", l, x, y, b)
    foreach (Player p in Players) {
	if (p.Id == pl.Id) continue;
		
        if (p.IsOwner)
            p.Send("b", l, x, y, b);
	else
	    p.Send("b", l, x, y, 0); // other players can't see it or stand on it, right? :P
    }
	
	// store username of block 'owner'/placer (gonna save that later in database)
	BlockData[x,y].Arg6 = pl.Username;
}

[world saving - server]

for (int x = 0; x < WorldWidth; x++) {
	for (int y = 0; y < WorldHeight; y++) {
		
		//some other ee code... idc...
		
		if (blocks[x][y].id == PRIVATE_BLOCK) {
			DatabaseObject ob = new DatabaseObject();
			ob.Set("layer", l);
			ob.Set("type", rb);
			ob.Set("x", bufferX);
			ob.Set("y", bufferY);
			ob.Set("placer", blocks[x][y].placer);
			//meh
		}
	}
}

[world init - client]

for (int x = 0; x < WorldWidth; x++) {
	for (int y = 0; y < WorldHeight; y++) {
		if (blocks[x][y].id == PRIVATE_BLOCK) {
			if (blocks[x][y].Arg6 == player.username || player.isowner) {
			//idk..? just continue with loop?
			}
			else {
				blocks[x][y].id = 0;
				blocks[x][y].Arg6 = "";
			}
		}
		// bla bla .. some other code .. bla bla
	}
}

but if u placed private blocks on every single possible coord in 300x300, that would take so much space in database...

ps: maybe i misunderstood OP's post, but meh.. also this is just example code and its late here, so idc if anything is wrong

Offline

#7 2015-07-05 13:25:39

OG7DEID8
Member
From: Poland
Joined: 2015-02-18
Posts: 71

Re: Private Blocks

ProTest wrote:
Era wrote:
ProTest wrote:

Actually, it wouldn't require too much code changes...

Yea it would only require the physicks and safe format to change tying every used to every world they have ever placed a block in.

mhm... i have no idea what you just said, but never mind...

so... u want blocks that only placer of that block and world owner see?

k, here is example code:
[block placing - server]

if (bid == PRIVATE_BLOCK) {
    pl.Send("b", l, x, y, b)
    foreach (Player p in Players) {
	if (p.Id == pl.Id) continue;
		
        if (p.IsOwner)
            p.Send("b", l, x, y, b);
	else
	    p.Send("b", l, x, y, 0); // other players can't see it or stand on it, right? :P
    }
	
	// store username of block 'owner'/placer (gonna save that later in database)
	BlockData[x,y].Arg6 = pl.Username;
}

[world saving - server]

for (int x = 0; x < WorldWidth; x++) {
	for (int y = 0; y < WorldHeight; y++) {
		
		//some other ee code... idc...
		
		if (blocks[x][y].id == PRIVATE_BLOCK) {
			DatabaseObject ob = new DatabaseObject();
			ob.Set("layer", l);
			ob.Set("type", rb);
			ob.Set("x", bufferX);
			ob.Set("y", bufferY);
			ob.Set("placer", blocks[x][y].placer);
			//meh
		}
	}
}

[world init - client]

for (int x = 0; x < WorldWidth; x++) {
	for (int y = 0; y < WorldHeight; y++) {
		if (blocks[x][y].id == PRIVATE_BLOCK) {
			if (blocks[x][y].Arg6 == player.username || player.isowner) {
			//idk..? just continue with loop?
			}
			else {
				blocks[x][y].id = 0;
				blocks[x][y].Arg6 = "";
			}
		}
		// bla bla .. some other code .. bla bla
	}
}

but if u placed private blocks on every single possible coord in 300x300, that would take so much space in database...

ps: maybe i misunderstood OP's post, but meh.. also this is just example code and its late here, so idc if anything is wrong

I know little in coding. That code looks pretty nice. About 300x300 world, we can just make limit of that blocks in the world, like. max. 50, because we don't need soo much. or 100, idk


If you can do anything,
            Do it, because after u can't do everything,
                   Live isn't infinite,
                        But this isn't too limited!

Offline

#8 2015-07-05 13:27:44, last edited by Era (2015-07-05 13:29:17)

Era
Member
From: ::1
Joined: 2015-05-06
Posts: 884

Re: Private Blocks

There is a limit on how big the world size (i ment the save file) can be , assuming that on every block postion can only be 2 blocks (bg and fg) it wont be more,
but allowing an infinite number of blocks per x and y position meens that the save limit can be exceeded

edit: also when 2 ppl place thier block(s) on the same position with different colors, whcih one would be shown?

Offline

#9 2015-07-05 19:53:38

ProTest
Member
Joined: 2015-06-10
Posts: 11

Re: Private Blocks

Era wrote:

whcih one would be shown?

Block that was placed last would be shown...

Offline

ProTest1436122418519304

Board footer

Powered by FluxBB

[ Started around 1732330625.1542 - Generated in 0.063 seconds, 13 queries executed - Memory usage: 1.52 MiB (Peak: 1.67 MiB) ]