Transparency, rotation, and material issues

Questions and answers about the how and why of making maps.
Post Reply
User avatar
anarchogeek
Private First Class
Private First Class
Posts: 36
Joined: Fri Jan 07, 2005 9:09 pm

Transparency, rotation, and material issues

Post by anarchogeek » Sun Feb 20, 2005 1:23 am

I have several map issues. I have recently been designing a C++ library for making BZFlag maps, and have encountered these problems in the raw code output. I was wondernig if anyone could give me clues to what I might be leaving out or messing up.

A) The spinning disks (on the other side of the big white drivethrough Arc wall) apparently do not have the center or rotation in the correct spot, but I can't see the error.

B) The big white drivethrough Arc walls are supposed to be transparent. I have absolutely no idea how I messed up on this one, but they aren't.

C) BZFS claims that the material "matcarouselRoof" cannot be found, but I can see it defined rights above it.

Any help would be greatly appreciated.

-Happy Tanker
Attachments
map.bzw
(2.58 KiB) Downloaded 335 times

User avatar
RPG
Lieutenant, Junior Grade
Lieutenant, Junior Grade
Posts: 2015
Joined: Fri Sep 17, 2004 2:37 am
Location: Chicago, Illinois
Contact:

Post by RPG » Sun Feb 20, 2005 1:41 am

B) To make the arc transparent, you have to define the transparency in the material object, and not the arc object. That means move color 1 1 1 .5 from underneath arc to underneath material. It works that way.

C) Try replacing matref matcarouselRoof with matref matcarouselWalls (EDIT: in your arc object), since they are the same texture. It seemed to work for me.

Good luck! Inform us when you finish!
Last edited by RPG on Sun Feb 20, 2005 2:28 am, edited 1 time in total.

trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Post by trepan » Sun Feb 20, 2005 2:01 am

B) move your "color" keyword under the "matref" keyword.
using "matref" copies all the properties from the named
material into the curent object. you can change properties
within the object after the "matref". Order matters.
(you could also stick the transparency into a material block,
as RPG sugested)

C) you can't have 2 identical named materials. the CVS
version of bzfs will complain about this fact, I don't believe
that the 2.0.0 does.

User avatar
RPG
Lieutenant, Junior Grade
Lieutenant, Junior Grade
Posts: 2015
Joined: Fri Sep 17, 2004 2:37 am
Location: Chicago, Illinois
Contact:

Post by RPG » Sun Feb 20, 2005 2:30 am

Ooops I didn't describe the change in C) correctly, you could change matref matcarouselRoof to matref matcarouselWalls in the arc object, not rename material matcarouselRoof to matref matcarouselWalls

User avatar
anarchogeek
Private First Class
Private First Class
Posts: 36
Joined: Fri Jan 07, 2005 9:09 pm

Post by anarchogeek » Sun Feb 20, 2005 5:03 am

Thanks for all the help. All colors are now set to go into "materials", rather then into the objects themselves. I also set the walls and roof to use the same material, which cleared up that issue.

However, I would like to know why it told me that the texture didn't exist, so that I don't cause that problem again by accident.

Legolas_
Private First Class
Private First Class
Posts: 513
Joined: Thu Jan 20, 2005 10:24 pm

well..

Post by Legolas_ » Sun Feb 20, 2005 7:06 am

That has happened to me too.. I could never figure out why it happened.

User avatar
RPG
Lieutenant, Junior Grade
Lieutenant, Junior Grade
Posts: 2015
Joined: Fri Sep 17, 2004 2:37 am
Location: Chicago, Illinois
Contact:

Post by RPG » Sun Feb 20, 2005 5:32 pm

My guess about it is that since matcarouselWalls and matcarouselRoof contained the same texture, mesh, somewhere BZFS got confused and misreported matcarouselRoof, because it came second in the map file.

User avatar
anarchogeek
Private First Class
Private First Class
Posts: 36
Joined: Fri Jan 07, 2005 9:09 pm

Post by anarchogeek » Sun Feb 20, 2005 8:43 pm

OK. I've completely redone my material method. I now use the number instead of the names, and make sure to do it in the right order, but NOW I get this message:

Code: Select all

couldn't find reference material: 12 bottom
C:\Documents and Settings\Alexander Peppe\My Documents\Visual Studio Projects\Ne
twork Messenger\bzmap\map.bzw: warning (line 307): unknown object parameter "top
" - skipping
couldn't find reference material: 12 outside
C:\Documents and Settings\Alexander Peppe\My Documents\Visual Studio Projects\Ne
twork Messenger\bzmap\map.bzw: warning (line 308): unknown object parameter "ins
ide" - skipping
couldn't find reference material: 12 endside
C:\Documents and Settings\Alexander Peppe\My Documents\Visual Studio Projects\Ne
twork Messenger\bzmap\map.bzw: warning (line 309): unknown object parameter "sta
rtside" - skipping
couldn't find reference material: 13 bottom
C:\Documents and Settings\Alexander Peppe\My Documents\Visual Studio Projects\Ne
twork Messenger\bzmap\map.bzw: warning (line 330): unknown object parameter "top
" - skipping
couldn't find reference material: 13 outside
C:\Documents and Settings\Alexander Peppe\My Documents\Visual Studio Projects\Ne
twork Messenger\bzmap\map.bzw: warning (line 331): unknown object parameter "ins
ide" - skipping
couldn't find reference material: 13 endside
C:\Documents and Settings\Alexander Peppe\My Documents\Visual Studio Projects\Ne
twork Messenger\bzmap\map.bzw: warning (line 332): unknown object parameter "sta
rtside" - skipping
couldn't find reference material: 14 bottom
C:\Documents and Settings\Alexander Peppe\My Documents\Visual Studio Projects\Ne
twork Messenger\bzmap\map.bzw: warning (line 347): unknown object parameter "top
" - skipping
Once again, I include the map that turns up these errors. For reference, I'm using the BZFS 2.0 released on 1/17, and am on a Windows machine.

-Happy Tanker

User avatar
RPG
Lieutenant, Junior Grade
Lieutenant, Junior Grade
Posts: 2015
Joined: Fri Sep 17, 2004 2:37 am
Location: Chicago, Illinois
Contact:

Post by RPG » Mon Feb 21, 2005 12:09 am

Uh... all your material tags follow this format:

material
texture mesh
color 1 1 1 0.5
end

And none of them have names. You still need the names 8).

Also, it reports some of your errors being on lines 307-309. There is no content of the sort on those lines. Did you attach the right map file?

User avatar
anarchogeek
Private First Class
Private First Class
Posts: 36
Joined: Fri Jan 07, 2005 9:09 pm

Post by anarchogeek » Mon Feb 21, 2005 4:48 am

Looking at Trepan's various maps, adding a name isn't necessary...

Code: Select all

material
  diffuse 0.3 0.9 0.3 1
  addtexture wall
end

material
  addtexture boxwall
end

material
  addtexture wall
end

material
  diffuse 0.1 0.1 0.1 1
  addtexture roof
end
He then refers to them using the following format..

Code: Select all

  arc
    position 275 -275 0
    size 100 100 8
    rotation 45
    angle 360
    ratio 1
    divisions 4
    texsize -8 -8 -8 -8
    top matref 23
    bottom matref 23
    inside matref 24
    outside matref 24
    startside matref 25
    endside matref 25
    phydrv nojumping
    flatshading
  end
  arc
    position 275 -275 8
    size 5 5 4
    rotation 0
    angle 360
    ratio 1
    divisions 20
    texsize 2 1 1 1
    top matref 26
    bottom matref 26
    inside matref 26
    outside matref 27
    startside matref 26
    endside matref 26
  end
With the numbers representing (I think) the order in which they were created, starting with 0 for the first texture (I gather). I've cleaned up the map code to make the difficulty more obvious. I've also included Trepan's physics map, and a file containing the entire error output when I try to run mine.
Attachments
map.bzw
(6.43 KiB) Downloaded 304 times
physics.bzw
(14.1 KiB) Downloaded 325 times
error.txt
(3.96 KiB) Downloaded 316 times

User avatar
Valoche
Private First Class
Private First Class
Posts: 69
Joined: Fri Dec 20, 2002 5:39 pm
Location: France/Grenoble

Post by Valoche » Mon Feb 21, 2005 3:39 pm

A name, indeed, isn't necessary.
But it's far more easy to reference textures with a name rather than with a number. Just use names, your maps will be easier to make and modify.

Valoche

User avatar
anarchogeek
Private First Class
Private First Class
Posts: 36
Joined: Fri Jan 07, 2005 9:09 pm

Post by anarchogeek » Mon Feb 21, 2005 5:59 pm

Valoche wrote:A name, indeed, isn't necessary.
But it's far more easy to reference textures with a name rather than with a number. Just use names, your maps will be easier to make and modify.

Valoche
Yes, but I'm doing it with C++. indexNum++ is much easier than giving things a unique name.

Also, I did it. The issue: the materials had the same contents. Trepan mentioned this above, though apparently I didn't comprehend. Now, to me, I don't think that that should be an issue. But that's what it was. If you notice, the errors start when you get to the carousel materials, which all are the same. Anyway, issue cleared up.

Thanks for all the help!

User avatar
RPG
Lieutenant, Junior Grade
Lieutenant, Junior Grade
Posts: 2015
Joined: Fri Sep 17, 2004 2:37 am
Location: Chicago, Illinois
Contact:

Post by RPG » Mon Feb 21, 2005 7:51 pm

You did it?

Can we have it?

User avatar
Valoche
Private First Class
Private First Class
Posts: 69
Joined: Fri Dec 20, 2002 5:39 pm
Location: France/Grenoble

Post by Valoche » Mon Feb 21, 2005 11:14 pm

Can't you use texture_names[indexNum++ ]? Uh? :wink:

Post Reply