Loadingscreens De-Mystified
Moderator: Moderators
I can contribute with something else, if you want several pictures shown while loading the map you can make different shader. The below one will animate four pictures (jpg's). It will show each picture for one second.
thestormsloading //This shader are for jpg pictures
{
nomipmaps
nopicmip
cull none
force32bit
surfaceparm nolightmap
{
AnimMap 1 textures/mohmenu/dmloading/thestormload1.tga textures/mohmenu/dmloading/thestormload2.tga textures/mohmenu/dmloading/thestormload3.tga textures/mohmenu/dmloading/thestormload4.tga
}
}
(you should still use "tga" in the shader even if it's for jpg's)
AnimMap can be explained like this:
animMap <frequency> <texture1>.......<textureX>
Frequency: The number of times that the animation cycle will repeat within a one-second-time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed in fractional values
Texture1-x: The texturepath/texturename for each animation frame must be explicitly listed. Each frame is displayed for an equal subdivision of the frequency value. I don't know the limit of pictures for this, I have used up to 23 without problem.
I think it's best to use jpg's if you have several picture, they have less size then tga. The above will work with tga to but you have to add the blendfunction and stuff.
Ofcourse you can use this ingame too! to create animations.
thestormsloading //This shader are for jpg pictures
{
nomipmaps
nopicmip
cull none
force32bit
surfaceparm nolightmap
{
AnimMap 1 textures/mohmenu/dmloading/thestormload1.tga textures/mohmenu/dmloading/thestormload2.tga textures/mohmenu/dmloading/thestormload3.tga textures/mohmenu/dmloading/thestormload4.tga
}
}
(you should still use "tga" in the shader even if it's for jpg's)
AnimMap can be explained like this:
animMap <frequency> <texture1>.......<textureX>
Frequency: The number of times that the animation cycle will repeat within a one-second-time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed in fractional values
Texture1-x: The texturepath/texturename for each animation frame must be explicitly listed. Each frame is displayed for an equal subdivision of the frequency value. I don't know the limit of pictures for this, I have used up to 23 without problem.
I think it's best to use jpg's if you have several picture, they have less size then tga. The above will work with tga to but you have to add the blendfunction and stuff.
Ofcourse you can use this ingame too! to create animations.
-
7th Es Cyborg
- First Lieutenant
- Posts: 189
- Joined: Fri Dec 13, 2002 5:00 pm
- Location: PA
- Contact:
Hmm?? Depends on what name you give it in the shader. It's no different from other textures in mohradiant. You will find it in the texture menu and apply it to a brush side. But ingame it will animate between the pictures you have set up in the shader and at the speed you have set.
You can have a separate image for it in mohradiant!
Example
textures/custom/A_thestorm // This texture will be located in the folder "custom" under textures, the name will be A_thestorm
{
nomipmaps
nopicmip
cull none
force32bit
qer_editorimage textures/hud/Sparks0000.tga // This will be the picture that are show for it in mohradiant
surfaceparm nolightmap
{
animMap 48 textures/hud/Sparks0000.tga textures/hud/Sparks0001.tga textures/hud/Sparks0002.tga textures/hud/Sparks0003.tga textures/hud/Sparks0004.tga textures/hud/Sparks0005.tga textures/hud/Sparks0006.tga textures/hud/Sparks0007.tga textures/hud/Sparks0008.tga textures/hud/Sparks0009.tga textures/hud/Sparks0010.tga textures/hud/Sparks0011.tga textures/hud/Sparks0012.tga textures/hud/Sparks0013.tga textures/hud/Sparks0014.tga textures/hud/Sparks0015.tga textures/hud/Sparks0016.tga textures/hud/Sparks0017.tga textures/hud/Sparks0018.tga textures/hud/Sparks0019.tga textures/hud/Sparks0020.tga textures/hud/Sparks0021.tga textures/hud/Sparks0022.tga textures/hud/Sparks0023.tga // These are the textures that will be animated in game
rgbgen global
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}
Basically you should be able to copy this from the post, paste it in notpad and save it as a shader in the script folder. Then put it on a brush, compile and look at it in game. The sparks textures came with the game (spearhead I think) so try the map in spearhead. I can post a link to a working example when I get home from work.
You can have a separate image for it in mohradiant!
Example
textures/custom/A_thestorm // This texture will be located in the folder "custom" under textures, the name will be A_thestorm
{
nomipmaps
nopicmip
cull none
force32bit
qer_editorimage textures/hud/Sparks0000.tga // This will be the picture that are show for it in mohradiant
surfaceparm nolightmap
{
animMap 48 textures/hud/Sparks0000.tga textures/hud/Sparks0001.tga textures/hud/Sparks0002.tga textures/hud/Sparks0003.tga textures/hud/Sparks0004.tga textures/hud/Sparks0005.tga textures/hud/Sparks0006.tga textures/hud/Sparks0007.tga textures/hud/Sparks0008.tga textures/hud/Sparks0009.tga textures/hud/Sparks0010.tga textures/hud/Sparks0011.tga textures/hud/Sparks0012.tga textures/hud/Sparks0013.tga textures/hud/Sparks0014.tga textures/hud/Sparks0015.tga textures/hud/Sparks0016.tga textures/hud/Sparks0017.tga textures/hud/Sparks0018.tga textures/hud/Sparks0019.tga textures/hud/Sparks0020.tga textures/hud/Sparks0021.tga textures/hud/Sparks0022.tga textures/hud/Sparks0023.tga // These are the textures that will be animated in game
rgbgen global
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}
Basically you should be able to copy this from the post, paste it in notpad and save it as a shader in the script folder. Then put it on a brush, compile and look at it in game. The sparks textures came with the game (spearhead I think) so try the map in spearhead. I can post a link to a working example when I get home from work.
-
Cobra {sfx}
- First Lieutenant
- Posts: 193
- Joined: Tue Mar 23, 2004 10:25 pm
- Contact:
-
Cobra {sfx}
- First Lieutenant
- Posts: 193
- Joined: Tue Mar 23, 2004 10:25 pm
- Contact:
Amazingly I can get the main loading screen pic to work, but can't get the corner scoreboardpic to work.
I've tried several times as both a .tga, .tga with alpha, .jpg, and I've tried different sizes & picture qualities. I'd like to use the same 512x512 pic that is showing on my loading screen. I thought the scoreboardpic was supposed to be the easy part...not requiring shader work or anything.
I have placed the pic in
and in the script I have
but in tinkering around I also tried
and
depending on what format I made the file.
now I did the work in the .shader & ui to get this to show up in the load screen. Can anyone think of a reason why it would keep from using the pic in the scoreboard?
any help -- much appreciated,
-Unm
I've tried several times as both a .tga, .tga with alpha, .jpg, and I've tried different sizes & picture qualities. I'd like to use the same 512x512 pic that is showing on my loading screen. I thought the scoreboardpic was supposed to be the easy part...not requiring shader work or anything.
I have placed the pic in
Code: Select all
textures/mohmenu/dmloadingCode: Select all
setcvar "g_scoreboardpic" "scorepic"Code: Select all
setcvar "g_scoreboardpic" "scorepic.tga"Code: Select all
setcvar "g_scoreboardpic" "scorepic.jpg"now I did the work in the .shader & ui to get this to show up in the load screen. Can anyone think of a reason why it would keep from using the pic in the scoreboard?
any help -- much appreciated,
-Unm
name
It only needs the name without the extention. And, no path is needed as long as the image is in the dmloading folder.
setcvar "g_scoreboardpic" "scorepic"
I have never been able to use a jpg for it, but you can use your loading screen tga image. However, the alpha channel of that image might make it look tranparent, depending on how dark it is. The original game scoreboard images are in pak1.pk3, if you want to compare yours to them.
Also, scoreboard pictures are strange because they don't always show up the first time you hit tab. It might help to precache the image in your map's precache script.
cache textures/mohmenu/dmloading/scorepic.tga
setcvar "g_scoreboardpic" "scorepic"
I have never been able to use a jpg for it, but you can use your loading screen tga image. However, the alpha channel of that image might make it look tranparent, depending on how dark it is. The original game scoreboard images are in pak1.pk3, if you want to compare yours to them.
Also, scoreboard pictures are strange because they don't always show up the first time you hit tab. It might help to precache the image in your map's precache script.
cache textures/mohmenu/dmloading/scorepic.tga
Thanks. I'll try comparing to the other scoreboard pics, but I caught this advice in your previous posts & I'm sure I'm just screwing something up along the line here -- maybe if I step away & come back to try the whole thing from scratch.
As long as I've got you here though I figured I'd pass something along. This is my 8th post on this forum, but between you jv, scorpio midget, deadeye arrow, balr, bjarne, jackal and countless others on this forum - I've read thousands of your posts & your ideas (or variations on them) are staples in my maps now. I guess the reason I've posted in the single digits is because between the tuts & your responses, there's very few questions that a search couldn't answer...you guys cover it all it seems! (which is also why I'm pretty sure I'm just doing something wrong in the process here.) I'm a big fan & I would never be as into scripting & mapping without your guidance. I'm sure there's a whole mess of people that I can't remember, but you guys have been a great help.
Thanks
-Unm
As long as I've got you here though I figured I'd pass something along. This is my 8th post on this forum, but between you jv, scorpio midget, deadeye arrow, balr, bjarne, jackal and countless others on this forum - I've read thousands of your posts & your ideas (or variations on them) are staples in my maps now. I guess the reason I've posted in the single digits is because between the tuts & your responses, there's very few questions that a search couldn't answer...you guys cover it all it seems! (which is also why I'm pretty sure I'm just doing something wrong in the process here.) I'm a big fan & I would never be as into scripting & mapping without your guidance. I'm sure there's a whole mess of people that I can't remember, but you guys have been a great help.
Thanks
-Unm
shader
Good point blue60007, if you're going to use "scorepic" it needs a shader. It can be in the same shader file as the loading screen shader.
I figured it out on my own but I think u hit it right on the head! To use 2 different pictures I needed to make 2 shaders in the mapname.shader file in the scripts directory. I'm not real familiar with the terminology for load screens (I do mostly scripting), but that's what you're talking about right?blue60007 wrote:Try making a simple shader for the picture, I think that might help.
In case anyone else runs into the same problem, here's the contents of the 2 shaders in my .shader in the scripts folder.
Code: Select all
load_screen
{
nomipmaps
nopicmip
cull none
force32bit
surfaceparm nolightmap
{
map $whiteimage
}
{
clampMap textures/mohmenu/dmloading/load_screen.tga
blendfunc gl_one_minus_src_alpha gl_src_alpha
}
}
scoreboard_screen
{
nomipmaps
nopicmip
cull none
force32bit
surfaceparm nolightmap
{
map $whiteimage
}
{
clampMap textures/mohmenu/dmloading/scoreboard_screen.tga
blendfunc gl_one_minus_src_alpha gl_src_alpha
}
}
-Unm

