Image in bzw.

Questions and answers about the how and why of making maps.
Post Reply
User avatar
ducktape
Private First Class
Private First Class
Posts: 1206
Joined: Sat Jul 01, 2006 2:06 am
Location: Right Behind you!

Image in bzw.

Post by ducktape »

Hi there,

This is a Really n00by question i know so dont make it worse. I have uploaded a image into the bzflag image uploader thing but how do i get it from the uploaded image onto my map?

-ducktape
Image
User avatar
Teppic
Private First Class
Private First Class
Posts: 576
Joined: Mon Mar 07, 2005 10:00 pm
Location: The North Block

Post by Teppic »

material
name example_material
texture filename # set working texture
# - non-interlaced PNG
# - http:// or ftp:// hyperlinks can be used (no spaces)
# - BZFlag default texture names can be used (.png not required)
end


meshbox
("top" | "bottom" | "inside" | "outside" | "startside" | "endside") example_material (or)
matref example_material
end
User avatar
ducktape
Private First Class
Private First Class
Posts: 1206
Joined: Sat Jul 01, 2006 2:06 am
Location: Right Behind you!

Post by ducktape »

Do i need the

Code: Select all

 # - non-interlaced PNG 
part?

Where do i put the position part to put where i would like?

So far this is what i have:

Code: Select all

material
name xross_material
C:\Documents and Settings\Zachary\Desktop\image.png
# - non-interlaced PNG
# - http://images.bzflag.org/zrussell/ducktape_image.png
end


meshbox
("top" | "bottom" | "inside" | "outside" | "startside" | "endside") example_material (or)
matref example_material
end
Image
dango
Private First Class
Private First Class
Posts: 1400
Joined: Sun Feb 06, 2005 5:40 pm
Location: Somewhere over there.

Post by dango »

if # is at the begining of a line, it means that it is commented out, or it isn't included when defining the map. those are just there because teppic is saying bzflag doesn't use interlaced pngs? and that you can use the default textures without the png at the end, and that hyperlinks using http or ftp can be used. aka, no, you don't need them


also the (inside | outside | etc.) part is a choise, you chose one, or just do matref. i.e.:

Code: Select all

material
name meh
texture ftp://hypertexttransferproto.col/my/image.png
end

meshbox
name myuberbox
size infinity to the third
location everywhere
matref  top meh
end
^This would give an infinitly large square occupying everywhere, which my image on the top of it.^

or you can just do matref and the name to have the material on all sides
'inside' is the inside of a hollow arc
'outside' is the outside of an arc
'top' is the top
'bottom' is the bottom
'startside' is something else that i don't know
'endside' is another thing i don't know
Image
User avatar
ducktape
Private First Class
Private First Class
Posts: 1206
Joined: Sat Jul 01, 2006 2:06 am
Location: Right Behind you!

Post by ducktape »

Ok um I thought i got it right, but it shows the Meshbox just no image on it.

Here is what i have:

Code: Select all

material
name ducktape_image.png
texture http://images.bzflag.org/zrussell/ducktape_image.png
end

meshbox
name ducktape_image.png
size 10 1 5 
position 0 -10 20 
end
Image
User avatar
immunogoblin
Private First Class
Private First Class
Posts: 17
Joined: Tue Dec 25, 2007 7:24 pm

Post by immunogoblin »

I'm not a mapper, but it looks like you left out the "matref" line specifying the material that includes your image...
User avatar
macsforme
General
General
Posts: 2069
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme »

ducktape wrote:

Code: Select all

meshbox
name ducktape_image.png
size 10 1 5 
position 0 -10 20 
end
Change name to matref.
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

Post by F687/s »

Helpful links:

- The BZFlag Wiki
- The Material Page
- The Meshbox Page

These pages will also give you more information on how to do additional cool things, like apply colors to meshboxes, apply a texture to just one side of a meshbox, or alter the texture.
User avatar
ducktape
Private First Class
Private First Class
Posts: 1206
Joined: Sat Jul 01, 2006 2:06 am
Location: Right Behind you!

Post by ducktape »

Ok well i got it to work thanks everyone! But one more thing, How do i have the same image more then once on my map like i tryed to use the same one but i got a Error saying it cannot be duplicated. Do i have to submit the image 4 times if i want it on my map 4 times?
Image
User avatar
Joe-Schmoe
Private First Class
Private First Class
Posts: 192
Joined: Mon Jul 24, 2006 1:10 am
Location: This field unintentionally left blank.

Post by Joe-Schmoe »

You don't have to submit multiple times...what code did you use? I have never got that error message.
Join MI6!
dango
Private First Class
Private First Class
Posts: 1400
Joined: Sun Feb 06, 2005 5:40 pm
Location: Somewhere over there.

Post by dango »

you only write the material statement once
Image
User avatar
ducktape
Private First Class
Private First Class
Posts: 1206
Joined: Sat Jul 01, 2006 2:06 am
Location: Right Behind you!

Post by ducktape »

Ok is the material statement this part:

Code: Select all

material
name ducktape_image.png
texture http://images.bzflag.org/zrussell/ducktape_image.png
end 
if so i tried use it only once and it didnt work, Here is what i have:

Code: Select all

material
name ducktape_XrossCTF.png
texture http://images.bzflag.org/zrussell/ducktape_XrossCTF
end

meshbox
matref ducktape_XrossCTF.png
size 5 1 8    
position 0 10 10 
end

meshbox
matref ducktape_XrossCTF.png
size 1 5 8    
position 10 0 10 
end

meshbox
matref ducktape_XrossCTF.png
size 1 5 8    
position -10 0 10 
end

meshbox
matref ducktape_XrossCTF.png
size 5 1 8    
position 0 -10 10 
end
Image
CUPCAKE
Private First Class
Private First Class
Posts: 303
Joined: Sat Sep 30, 2006 2:31 pm

Post by CUPCAKE »

maybe take out the PNG in the name section?
Personally, I always put the "matref" after position and size, too
User avatar
ducktape
Private First Class
Private First Class
Posts: 1206
Joined: Sat Jul 01, 2006 2:06 am
Location: Right Behind you!

Post by ducktape »

The .png is need i think atleast it worked when i only wanted one image. And it works with "matref" where it is, I just cant get multiple images.
Image
User avatar
Winny
Grouchy
Grouchy
Posts: 2381
Joined: Wed Aug 24, 2005 12:27 am
Location: Ottawa eh?
Contact:

Post by Winny »

ducktape wrote:

Code: Select all

material
name ducktape_XrossCTF.png
texture http://images.bzflag.org/zrussell/ducktape_XrossCTF
end

meshbox
matref ducktape_XrossCTF.png
size 5 1 8    
position 0 10 10 
end

[...]

You forgot the .png at the end of the URL.
CUPCAKE
Private First Class
Private First Class
Posts: 303
Joined: Sat Sep 30, 2006 2:31 pm

Post by CUPCAKE »

Hmm, I recall reading in the wiki that you could leave out the png in the url... I've never really tried it, though.
And the .png is not "need" in the name section
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

Post by F687/s »

> Hmm, I recall reading in the wiki that you could leave out the png in the url... I've never really tried it, though.
> And the .png is not "need" in the name section


Yes, if you're speaking of a local texture in the client's data library. So...you could make a texture using caution.png this way....

Code: Select all

material
 name explosive
 texture caution
end
...but if you have it at your url, then you need to make it this way...

Code: Select all

material
 name explosice
 texture http://pwnz00r.h4x0r.bz/~r00t/caution.png
end
...with the .png safely intact.
User avatar
blast
General
General
Posts: 4933
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

Keep in mind that a map using local textures for 2.0.x won't work the same in 2.99.x/3.0.x, since the data directory has been reorganized for that version. It is still best to host all images at images.bzflag.org.
"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
Post Reply