Page 1 of 1

one-way drive through walls

Posted: Wed May 02, 2007 12:15 am
by big_daddy2
i have has this on my mind and was wondering how to do this

Posted: Wed May 02, 2007 12:22 am
by Winny
Dude, you asked this on IRC a few weeks ago, I guess you didn't take my advice.

Here it is again...

http://my.bzflag.org/w/Mesh

Posted: Wed May 02, 2007 12:30 am
by Legolas_
Make one "Face" Passable, and the reverse face not.

Posted: Thu May 03, 2007 9:28 pm
by halo3
ya like legolas said its a mesh with one face passable u coulda just asked me that i sit by u at lunch every day lol.

Posted: Wed May 16, 2007 3:21 am
by Tedius
For those of us who code by hand, is there anyway to do this with a meshbox?

Posted: Wed May 16, 2007 4:00 am
by A Meteorite
Tedius wrote:For those of us who code by hand, is there anyway to do this with a meshbox?
No, meshboxes can not do that.

And you can make meshes by hand, there is nothing keeping you from learning mesh syntax and how to make faces, vertices, etc in BZW code. Editors (such as Blender and Wings3D) just exist to make it easier.

Posted: Wed May 16, 2007 7:18 pm
by anomaly
i can't see what big daddy 2 was talking about, however, if you want to make an object that you can drive into and shoot out of, just make a 'box' for instance and make it 'drivethrough'. you can drive into it and shoot out but noone can shoot in. :D
Tedius: this should work for a meshbox as well. I have done this on one of my maps, I learned it from public servers. I can't recall which ones.

I you just want a simple one way drive through wall then do what legolas and A Meteorite said.

Posted: Wed May 16, 2007 10:26 pm
by A Meteorite
anomaly wrote:Tedius: this should work for a meshbox as well. I have done this on one of my maps, I learned it from public servers. I can't recall which ones.
Meshboxes are just a glorified box with matref and physics support. You can not define faces on a meshbox which is required to make something one-way (see: http://my.bzflag.org/w/Meshbox ).

Posted: Wed May 16, 2007 11:48 pm
by anomaly
Actually I was refering to the drivethrough aspect. You can drive into a meshbox, pyramid, box, etc and shoot out. but noone can shoot into it. I was not clear on the oneway wall thingy. But I see what big daddy 2 was talking about now.

Posted: Fri May 18, 2007 3:07 am
by Tedius
I rolled up my sleeves and hand-coded a mesh. (actually I just ripped it from an existing map and changed the coordinates) I have no idea what most of the stuff means, but it seems to work. (texcoord wha?)

I just needed a simple flat box you could jump up through and land on top of, like the castle floors in Boxywar.

Posted: Mon Aug 27, 2007 8:26 pm
by CUPCAKE
Sorry for opening up this topic after quite a few months...

I was just wondering what is wrong with this mesh:

Code: Select all

mesh
  vertex -30 -30 11
  vertex 30 30 11
  vertex -30 30 11
  vertex 30 -30 11
  face
    vertices 0 1 2 3
  endface
  face
    vertices 3 2 1 0
    passable
  endface
end
The objective is to make a mesh like in the bases on Boxy War, for future reference. But this code doesn't work like those meshes at all...

Thanks,

Posted: Mon Aug 27, 2007 9:52 pm
by CannonBallGuy
CUPCAKE wrote:Sorry for opening up this topic after quite a few months...

I was just wondering what is wrong with this mesh:

Code: Select all

mesh
  vertex -30 -30 11
  vertex 30 30 11
  vertex -30 30 11
  vertex 30 -30 11
  face
    vertices 0 1 2 3
  endface
  face
    vertices 3 2 1 0
    passable
  endface
end
The objective is to make a mesh like in the bases on Boxy War, for future reference. But this code doesn't work like those meshes at all...

Thanks,
You're using the vertexes in the wrong order... or defined them in the wrong order. Whichever...
You have to go around the edges of the shape you're making, not across...

Posted: Mon Aug 27, 2007 11:06 pm
by CUPCAKE
Oh, okay. That make more sense. Thanks!

EDIT: Okay I changed it to this:

Code: Select all

mesh
  vertex -30 -30 11
  vertex 30 -30 11
  vertex -30 -30 11
  vertex -30 30 11
  face
    vertices 0 1 2 3
  endface
  face
    vertices 3 2 1 0
    passable
  endface
end
Yet it still won't work...
In fact, my mesh has disappeared off the map.

EDIT2: Aha! For some reason this works, while the last one didn't:

Code: Select all

mesh
  vertex 30 30 11
  vertex -30 30 11
  vertex -30 -30 11
  vertex 30 -30 11
  face
    vertices 0 1 2 3
  endface
  face
    vertices 3 2 1 0
    passable
  endface
end

Posted: Mon Aug 27, 2007 11:31 pm
by Macrosoft
CannonBallGuy wrote: You're using the vertexes in the wrong order... or defined them in the wrong order. Whichever...
You have to go around the edges of the shape you're making, not across...
to add to that, you are supposed to go around in a counter-clockwise direction:

Code: Select all

mesh
 vertex -1 0 2
 vertex 1 0 2
 vertex 1 0 0
 vertex -1 0 0
 face
  vertices 1 0 3 2 # this will make a square-shaped face with the visible side facing south
 endface
 face
  vertices 2 3 0 1 # makes the same shape in the same place, but the face is visible from the opposite side of the first face
 endface
end
understand?

Posted: Mon Aug 27, 2007 11:50 pm
by CUPCAKE
Okay, that makes more sense.

Posted: Tue Aug 28, 2007 2:22 am
by Tedius
CUPCAKE wrote:

Code: Select all

mesh
  vertex -30 -30 11
  vertex 30 -30 11
  vertex -30 -30 11
  vertex -30 30 11
  face
    vertices 0 1 2 3
  endface
  face
    vertices 3 2 1 0
    passable
  endface
end
Yet it still won't work...
In fact, my mesh has disappeared off the map.
By the way, the reason this doesn't work is in the fourth line you repeated the southwestern corner.

Personally, I like to label my vertices and always start in what I consider the lower left corner. It tends to make things simpler, especially when you start adding texcoords. Find a way that works and stick with it. Here's how I would code your panel:

Code: Select all

mesh
  vertex -30 -30 11 #0
  vertex 30 -30 11  #1
  vertex 30 30 11   #2 
  vertex -30 30 11  #3
  face #roof
    vertices 0 1 2 3
  endface
  face #underbelly
    vertices 1 0 3 2
    passable
  endface
end

Posted: Tue Aug 28, 2007 1:54 pm
by CUPCAKE
For now, I'll just stick with ++, -+, --, +-