Making a meshbox shoot through on only one side

Questions and answers about the how and why of making maps.
Post Reply
User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3249
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Making a meshbox shoot through on only one side

Post by ducatiwannabe » Thu Mar 16, 2006 1:10 pm

I know there is a way to make something drivethrough on only one side and shootthrough on only one side and etc...but I can't remember how to do that.

I want a normal meshbox to be able to shoot outward

| <---
|

But not inward

--> |
|

Can somebody please help me?

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

Post by Winny » Thu Mar 16, 2006 2:24 pm

o wow I was just going to post this same kind of topic, guess Ill wait :E

temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction » Thu Mar 16, 2006 2:45 pm

I don't believe there's a way to do this with a setting in the material, but you could setup a "physical" method.

Take a look at the center box on the ground at pieinthesky.bettagirl.com (it might be easier to see on the BZF V1.10 version of the map or on my mashup map of pieinthesky and mofo)
It has a 'slot' running around it that is too high for a normal shot to go through with out a precise (and time consuming) jump. Inside the box there's a slight elevation that allows the shots to pass out. I've seen the same techinique on other maps.

If you wanted to hide this feature, you could build your meshbox normally (with shoothrough walls) but then build a second invisible "box" with a slot at the correct hieght.
Last edited by temporal distraction on Thu Mar 16, 2006 3:06 pm, edited 1 time in total.

User avatar
person1
Private First Class
Private First Class
Posts: 159
Joined: Wed Sep 14, 2005 3:44 am
Location: Omaha, Nebraska

Post by person1 » Thu Mar 16, 2006 2:57 pm

Can't you just use a mesh in the shape of a box? That would be easy.

I have many boxes on my server right now that act that way. They are use in my aquatic map around the bases.

You can shoot through from the inside of the base, but you can't from the outside.

I could send you the code and explain how to use it. It is very simple, I have them in groups. So all you would have to do is.

Code: Select all

group shootthroughFront
  position 0 25 10
  size 20 20 10
end
Or whatever you want. So it would be just like using a meshbox.
Image
Image
I not just any person, I am person1

User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3249
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe » Thu Mar 16, 2006 3:22 pm

I don't believe there's a way to do this with a setting in the material, but you could setup a "physical" method.

Take a look at the center box on the ground at pieinthesky.bettagirl.com (it might be easier to see on the BZF V1.10 version of the map or on my mashup map of pieinthesky and mofo)
It has a 'slot' running around it that is too high for a normal shot to go through with out a precise (and time consuming) jump. Inside the box there's a slight elevation that allows the shots to pass out. I've seen the same techinique on other maps.
The thing is, I'm not trying to make a bunker, I'm trying to make a spawn zone. The point of not being able to shoot in is to prevent spawn camping. If you stay at the spawn zone and shoot out at people you're eventually going to be shot from behind on this paticular map because of how often people spawn by you.

Yes, person1, that would be great.

And I could change the size to something of a size 25 2 20 or such? I think I about know how to use groups and definitions.

User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3249
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe » Thu Mar 16, 2006 3:42 pm

Ok, I have my mesh, but how do I make it shoot out but not in? Screenshot attatched.

Image

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

Post by Winny » Thu Mar 16, 2006 3:45 pm

you could just make it drive through.


that way if you are inside it you can shoot out but not in.

User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3249
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe » Thu Mar 16, 2006 4:51 pm

The thing is it is hollow. It is not a normal pyramid with a texture.

It is like this:

/ \
/ \

Compared to:


//\\
///\\\

It is empty on the inside.

Therefore I still have it drivethrough...but I want it so that if you shoot in the pod you shoot outward. If I make a normal pyramid and make it drivethrough but not shoothrough it makes it too dark on the inside.

JPT
Private First Class
Private First Class
Posts: 260
Joined: Tue Nov 29, 2005 1:21 pm
Location: Germany

Post by JPT » Thu Mar 16, 2006 8:27 pm

ok.

I did this with 2 mesh faces each side, it's a bit complicated, and maybe, you've to adapt / change the code:

The Pyramid is completly drivethrough and it's on 15 15 15 and its size is 25 25 25

Code: Select all

mesh
  Vertex 40 40 15
  Vertex 40 -10 15
  Vertex -10 -10 15
  Vertex -10 40 15
  Vertex 15 15 40
face
  Vertices 0 1 4
  drivethrough
endface
face
  Vertices 1 2 4
  drivethrough
endface
face
  Vertices 2 3 4
  drivethrough
endface
face
  Vertices 3 0 4
  drivethrough
endface
face
  Vertices 4 1 0
  drivethrough
  shootthrough
endface
face
  Vertices 4 2 1
  drivethrough
  shootthrough
endface
face
  Vertices 4 3 2
  drivethrough
  shootthrough
endface
face
  Vertices 4 0 3
  drivethrough
  shootthrough
endface
end
you have to add "dyncol whatever" to every face in order to add a dynamic color ;)

User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3249
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe » Thu Mar 16, 2006 9:02 pm

Unfortunately, I thank you for your code, but it's making it so you shoot in to the spawnpod and it bounced around on the inside. It's backward from what I want.

Another thing is, the size is correct, but for some reason I can't get the position right.

User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan » Thu Mar 16, 2006 9:16 pm

If your pod walls have opposing faces, e.g.

(inside) |__| (outside)

then simply make the inside wall shootthrough. The shots will go through first wall (facing inside) because of shootthrough property and since 2nd wall is facing the opposite direction from the shot direction, it will pass right through. For example:

shootthrough face (inside) |__| normal face (outside)

Inferno
Private First Class
Private First Class
Posts: 91
Joined: Sat Jan 22, 2005 6:52 pm
Contact:

Post by Inferno » Fri Mar 17, 2006 12:09 am

Louman's right, but I have a better idea code wise:

Code: Select all

meshpyr
drivethrough
position X Y 15
size  25 25 35
end
I hope this helps,
Inferno[/quote]

User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3249
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe » Fri Mar 17, 2006 12:15 am

The difference between yours and mine, Inferno, is that mine is hollow on the inside. If I use a meshpyr that's drivethrough but not shootthrough, it's really dark when you spawn.

Thanks anyway.

Inferno
Private First Class
Private First Class
Posts: 91
Joined: Sat Jan 22, 2005 6:52 pm
Contact:

Post by Inferno » Fri Mar 17, 2006 12:48 am

ok ok:

Code: Select all

define spawnPyr
mesh
drivethrough

vertex 0 0 1
vertex -1 -1 0
vertex -1 1 0
vertex 1 1 0
vertex 1 -1 0

face 
vertices 0 1 2
endface
face 
vertices 0 2 3
endface
face 
vertices 0 3 4
endface
face 
vertices 0 4 1
endface


face 
vertices 2 1 0
shootthrough
endface
face 
vertices 3 2 0
shootthrough
endface
face 
vertices 4 3 0
shootthrough
endface
face 
vertices 1 4 0
shootthrough
endface
end
enddef

spawnPyr
position X Y 15
size  25 25 35
end 

I can't test it cause I'm on my solaris machine, but It SHOULD work.

User avatar
person1
Private First Class
Private First Class
Posts: 159
Joined: Wed Sep 14, 2005 3:44 am
Location: Omaha, Nebraska

Post by person1 » Fri Mar 17, 2006 3:20 am

if it doesn't work let me know.
Image
Image
I not just any person, I am person1

User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan » Fri Mar 17, 2006 3:35 am

This is a simple pyramid as I described with 4 sides, 20 meters x 20 meters base and 20 meters high. If you want to use this directly, you can scale your group instance of the object to suit. You can shoot and drive out of this pyramid, but not vice-versa.
Attachments
spawnpod.bzw
Mesh & Materials
(2.21 KiB) Downloaded 165 times
podoutside.jpg
Spawn Pod - Outside
(127.94 KiB) Downloaded 97 times
podinside.jpg
Spawn Pod - Inside
(128.16 KiB) Downloaded 94 times

Inferno
Private First Class
Private First Class
Posts: 91
Joined: Sat Jan 22, 2005 6:52 pm
Contact:

Post by Inferno » Fri Mar 17, 2006 3:37 am

I don't see why mine wouldn't work?

User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan » Fri Mar 17, 2006 3:59 am

Yours would work Inferno, with the following changes:

material
name PyrWalls
addtexture mesh.png
diffuse .75 .75 .75 .25
end


define spawnPyr
mesh
drivethrough
matref PyrWalls # added for transparency
vertex 0 0 1
vertex -1 -1 0
vertex -1 1 0
vertex 1 1 0
vertex 1 -1 0

face
vertices 0 1 2
shootthrough
endface
face
vertices 0 2 3
shootthrough
endface
face
vertices 0 3 4
shootthrough
endface
face
vertices 0 4 1
shootthrough
endface


face
vertices 2 1 0
#shootthrough (removed)
endface
face
vertices 3 2 0
#shootthrough (removed)
endface
face
vertices 4 3 0
#shootthrough (removed)
endface
face
vertices 1 4 0
#shootthrough (removed)
endface
end
enddef

group spawnPyr
position X Y 15
size 25 25 35
end

User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3249
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe » Fri Mar 17, 2006 2:00 pm

Thank you guys so much! I used the last post (Inferno's and Louman's coding) and it works great.

Do you want a -srvmsg with credit in my map?

Inferno
Private First Class
Private First Class
Posts: 91
Joined: Sat Jan 22, 2005 6:52 pm
Contact:

Post by Inferno » Fri Mar 17, 2006 7:10 pm

thanks Louman, I dreamed it up in my head and had to make a few guesses and couldn't test 'em :oops: :oops: .


Ducati, sure :D . I think thumper has his own -srvmsg for his servers though

Post Reply