Loadingscreens De-Mystified

Post your scripting questions / solutions here

Moderator: Moderators

EvilEdge
Lance Corporal
Posts: 10
Joined: Fri Feb 21, 2003 4:04 pm

Post by EvilEdge »

THANK YOU SO MUCH!! YOU ARE A GENIUS!! i got it to work
TheStorm
Captain
Posts: 233
Joined: Mon Oct 07, 2002 7:45 am
Location: Gavle, Sweden
Contact:

Post by TheStorm »

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.
TMT admin, visit www.modtheater.com
HITP Lead Mapper
Member of Electronic Arts MOHteam
7th Es Cyborg
First Lieutenant
Posts: 189
Joined: Fri Dec 13, 2002 5:00 pm
Location: PA
Contact:

Post by 7th Es Cyborg »

cool - i like the ingame idea - what texture do you use then for the start of the animation loop on the brush?
TheStorm
Captain
Posts: 233
Joined: Mon Oct 07, 2002 7:45 am
Location: Gavle, Sweden
Contact:

Post by TheStorm »

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.
TMT admin, visit www.modtheater.com
HITP Lead Mapper
Member of Electronic Arts MOHteam
Virus
Lance Corporal
Posts: 19
Joined: Wed Oct 01, 2003 2:42 am
Location: UK

Post by Virus »

Why dont you guys use the urc editor? .. its visual and you can place stuff where you want by clicking and dragging?
Voltaire
Corporal
Posts: 38
Joined: Sat Jun 28, 2003 6:20 am
Location: Coalgate, Oklahoma
Contact:

Post by Voltaire »

Where do you find the urc editor?

Voltaire
Now how do you do that?
Cobra {sfx}
First Lieutenant
Posts: 193
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

I made some new screens for a stock map for a mod i made - they load up fine on my network yet serverside ya dont see em ... any ideas?

Cobra
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

well,i can test it 4 u on my lan if the file is less than 4 mbs
Image
Cobra {sfx}
First Lieutenant
Posts: 193
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Doh! ive since removed em and continued upgrading the mod so ill need to start again with the pics/screen info shots.

file is around 1 meg, ill get the shots and be in touch m8 thanks for the offer.

Cobra

ps added ya on msn
unmonitrd
Lance Corporal
Posts: 14
Joined: Fri Dec 26, 2003 5:47 pm

Post by unmonitrd »

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

Code: Select all

textures/mohmenu/dmloading


and in the script I have

Code: Select all

setcvar "g_scoreboardpic" "scorepic"


but in tinkering around I also tried

Code: Select all

setcvar "g_scoreboardpic" "scorepic.tga"


and

Code: Select all

setcvar "g_scoreboardpic" "scorepic.jpg"


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
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

name

Post by tltrude »

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
Tom Trude,

Image
unmonitrd
Lance Corporal
Posts: 14
Joined: Fri Dec 26, 2003 5:47 pm

Post by unmonitrd »

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
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

Try making a simple shader for the picture, I think that might help.

I concur, .map is great! :)
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

shader

Post by tltrude »

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.
Tom Trude,

Image
unmonitrd
Lance Corporal
Posts: 14
Joined: Fri Dec 26, 2003 5:47 pm

Post by unmonitrd »

blue60007 wrote:Try making a simple shader for the picture, I think that might help.


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?

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
   }
}


Thanks again, couldn't have done it without .map!!!
-Unm
Post Reply