Out not in door things

Questions and answers about the how and why of making maps.
Post Reply
User avatar
Gears of War
Private First Class
Private First Class
Posts: 9
Joined: Sun Nov 18, 2007 2:36 pm

Out not in door things

Post 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 :?:
Rock You Like a Hurricane!
Help Me build My City
Here
Im not stupid, everyone else is just smarter than me
If electricity comes from electrons, does morality come from morons?
Whoever says that nothing is impossible obviously hasn't tried to slam a revolving door...
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

Post 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)
User avatar
Tedius
Sergeant First Class
Sergeant First Class
Posts: 142
Joined: Tue Sep 19, 2006 6:10 pm
Contact:

Post 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.
this signature intentionally left blank
User avatar
Gears of War
Private First Class
Private First Class
Posts: 9
Joined: Sun Nov 18, 2007 2:36 pm

Post 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?
Rock You Like a Hurricane!
Help Me build My City
Here
Im not stupid, everyone else is just smarter than me
If electricity comes from electrons, does morality come from morons?
Whoever says that nothing is impossible obviously hasn't tried to slam a revolving door...
Legolas_
Private First Class
Private First Class
Posts: 513
Joined: Thu Jan 20, 2005 10:24 pm

Post 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.
User avatar
Gears of War
Private First Class
Private First Class
Posts: 9
Joined: Sun Nov 18, 2007 2:36 pm

Post by Gears of War »

thats what i tried...ill try again
Rock You Like a Hurricane!
Help Me build My City
Here
Im not stupid, everyone else is just smarter than me
If electricity comes from electrons, does morality come from morons?
Whoever says that nothing is impossible obviously hasn't tried to slam a revolving door...
User avatar
Gears of War
Private First Class
Private First Class
Posts: 9
Joined: Sun Nov 18, 2007 2:36 pm

Post by Gears of War »

didnt work...
Rock You Like a Hurricane!
Help Me build My City
Here
Im not stupid, everyone else is just smarter than me
If electricity comes from electrons, does morality come from morons?
Whoever says that nothing is impossible obviously hasn't tried to slam a revolving door...
Legolas_
Private First Class
Private First Class
Posts: 513
Joined: Thu Jan 20, 2005 10:24 pm

Post 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.
User avatar
Gears of War
Private First Class
Private First Class
Posts: 9
Joined: Sun Nov 18, 2007 2:36 pm

Post 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
Rock You Like a Hurricane!
Help Me build My City
Here
Im not stupid, everyone else is just smarter than me
If electricity comes from electrons, does morality come from morons?
Whoever says that nothing is impossible obviously hasn't tried to slam a revolving door...
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Post 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.
"Life is what happens to you while you're busy making other plans." - John Lennon
Legolas_
Private First Class
Private First Class
Posts: 513
Joined: Thu Jan 20, 2005 10:24 pm

Post 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.
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

Post 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.
User avatar
Gears of War
Private First Class
Private First Class
Posts: 9
Joined: Sun Nov 18, 2007 2:36 pm

Post 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
Rock You Like a Hurricane!
Help Me build My City
Here
Im not stupid, everyone else is just smarter than me
If electricity comes from electrons, does morality come from morons?
Whoever says that nothing is impossible obviously hasn't tried to slam a revolving door...
User avatar
enrico123
Private First Class
Private First Class
Posts: 91
Joined: Tue Jul 14, 2009 10:49 am
Contact:

Re: Out not in door things

Post by enrico123 »

i have copied the mesh code to my map but it isnt working
"See a need fill a need"-(Bigweld from the movie "Robots")
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Out not in door things

Post 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. ;)
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
User avatar
enrico123
Private First Class
Private First Class
Posts: 91
Joined: Tue Jul 14, 2009 10:49 am
Contact:

Re: Out not in door things

Post by enrico123 »

the mesh does not appear on my map
"See a need fill a need"-(Bigweld from the movie "Robots")
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Out not in door things

Post 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?
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
User avatar
enrico123
Private First Class
Private First Class
Posts: 91
Joined: Tue Jul 14, 2009 10:49 am
Contact:

Re: Out not in door things

Post by enrico123 »

i have got it know but i need to spin it and i cant.
"See a need fill a need"-(Bigweld from the movie "Robots")
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Out not in door things

Post by joevano »

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

Do you mean rotate? Because spinning objects that interact with tanks are not possible.
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
User avatar
enrico123
Private First Class
Private First Class
Posts: 91
Joined: Tue Jul 14, 2009 10:49 am
Contact:

Re: Out not in door things

Post by enrico123 »

no its just facing the wrong way
"See a need fill a need"-(Bigweld from the movie "Robots")
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Out not in door things

Post 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.
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Out not in door things

Post 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.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
Post Reply