shader and mapscript

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Hunter
First Lieutenant
Posts: 212
Joined: Tue Dec 10, 2002 11:45 am

shader and mapscript

Post by Hunter »

Hi,
my map is nearly finished but a still have a few questions:

1) What is a shader?? How do I make that??
2) Can somebody give me an example of a TDM script ??

thx
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

To make a .shader file, use notepad or other word editing tools. Write your script, for example making a custom load screen:

yourmapname
{
nomipmaps
nopicmip
cull none
force32bit
surfaceparm nolightmap
{
map $whiteimage
}
{
clampMap textures/mohmenu/dmloading/yourmapname.tga
blendfunc gl_one_minus_src_alpha gl_src_alpha
}
}

Save it as yourmapname.shader. However, using notepad, the file will still appear as yourmapname.shader.txt (that's my computer, don't know about yours). Use a program to edit the file name from yourmapname.shader.txt to yourmapname.shader. I use ws_ftp (although for uploading files, it's useful for editing file names). You must take a screenshot (F12) and rename it to yourmapname.tga. Crop it to 512 by 512. I think I'll write a tutorial on custom load screens....
Innkeeper
Colonel
Posts: 475
Joined: Mon Nov 25, 2002 10:13 pm
Location: NC, USA (about 7.5 klicks from the capital dome)
Contact:

Post by Innkeeper »

mohaa_rox wrote:Save it as yourmapname.shader. However, using notepad, the file will still appear as yourmapname.shader.txt (that's my computer, don't know about yours). Use a program to edit the file name from yourmapname.shader.txt to yourmapname.shader. I use ws_ftp (although for uploading files, it's useful for editing file names). You must take a screenshot (F12) and rename it to yourmapname.tga. Crop it to 512 by 512. I think I'll write a tutorial on custom load screens....
If you put double quotes around the file name, notepad will save it exactly as written and will not give it the extension .txt.

Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

shader

Post by tltrude »

Shaders are found in the scripts folder of pak0.pk3. They tell the game how to use textures in the map. So for example, if you have a rock texture on a brush, it will sound like rock when a player runs across it and chunks of rock will fly off when it is shot.

You only need to make shader files if you are adding new textures to the game, or adding an opening screen image--which is what mohaa_rox is talking about.

For your script example, just open any of the dm scripts like mohdm1.scr in pak5.pk3/maps/dm.
Tom Trude,

Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

But my computer still displays yourmapname.shader.txt. I'm using Win 98, I think XP does that, but not Win 98.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Really? No wonder I couldn't do that. Thanks for the tip, Innkeeper.
Innkeeper
Colonel
Posts: 475
Joined: Mon Nov 25, 2002 10:13 pm
Location: NC, USA (about 7.5 klicks from the capital dome)
Contact:

Post by Innkeeper »

Hmmm.... I thought that worked in 95 & 98 as well... :oops: Sorry, its been a really long time since I have used either of those. My only other suggestion is to use a different editor. I have gotten to really like UltraEdit. You can set up syntax highlighting for file types that it doesn't already have. It greatly improves readability. Also it will save a file with any name you want without hassel. Check it out here: http://www.ultraedit.com/
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Don't worry, I posted a wrong thing. I didn't see the "" in the screenshot. Anyway, I tried it, and it worked. So thanks for the tip, Innkeeper.
Guest

Post by Guest »

You know, I was using the same base script and my picture would never load so I pasted my map path and name in place of the "map $whileimage" and then it would load. Can THAT be explained????
Post Reply