RecklessJames Posted February 17, 2018 Posted February 17, 2018 Hey there! I know that theres a way to set multiple random loading screens (unknownmap) since I've seen this done before in ForceMod III and a few other modpacks here and there. I'd like to figure out how to achieve such a thing with my own content but not quite sure how to approach it since I'm still new to this. Also I can't find any available source code that uses this so I can't see how it was done. For example, I found this under ui_main but not sure how to set it for multiple random images: /* ================= Menu_Cache ================= */ void Menu_Cache( void ) { uis.cursor = ui.R_RegisterShaderNoMip( "menu/new/crosshairb" ); uis.whiteShader = ui.R_RegisterShader( "white" ); uis.menuBackShader = ui.R_RegisterShaderNoMip( "menu/art/unknownmap" ); }And this under cg_info: { levelshot = cgi_R_RegisterShaderNoMip( va( "levelshots/%s", s ) ); #ifndef FINAL_BUILD if (!levelshot && !strncmp(s, "work/",5) ) { levelshot = cgi_R_RegisterShaderNoMip( va( "levelshots/%s", s+5 ) ); } #endif if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip( "menu/art/unknownmap" ); } }I've seen other strings of code that can randomize sound effects, NPC spawning, and other things... but for menu related things I'm not too sure. I'd appreciate any ideas or tips! :3
Noodle Posted February 17, 2018 Posted February 17, 2018 I don't know much about coding, but it'd seem you just need to add more "or" conditions to this part of the code. Would love to see how that works since it seems like it could be a basic thing to learn. if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip( "menu/art/unknownmap" ); }
RecklessJames Posted February 18, 2018 Author Posted February 18, 2018 Ah okay! Well I tried this code in cg_info and sadly it did not work: { levelshot = cgi_R_RegisterShaderNoMip( va( "levelshots/%s", s ) ); #ifndef FINAL_BUILD if (!levelshot && !strncmp(s, "work/",5) ) { levelshot = cgi_R_RegisterShaderNoMip( va( "levelshots/%s", s+5 ) ); } #endif if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip( "menu/art/unknownmap" ); } else if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip( "menu/art/unknownmap0" ); } else if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip( "menu/art/unknownmap1" ); } else if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip( "menu/art/unknownmap2" ); } else if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip( "menu/art/unknownmap3" ); } else if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip( "menu/art/unknownmap4" ); } }I'm sure theres something more that needs to be done or something different, and perhaps more than just one file that needs to be edited.
Exmirai Posted March 2, 2018 Posted March 2, 2018 You wrote wrong code. You need to get the list of all pictures and then show on screen picture which is get by randomizing number. Something like this.P.S: code may not work as i wrote it from phone and wasn't coding for a long time https://slexy.org/view/s2P7pdBown
JaceSolarisVIII Posted March 2, 2018 Posted March 2, 2018 Hey there! I know that theres a way to set multiple random loading screens (unknownmap) since I've seen this done before in ForceMod III and a few other modpacks here and there. I'd like to figure out how to achieve such a thing with my own content but not quite sure how to approach it since I'm still new to this. Also I can't find any available source code that uses this so I can't see how it was done. For example, I found this under ui_main but not sure how to set it for multiple random images: /* ================= Menu_Cache ================= */ void Menu_Cache( void ) { uis.cursor = ui.R_RegisterShaderNoMip( "menu/new/crosshairb" ); uis.whiteShader = ui.R_RegisterShader( "white" ); uis.menuBackShader = ui.R_RegisterShaderNoMip( "menu/art/unknownmap" ); }And this under cg_info: { levelshot = cgi_R_RegisterShaderNoMip( va( "levelshots/%s", s ) ); #ifndef FINAL_BUILD if (!levelshot && !strncmp(s, "work/",5) ) { levelshot = cgi_R_RegisterShaderNoMip( va( "levelshots/%s", s+5 ) ); } #endif if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip( "menu/art/unknownmap" ); } }I've seen other strings of code that can randomize sound effects, NPC spawning, and other things... but for menu related things I'm not too sure. I'd appreciate any ideas or tips! :3 Try this. void CG_DrawInformation( void ) { int y; // draw the dialog background const char *info = CG_ConfigString( CS_SERVERINFO ); const char *s = Info_ValueForKey( info, "mapname" ); qhandle_t levelshot; qhandle_t levelshot2; extern SavedGameJustLoaded_e g_eSavedGameJustLoaded; // hack! (hey, it's the last week of coding, ok? levelshot = cgi_R_RegisterShaderNoMip(va("levelshots/%s", s)); levelshot2 = cgi_R_RegisterShaderNoMip(va("levelshots/%s2", s)); if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip("menu/art/unknownmap"); } if (!levelshot2) { levelshot2 = cgi_R_RegisterShaderNoMip("menu/art/unknownmap_mp"); } if ( g_eSavedGameJustLoaded != eFULL && !strcmp(s,"yavin1"))//special case for first map! { char text[1024] = { 0 }; CG_DrawPic(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, levelshot); cgi_SP_GetStringTextString("SP_INGAME_ALONGTIME", text, sizeof(text)); int w = cgi_R_Font_StrLenPixels(text, cgs.media.qhFontMedium, 1.0f); cgi_R_Font_DrawString((320) - (w / 2), 140, text, colorTable[CT_ICON_BLUE], cgs.media.qhFontMedium, -1, 1.0f); } else if (cg.loadLCARSStage >= 4) { CG_DrawPic(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, levelshot2); } else { CG_DrawLoadingScreen(levelshot, s); cgi_UI_MenuPaintAll(); } CG_LoadBar(); // draw info string information y = 20; // map-specific message (long map name) s = CG_ConfigString( CS_MESSAGE ); if ( s[0] ) { if (s[0] == '@') { char text[1024]={0}; cgi_SP_GetStringTextString( s+1, text, sizeof(text) ); cgi_R_Font_DrawString( 15, y, va("\"%s\"",text),colorTable[CT_WHITE],cgs.media.qhFontMedium, -1, 1.0f ); } else { cgi_R_Font_DrawString( 15, y, va("\"%s\"",s),colorTable[CT_WHITE],cgs.media.qhFontMedium, -1, 1.0f ); } y += 20; } }
RecklessJames Posted March 2, 2018 Author Posted March 2, 2018 Try this. void CG_DrawInformation( void ) { int y; // draw the dialog background const char *info = CG_ConfigString( CS_SERVERINFO ); const char *s = Info_ValueForKey( info, "mapname" ); qhandle_t levelshot; qhandle_t levelshot2; extern SavedGameJustLoaded_e g_eSavedGameJustLoaded; // hack! (hey, it's the last week of coding, ok? levelshot = cgi_R_RegisterShaderNoMip(va("levelshots/%s", s)); levelshot2 = cgi_R_RegisterShaderNoMip(va("levelshots/%s2", s)); if (!levelshot) { levelshot = cgi_R_RegisterShaderNoMip("menu/art/unknownmap"); } if (!levelshot2) { levelshot2 = cgi_R_RegisterShaderNoMip("menu/art/unknownmap_mp"); } if ( g_eSavedGameJustLoaded != eFULL && !strcmp(s,"yavin1"))//special case for first map! { char text[1024] = { 0 }; CG_DrawPic(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, levelshot); cgi_SP_GetStringTextString("SP_INGAME_ALONGTIME", text, sizeof(text)); int w = cgi_R_Font_StrLenPixels(text, cgs.media.qhFontMedium, 1.0f); cgi_R_Font_DrawString((320) - (w / 2), 140, text, colorTable[CT_ICON_BLUE], cgs.media.qhFontMedium, -1, 1.0f); } else if (cg.loadLCARSStage >= 4) { CG_DrawPic(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, levelshot2); } else { CG_DrawLoadingScreen(levelshot, s); cgi_UI_MenuPaintAll(); } CG_LoadBar(); // draw info string information y = 20; // map-specific message (long map name) s = CG_ConfigString( CS_MESSAGE ); if ( s[0] ) { if (s[0] == '@') { char text[1024]={0}; cgi_SP_GetStringTextString( s+1, text, sizeof(text) ); cgi_R_Font_DrawString( 15, y, va("\"%s\"",text),colorTable[CT_WHITE],cgs.media.qhFontMedium, -1, 1.0f ); } else { cgi_R_Font_DrawString( 15, y, va("\"%s\"",s),colorTable[CT_WHITE],cgs.media.qhFontMedium, -1, 1.0f ); } y += 20; } } WHAT THE F*CK IS HAPPENING TO MY COMPUTER???
TheWhitePhoenix Posted March 2, 2018 Posted March 2, 2018 WHAT THE F*CK IS HAPPENING TO MY COMPUTER???Is...everything all right?
RecklessJames Posted March 2, 2018 Author Posted March 2, 2018 lol sorry i was just kidding, i havent tested it yet lmao
JaceSolarisVIII Posted March 2, 2018 Posted March 2, 2018 Please don't try code above xd Why? lol sorry i was just kidding, i havent tested it yet lmao And? did you try it yet?
RecklessJames Posted March 2, 2018 Author Posted March 2, 2018 And? did you try it yet?No not yet, I was busy with school related activities.
RecklessJames Posted March 2, 2018 Author Posted March 2, 2018 @@JaceSolarisVIII Hmm, okay it almost works! It changes the level thumbnail screen, but not the loading screen before it which is what I had meant. Also it changes while it was loading. What I had in mind was that it would show something different each time during the loading screen. aka this screen:
RecklessJames Posted March 3, 2018 Author Posted March 3, 2018 FINALLY! I got it to work! The issue was that it was ui_main.cpp that I was supposed to be editing, not cg_info at all!For specifically the loading screens to be random, I had to change this: /* ================= Menu_Cache ================= */ void Menu_Cache( void ) { uis.cursor = ui.R_RegisterShaderNoMip( "menu/new/crosshairb" ); uis.whiteShader = ui.R_RegisterShader( "white" ); uis.menuBackShader = ui.R_RegisterShaderNoMip( "menu/art/unknownmap" ); }To this: /* ================= Menu_Cache ================= */ void Menu_Cache( void ) { uis.cursor = ui.R_RegisterShaderNoMip( "menu/new/crosshairb" ); uis.whiteShader = ui.R_RegisterShader( "white" ); uis.menuBackShader = ui.R_RegisterShaderNoMip(va("menu/art/jasp/load%d", Q_irand(0, 20))); }@JaceSolarisVIII @Exmirai @Noodle Thanks for the help, regardless! :3 Plus now this can be used by others who are interested! (directory names and number of images may vary, of course)
RAILBACK Posted March 7, 2018 Posted March 7, 2018 Do you mean splash screens? You can get more than one to load by using this shader: levelshots/mod{ { map $lightmap } { map textures/mod/your.jpg blendFunc GL_DST_COLOR GL_ZERO } { map textures/mod/your_title.jpg blendFunc GL_ONE GL_ONE animMap 0.5 textures/mod/your1.jpg textures/mod/your2.jpg textures/mod/your3.jpg ... png .. tga etc. }
RecklessJames Posted March 8, 2018 Author Posted March 8, 2018 Do you mean splash screens? You can get more than one to load by using this shader: levelshots/mod{ { map $lightmap } { map textures/mod/your.jpg blendFunc GL_DST_COLOR GL_ZERO } { map textures/mod/your_title.jpg blendFunc GL_ONE GL_ONE animMap 0.5 textures/mod/your1.jpg textures/mod/your2.jpg textures/mod/your3.jpg ... png .. tga etc. } Oh I see! I'll try this as well and see what happens.
RecklessJames Posted March 10, 2018 Author Posted March 10, 2018 @RAILBACK Okay I got the time to look into this and...... I have no idea what to put as directories lol. Did you mean something like this? levelshots/mod { { map $lightmap } { map menu/art/jasp/load.jpg blendFunc GL_DST_COLOR GL_ZERO } { map menu/art/jasp/load.jpg blendFunc GL_ONE GL_ONE animMap 0.5 menu/art/jasp/load00.jpg menu/art/jasp/load01.jpg menu/art/jasp/load02.jpg menu/art/jasp/load03.jpg menu/art/jasp/load04.jpg menu/art/jasp/load05.jpg } }Cause it didn't do anything.
UniqueOne Posted March 21, 2018 Posted March 21, 2018 In Warzone I did it like this. This shows the original map's image for a moment, if there is one, then switches between random images each 10 seconds during loading. This is for MP, but it should work in SP too I think. RecklessJames and GPChannel like this
Tempust85 Posted March 27, 2018 Posted March 27, 2018 You don't need lightmap stage, and you can delete the stage after it, leaving just the animMap stage. RecklessJames likes this
RecklessJames Posted March 31, 2018 Author Posted March 31, 2018 Ah I see, interesting... I'll try that at some point :3 Smoo likes this
Apprentice Posted April 1, 2018 Posted April 1, 2018 Do you mean splash screens? You can get more than one to load by using this shader: levelshots/mod { { map $lightmap } { map textures/mod/your.jpg blendFunc GL_DST_COLOR GL_ZERO } { map textures/mod/your_title.jpg blendFunc GL_ONE GL_ONE animMap 0.5 textures/mod/your1.jpg textures/mod/your2.jpg textures/mod/your3.jpg ... png .. tga etc. }I was thinking the same. Probably would be simpler to do it with shaders then coding the thing. All of my Elite Force and Jedi Academy maps have this feature, altough I notice that not all images are shown when the map is being loaded (delay). What happens if people don't use this 'feature' and stick with only one levelshot ??
RAILBACK Posted April 2, 2018 Posted April 2, 2018 @RAILBACK Okay I got the time to look into this and...... I have no idea what to put as directories lol. Did you mean something like this? levelshots/mod { { map $lightmap } { map menu/art/jasp/load.jpg blendFunc GL_DST_COLOR GL_ZERO } { map menu/art/jasp/load.jpg blendFunc GL_ONE GL_ONE animMap 0.5 menu/art/jasp/load00.jpg menu/art/jasp/load01.jpg menu/art/jasp/load02.jpg menu/art/jasp/load03.jpg menu/art/jasp/load04.jpg menu/art/jasp/load05.jpg } }Cause it didn't do anything.map_menu isnt a default quake directory, thats why.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now