one-way drive through walls

Questions and answers about the how and why of making maps.
Post Reply
User avatar
big_daddy2
Private First Class
Private First Class
Posts: 131
Joined: Sat May 06, 2006 1:06 am
Location: the middle of nowhere, USA

one-way drive through walls

Post by big_daddy2 » Wed May 02, 2007 12:15 am

i have has this on my mind and was wondering how to do this

User avatar
Winny
Grouchy
Grouchy
Posts: 2381
Joined: Wed Aug 24, 2005 12:27 am
Location: Ottawa eh?
Contact:

Post by Winny » Wed May 02, 2007 12:22 am

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

Legolas_
Private First Class
Private First Class
Posts: 513
Joined: Thu Jan 20, 2005 10:24 pm

Post by Legolas_ » Wed May 02, 2007 12:30 am

Make one "Face" Passable, and the reverse face not.

User avatar
halo3
Private First Class
Private First Class
Posts: 122
Joined: Tue Dec 27, 2005 11:24 pm
Location: ohio,usa
Contact:

Post by halo3 » Thu May 03, 2007 9:28 pm

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.
Image

User avatar
Tedius
Sergeant First Class
Sergeant First Class
Posts: 142
Joined: Tue Sep 19, 2006 6:10 pm
Contact:

Post by Tedius » Wed May 16, 2007 3:21 am

For those of us who code by hand, is there anyway to do this with a meshbox?

User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite » Wed May 16, 2007 4:00 am

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.
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com

anomaly
Private First Class
Private First Class
Posts: 220
Joined: Tue Jul 26, 2005 10:32 pm
Location: Gainesville Florida

Post by anomaly » Wed May 16, 2007 7:18 pm

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.

User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite » Wed May 16, 2007 10:26 pm

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 ).
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com

anomaly
Private First Class
Private First Class
Posts: 220
Joined: Tue Jul 26, 2005 10:32 pm
Location: Gainesville Florida

Post by anomaly » Wed May 16, 2007 11:48 pm

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.

User avatar
Tedius
Sergeant First Class
Sergeant First Class
Posts: 142
Joined: Tue Sep 19, 2006 6:10 pm
Contact:

Post by Tedius » Fri May 18, 2007 3:07 am

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.

CUPCAKE
Private First Class
Private First Class
Posts: 303
Joined: Sat Sep 30, 2006 2:31 pm

Post by CUPCAKE » Mon Aug 27, 2007 8:26 pm

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,

User avatar
CannonBallGuy
Private First Class
Private First Class
Posts: 2083
Joined: Wed Apr 12, 2006 1:31 am
Contact:

Post by CannonBallGuy » Mon Aug 27, 2007 9:52 pm

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...
Image

Merry Christmas!

"Look, if I don't buy booze for the kids, I don't get any incriminating pictures to show to their parents, my business goes down the sink, my girlfriend leaves me and the baby goes on ebay. So help me search..."

"go Play With Toys urself in a dark alley u donkey ******" - Lt-Kirby2007

CUPCAKE
Private First Class
Private First Class
Posts: 303
Joined: Sat Sep 30, 2006 2:31 pm

Post by CUPCAKE » Mon Aug 27, 2007 11:06 pm

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
Last edited by CUPCAKE on Tue Aug 28, 2007 1:53 pm, edited 1 time in total.

User avatar
Macrosoft
Private First Class
Private First Class
Posts: 142
Joined: Fri May 04, 2007 2:21 am

Post by Macrosoft » Mon Aug 27, 2007 11:31 pm

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?
gazz: A bullet may have your name on it, but shrapnel is addressed "to whom it may concern".
http://bash.org/?785529

CUPCAKE
Private First Class
Private First Class
Posts: 303
Joined: Sat Sep 30, 2006 2:31 pm

Post by CUPCAKE » Mon Aug 27, 2007 11:50 pm

Okay, that makes more sense.

User avatar
Tedius
Sergeant First Class
Sergeant First Class
Posts: 142
Joined: Tue Sep 19, 2006 6:10 pm
Contact:

Post by Tedius » Tue Aug 28, 2007 2:22 am

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
this signature intentionally left blank

CUPCAKE
Private First Class
Private First Class
Posts: 303
Joined: Sat Sep 30, 2006 2:31 pm

Post by CUPCAKE » Tue Aug 28, 2007 1:54 pm

For now, I'll just stick with ++, -+, --, +-

Post Reply