command map shaders


(badong) #1

I followed the sticky on how to write shaders for the command map icons so they don’t appear outside the compass in etpro. The problem is that now the icons don’t show up in the command map anymore, but they show up fine in the compass. Anyone know why this is happening?
(These are custom icons by the way.)


(Loffy) #2

Yeah, I wonder why. I have the same problem: The icons look fine with no shader. Add the shader and the icons are gone from command map but they show up in the compass.
Makes me want to toss away the shader. But will the icons look alright on etproservers? Well, I hope we can sort this out.
// Loffy


(Loffy) #3

Ok, I got it to work. But Im not sure if it is the right way. All I did was to add “.tga” after the shadername.

Old shader, that is recommended.


gfx/ge_bunker/cm_door2
{
   nopicmip
   nocompress
   nomipmaps
   {
      map gfx/ge_bunker/cm_door2.tga
      depthfunc equal
      blendfunc blend
      rgbGen vertex
      alphaGen vertex
   }
}

This is my new shader, that works (at the moment!)


gfx/ge_bunker/cm_door2.tga // .tga is added here.
{
   nopicmip
   nocompress
   nomipmaps
   {
      map gfx/ge_bunker/cm_door2.tga
      depthfunc equal
      blendfunc blend
      rgbGen vertex
      alphaGen vertex
   }
}

Icons (such as my “cm_door2”) look fine both in command map and in compass. I hope there is nothing wrong with adding “.tga” after shadername like this. I dont think so… it should work.
// Loffy


(thore) #4

thx for pointing that out. i encountered the same prob, but didn’t dare to ask yet :smiley:

in radiant, the custom(axis/allied)image paths stay the same? no need to add .tga here?


(Loffy) #5

This is how I write the key/value:s for my trigger_objective_info:


"classname" "trigger_objective_info"
"customalliesimage" "gfx/limbo/cm_dynamite.tga"
"customaxisimage" "gfx/ge_bunker/cm_door2.tga "
"shortname" "Flag Door"
"track" "the Flag Door"
"spawnflags" "1"
"objflags" "4"
"target" "dynamiteobj1"
"targetname" "toi_dynamiteobj1"
"scriptname" "toi_dynamiteobj1"

And cm_door2.tga is a custom icon that I made.
// Loffy


(badong) #6

After searching in the etrpo forums and a few hours of testing I figured this thing out. The sticky thread is wrong.
You cannot have the shader for your custom command map icons in the same pk3 as your map. If you do your icons will not be visible in servers running etmain or shrub.
You need to write a separate shader and put it on a separate pk3.(shader file names and shader names are completely up to you.)
Then the new pk3 has to go on the etpro folder in your game directory not in etmain otherwise your icons will again dissapear. This way the custom icon shaders will only be loaded when you play on servers running etpro.

@loffy I doubt your method will work. I’m pretty sure the .tga extension in your toi customimage field is just stripped off and so the game is just loading your image directly and not using the shader at all. Try it with a shader name different from the texture name and see if it still works.


(Loffy) #7

Lets go back to the original problem: custom icons appear outside of compass if the map is featured on a etpro-server. There are two things to do, if I interpret you right:
1, leave it (no shader, just leave it and accept the fact that the icons will be visible outside the compass). The custom icons will be visible in servers running etmain, etpro and shrub.
2, write a shader, e.g.:

 
gfx/ge_bunker/cm_door2 
{ 
   nopicmip 
   nocompress 
   nomipmaps 
   { 
      map gfx/ge_bunker/cm_door2.tga 
      depthfunc equal 
      blendfunc blend 
      rgbGen vertex 
      alphaGen vertex 
   } 
} 

and put that shader in a separate pk3. (Thus creating two pk3:s).
Am I right?
// Loffy


(badong) #8

Yes…basically here’s what you do.
Write a shader for your command icons like the one you’ve posted.
Put the shader file in a scripts directory and put the whole thing in a separate pk3(something like mymap_etpro_icons.pk3 for example). Basically this second pk3 has inside it only a directory called scripts which has the shader file in it.
Have the users download the separate pk3 in their etpro directory. It’s very important that the separate pk3 is placed in the etpro directory and not etmain so that it’s only loaded when etpro is run. If it’s placed in etmain it will always be loaded which means your icons will not be visible on etmain or shrub.

To tell you the truth I don’t get why the etpro people changed this whole thing. Seems to me like the “visual glitch” it fixes was not a problem at all to begin with. They caused a lot more problems with all the custom maps having their objectives outside the compass and now requiring 2 pk3’s for every map.


(]UBC[ McNite) #9

Is this problem still immanent with etpro 3.1?
Just asking cuz I m doing a map these days and use a lot of custom command map images… it would be an incredible BS if they really screwed it up like this.
I can but hope guys on etpro are already working on a fix for this (is it only me or does is seem like with every release of etpro they get more bugs into the game than they fix with it?)