Page 1 of 1

Out not in door things

Posted: Thu Feb 14, 2008 1:47 am
by Gears of War
I was wondering how to make the doors that u can go through 1 side but cant go through the other side. Like the ones in Ducatiwannabe's Missle War 2.3. How :?:

Posted: Thu Feb 14, 2008 2:12 am
by F687/s
You would have to use a one-sided mesh. If you go to the Mesh wiki page, they have a sample box that you can use. Just make one face passable. Alternatively, paste this into your map (at the top) ONCE.

Code: Select all

define os
	mesh
		name osbox
		vertex -1 -1 0  #Sorry, Tedius... ;-)
		vertex 1 -1 0
		vertex 1 1 0
		vertex -1 1 0
		vertex -1 -1 1
		vertex 1 -1 1
		vertex 1 1 1
		vertex -1 1 1
		face
			vertices 0 1 5 4
			passable	# south face
		endface
		face
			vertices 1 2 6 5
		endface
		face
			vertices 2 3 7 6
		endface
		face
			vertices 3 0 4 7 
		endface
		face
			vertices 0 1 2 3
			passable	# bottom face
		endface
		face
			vertices 4 5 6 7
		endface
	end
enddef
And then you can use it like...

Code: Select all

group os
	scale 75.0 5.0 95.0
	shift -125.0 -205.0 5.0
end
The important thing to remember is that the south and bottom faces are passable, which means you need to rotate it to suit your needs. (The reason the bottom face is passable is so you can drive through it without getting stuck)

Posted: Thu Feb 14, 2008 4:36 am
by Tedius
F687/s wrote:

Code: Select all

define os
	mesh
		name osbox
		vertex -1 -1 0  #Sorry, Tedius... ;-)
		vertex 1 -1 0
Hey! I saw that.

Posted: Fri Feb 15, 2008 11:51 pm
by Gears of War
ok that helped but i tried to add a phydrv to it (linear 50 0 0) and it didnt work. know how to make it work?

Posted: Sat Feb 16, 2008 5:41 am
by Legolas_
Ok, there is a couple of things you should know. These can all be found at the wiki (http://my.bzflag.org/w/). First of all you must define the physics:

Code: Select all

#Horizontal physical driver moving 50 units/sec in the x-axis position:
physics
 name moving
 linear 50 0 0
end
Now that you have defined the driver you can call upon it later in the map. Take note, you must define the driver in the map before you have the mesh. Meaning, you can not have the mesh pasted into the map file above where the driver is defined.
So, your next step is to call upon the driver in your mesh. Taking F687/s's example you should have something like this:

Code: Select all


#Horizontal physical driver moving 50 units/sec in the x-axis position:
physics
 name moving
 linear 50 0 0
end

define os 
   mesh 
      name osbox 
      vertex -1 -1 0  #Sorry, Tedius... ;-) 
      vertex 1 -1 0 
      vertex 1 1 0 
      vertex -1 1 0 
      vertex -1 -1 1 
      vertex 1 -1 1 
      vertex 1 1 1 
      vertex -1 1 1 
      face 
         vertices 0 1 5 4 
         passable   # south face 
      endface 
      face 
         vertices 1 2 6 5 
      endface 
      face 
         vertices 2 3 7 6 
      endface 
      face 
         vertices 3 0 4 7 
      endface 
      face 
         vertices 0 1 2 3 
         passable   # bottom face 
      endface 
      face 
         vertices 4 5 6 7 
      endface 
   end 
enddef

group os 
   scale 75.0 5.0 95.0 
   shift -125.0 -205.0 5.0 
   phydrv moving
end
This is probably not the best way to apply this to the mesh, because it applies the driver to all faces of the mesh.

To read more about the physical driver object please read the wiki article (http://my.bzflag.org/w/Physics). All the information you need is there.

Posted: Sat Feb 16, 2008 9:59 pm
by Gears of War
thats what i tried...ill try again

Posted: Sat Feb 16, 2008 10:06 pm
by Gears of War
didnt work...

Posted: Sat Feb 16, 2008 10:45 pm
by Legolas_
Can you post some more details?

Did the map file load? Do you see any errors when starting your server?

You could also post the map file so we can take a look at it.

Posted: Mon Feb 18, 2008 7:41 pm
by Gears of War
the the map loaded and i could go through the one end and not the other but when i go on it i dont do anything...i dont go in the air or move at all

Posted: Mon Feb 18, 2008 7:58 pm
by Spazzy McGee
Gears of War wrote:the the map loaded and i could go through the one end and not the other but when i go on it i dont do anything...i dont go in the air or move at all
From that sentence (if you can call it that), I can deduce nothing much at all. In fact, it looks like it is working exactly as expected... "i could go through the one end and not the other".

Are you sure you're not expecting more than what the code actually supplies? I would ask you to refine your posts into a more structured form, so we can really deduce what's going on. Could you post the map file so we can see what you're experiencing?

Perhaps I should ask, how much of the code Legolas_ provided do you actually understand? I can tell you now, understanding how the code works is a big step towards trouble shooting yourself, and is a really really big help with your mapping in general.

Posted: Mon Feb 18, 2008 9:10 pm
by Legolas_
Spaz, after rereading his sentence a multitude of times I think I figured out what he is trying to say. I believe that he is having problems getting the physical drivers to work.

Gears of War, please *attach* the map file. That will allow us to examine the file and provide the needed corrections.

The physical driver uses three different numerical values.

Code: Select all

 linear 50 0 0 
The first number, 50, is the x value. This will make the tank move at a velocity of 50 units/second horizontally..

Now, if you want the tank to fly into the air you need to use the z value.

An example...

Code: Select all

physics 
 name trampoline
 linear 0 0 14 
end 
This will make the tank jump approx. 100 units into the air.

To calculate how high the tank will jump use this equation..

Code: Select all

Height = ( velocity ^ 2 ) / ( 2 * gravity )
Default gravity is 9.81, so in my example:
Height = ( 14 ^ 2 ) / ( 2 * 9.81 ) = 196 / 19.62 = ~ 100 units
However, before you begin you must figure out what you want the physical driver to do to the tank.

Posted: Mon Feb 18, 2008 9:16 pm
by F687/s
Wait: Do you want to attach a physics driver to the door so that when you enter it, you slide through the door automatically? If so, you will probably need to add another box under it with the physics driver attached to that.

Posted: Thu Feb 21, 2008 1:25 am
by Gears of War
no i want it to act like a trampoline
and i aslo want 1 side to be "drive through"

ill post my map i bit because im on a different computer than the one its on

Re: Out not in door things

Posted: Wed Aug 19, 2009 11:16 am
by enrico123
i have copied the mesh code to my map but it isnt working

Re: Out not in door things

Posted: Wed Aug 19, 2009 12:19 pm
by joevano
enrico123 wrote:i have copied the mesh code to my map but it isnt working
Wow great description. I would say that given the symptoms you specified as to WHY it is not working, I could say, without a doubt, that we have absolutely no idea. :D

What isn't working? Your map? The mesh? The drive through? Can you see the mesh? Is the mesh somewhere that it COULD be seen on the map (eg not inside a building or pyramid)? You see the issue, we cannot. We also cannot read minds (most of the time), though it seems most people looking for help assume we can. If you need help you need to provide us with as much information as possible. Then we will definitely make more helpful statements. ;)

Re: Out not in door things

Posted: Wed Aug 19, 2009 6:13 pm
by enrico123
the mesh does not appear on my map

Re: Out not in door things

Posted: Wed Aug 19, 2009 6:37 pm
by joevano
So you "define"d the mesh AND added the "group" statement? Did you copy and paste both parts, as they are both required (one creates the definition the other actually puts it on the map)? Is there something in the place where the mesh is that would hide it?

Re: Out not in door things

Posted: Thu Aug 20, 2009 9:13 am
by enrico123
i have got it know but i need to spin it and i cant.

Re: Out not in door things

Posted: Thu Aug 20, 2009 11:59 am
by joevano
http://my.bzflag.org/w/Group

Do you mean rotate? Because spinning objects that interact with tanks are not possible.

Re: Out not in door things

Posted: Fri Aug 21, 2009 10:15 am
by enrico123
no its just facing the wrong way

Re: Out not in door things

Posted: Fri Aug 21, 2009 12:01 pm
by joevano
Well, then you can rotate the group 180 degrees or modify the mesh faces that should and should not be pass-thru. You will be able to make it work either way with very little effort.

Re: Out not in door things

Posted: Sat Aug 22, 2009 3:24 am
by optic delusion
Here's what I think he wants to do... A box that's drive through on one side, but when you get inside it bounces you up. You can't do that.
Physics can not be applied to the BOTTOM face of a mesh. Even if one side is drivethrough, your still inside a solid object.
What he needs to do here is make a hollow box with no floor, think of a shoebox turned upside down. There is empty space inside the four walls. Put the physics on a seperate object inside the hollow box. Now the ceiling inside the box must also be drivethrough
This also makes the drivethrough wall very thin, which i think is a plus.