Page 1 of 1

Making a meshbox shoot through on only one side

Posted: Thu Mar 16, 2006 1:10 pm
by ducatiwannabe
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?

Posted: Thu Mar 16, 2006 2:24 pm
by Winny
o wow I was just going to post this same kind of topic, guess Ill wait :E

Posted: Thu Mar 16, 2006 2:45 pm
by temporal distraction
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.

Posted: Thu Mar 16, 2006 2:57 pm
by person1
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.

Posted: Thu Mar 16, 2006 3:22 pm
by ducatiwannabe
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.

Posted: Thu Mar 16, 2006 3:42 pm
by ducatiwannabe
Ok, I have my mesh, but how do I make it shoot out but not in? Screenshot attatched.

Image

Posted: Thu Mar 16, 2006 3:45 pm
by Winny
you could just make it drive through.


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

Posted: Thu Mar 16, 2006 4:51 pm
by ducatiwannabe
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.

Posted: Thu Mar 16, 2006 8:27 pm
by JPT
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 ;)

Posted: Thu Mar 16, 2006 9:02 pm
by ducatiwannabe
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.

Posted: Thu Mar 16, 2006 9:16 pm
by LouMan
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)

Posted: Fri Mar 17, 2006 12:09 am
by Inferno
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]

Posted: Fri Mar 17, 2006 12:15 am
by ducatiwannabe
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.

Posted: Fri Mar 17, 2006 12:48 am
by Inferno
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.

Posted: Fri Mar 17, 2006 3:20 am
by person1
if it doesn't work let me know.

Posted: Fri Mar 17, 2006 3:35 am
by LouMan
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.

Posted: Fri Mar 17, 2006 3:37 am
by Inferno
I don't see why mine wouldn't work?

Posted: Fri Mar 17, 2006 3:59 am
by LouMan
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

Posted: Fri Mar 17, 2006 2:00 pm
by ducatiwannabe
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?

Posted: Fri Mar 17, 2006 7:10 pm
by Inferno
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