Jump up boxes

Questions and answers about the how and why of making maps.
Post Reply
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Jump up boxes

Post by diing for the team »

What sort of editing do I have to do to a box to make it so you can jump up but wont fall down
Image
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

Like the platforms in boxy wars
Image
User avatar
mrapple
Sergeant Major
Sergeant Major
Posts: 460
Joined: Wed May 27, 2009 11:59 am
Location: Unknown
Contact:

Re: Jump up boxes

Post by mrapple »

Its called a one way mesh. Use the mesh below and experiment with different textures on faces / drivethrough on faces.

Code: Select all

mesh
      position 0 0 10
      size 10 10 1
      vertex -1 -1 0
      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
      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
         drivethrough   # bottom face
      endface
      face
         vertices 4 5 6 7
      endface
end
Image
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

Should I make the side faces drivethrough too?
Image
User avatar
Cobra_Fast
Dev Monkey
Dev Monkey
Posts: 322
Joined: Sat Oct 07, 2006 11:51 am
Location: Germany
Contact:

Re: Jump up boxes

Post by Cobra_Fast »

thats personal choice. whether you want it to be passable from the sides or not ...
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

I put in the code and I think I did it correctly but it doesn't show up when i test the map. I am testing the map in 3.0.0 alpha if that could be the problem.

Code: Select all

mesh
	name mesh1
      position 250 140 9
      size 20 150 1
      vertex 270 215 10
      vertex 270 215 9
      vertex 230 215 10
      vertex 230 215 9
      vertex 230 65 10
      vertex 230 65 9
      vertex 270 65 10
      vertex 270 65 9
      face
         vertices 1 2 4 3
      endface
      face
         vertices 1 2 8 7
      endface
      face
         vertices 3 4 6 5
      endface
      face
         vertices 5 6 8 7
      endface
      face
         vertices 8 6 4 2
         drivethrough   # bottom face
      endface
      face
         vertices 1 3 7 5
      endface
end
Image
User avatar
Runic
Private First Class
Private First Class
Posts: 23
Joined: Fri Jul 02, 2004 8:51 pm

Re: Jump up boxes

Post by Runic »

2.99/3.0 is not the problem here

first remove "position" and "size" as these do not belong inside a mesh object

second add a matref to the mesh, so you can see the faces your defining

finally, recheck you vertices and faces as I don't think you've got what you are expecting
BZFlag ROCKS!!!
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

it is not that I can't see them its that it is nonexistant
Image
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

I found out that the issue was when you shift it it shifts by number of meshes not in meters
Image
dango
Private First Class
Private First Class
Posts: 1400
Joined: Sun Feb 06, 2005 5:40 pm
Location: Somewhere over there.

Re: Jump up boxes

Post by dango »

Vertices start at 0, not 1. So your mesh won't work. Downshift all your numbers by one and it should show up.
Image
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

alright I have it all food but why can't I see the drive through sides even when I have a matref set
Image
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Jump up boxes

Post by blast »

Maybe if you showed us the updated code...?
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

don't mind the sixes. It was 5/3 that I needed but bzflag wasn't accepting the fraction.

Code: Select all

mesh
      shift 

1.6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666

666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666

666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666

666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666

666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 

7 9
      scale 150 20 1
      vertex -1 -1 0
      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
	 matref red
      endface
      face
         vertices 1 2 6 5
	 matref red
      endface
      face
         vertices 2 3 7 6
	 matref red
      endface
      face
         vertices 3 0 4 7
	 matref red
      endface
      face
         vertices 0 1 2 3
         drivethrough   # bottom face
	 matref roof
      endface
      face
         vertices 4 5 6 7
	 matref roof
      endface
end
Image
dango
Private First Class
Private First Class
Posts: 1400
Joined: Sun Feb 06, 2005 5:40 pm
Location: Somewhere over there.

Re: Jump up boxes

Post by dango »

You most likely have the vertices for the bottom face backwards (Currently you made a mesh face facing upwards, not down)
Image
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

theres a difference?
Image
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Jump up boxes

Post by joevano »

Yes, meshes are one sided. They only exist when viewing them from one side, from the otherside there is nothing there.
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
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

boxy didn't seem to have an issue like this though. can you explain why?
Image
User avatar
Runic
Private First Class
Private First Class
Posts: 23
Joined: Fri Jul 02, 2004 8:51 pm

Re: Jump up boxes

Post by Runic »

try

A) reversing the order of the bottom face vertices 3 2 1 0 (changes the winding direction)

or

B) adding normals to the mesh

Code: Select all

material
  name red
  diffuse 1.0 0.0 0.0 1.0
end

material
  name roof
  diffuse 0.3 0.3 0.3 1.0
end

define obj_1
mesh
  vertex -1 -1 0
  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
  normal 
  face
    vertices 0 1 5 4
    matref red
  endface
  face
    vertices 1 2 6 5
    matref red
  endface
  face
    vertices 2 3 7 6
    matref red
  endface
  face
    vertices 3 0 4 7
    matref red
  endface
  face
    vertices 3 2 1 0
    drivethrough   # bottom face
    matref roof
  endface
  face
    vertices 4 5 6 7
    matref roof
  endface
end
enddef

group obj_1  
  scale 150 20 1
  shift 1.667 7 9
end

group obj_1  
  scale 150 20 1
  shift -200 7 9
end

BZFlag ROCKS!!!
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

so runic what did u do in that code? I like using the shift in the mesh kinda. what is this normal and its i reverse the order of the bottom won't the invisible spot be on top then?
Image
User avatar
Runic
Private First Class
Private First Class
Posts: 23
Joined: Fri Jul 02, 2004 8:51 pm

Re: Jump up boxes

Post by Runic »

I like using define and group sorry

Yes it would then be invisible from above, but not the top face it would be visible as only the bottom face was flipped

every vertex used in the face can also reference a 3D normal, think of it as a pointer or direction the face is facing.
but you don't have to use them

bzflag will guess which way the face is facing based on it's winding direction
BZFlag ROCKS!!!
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

I figured it out thank you guys. I added another face under the bottom one. Thanks for telling me :)
Image
User avatar
mrapple
Sergeant Major
Sergeant Major
Posts: 460
Joined: Wed May 27, 2009 11:59 am
Location: Unknown
Contact:

Re: Jump up boxes

Post by mrapple »

Just want to clarify one thing
Runic wrote:first remove "position" and "size" as these do not belong inside a mesh object
Actually, they do.

Scale and Shift are the preffered method of moving and changing meshes but position and size work too :)
Image
User avatar
Runic
Private First Class
Private First Class
Posts: 23
Joined: Fri Jul 02, 2004 8:51 pm

Re: Jump up boxes

Post by Runic »

if they work for you, then fine, but i don't see "position" and "size" listed as part of the mesh object in the bzw man page or the Mesh wiki page
BZFlag ROCKS!!!
diing for the team
Private First Class
Private First Class
Posts: 113
Joined: Sun Dec 02, 2007 8:21 pm

Re: Jump up boxes

Post by diing for the team »

Runic wrote:if they work for you, then fine, but i don't see "position" and "size" listed as part of the mesh object in the bzw man page or the Mesh wiki page
it is nto an attribute for mesh and it came up as an error on mine but I had other stuff wrong when I was trying it too so those might have also messed it up
Image
Post Reply