Dusty Posted October 5, 2012 Posted October 5, 2012 Now, I'm sure this is possible, one way or another. Just not sure how. I wan't to make a menu cvar in SP that does this:Everytime the menu is shown it will display a different piece of text for this menu item. I want to use it for loading screens to display gameplay tips to players. Now I'm guessing it'd need to be a cycle command. I'm imagining I could set it up like this. cvartest "gameplaytip"Cvarstringlist{"MENUS@TIP1" "set gameplaytip MENUS@TIP2""MENUS@TIP2" "set gameplaytip MENUS@TIP3""MENUS@TIP3" "set gameplaytip MENUS@TIP4"} But I don't think it'll be that simple. Just looking for some guidance.
therfiles Posted October 5, 2012 Posted October 5, 2012 Hmmm...the concept is interesting. The only way I could see it working is to have a cycle of tips. There is no way that I have found that chooses a random value for a cvar. Try making some cfgs that do the following: set the current tip and set the next tip cfg. Have the menu exec the cfg so it displays the tip and is given the exec to load next time. Maybe on menu open put an exec line. Granted, this is all hyperthetical considering it is a loading menu, which may act differently than other menus, like it's ability to exec and such. Also, use the command 'seta' so it writes the current and next tip to the jasp config file, so you don't get the same tip over and over. Also be sure to include an error tip just in case the whole thing fails.
Szico VII Posted October 6, 2012 Posted October 6, 2012 You could use an animmap with several levelshots each containing a different message - it'd just mean creating like 10 levelshots or so for each map. Something like this: levelshots/mymapname { { animmap 0.25 levelshots/mymapname_1 levelshots/mymapname_2 levelshots/mymapname_3 levelshots/mymapname_4 } }
Raz0r Posted October 6, 2012 Posted October 6, 2012 Main issue with animated shaders in loading screens is the renderer doesn't update the display when assets are being loaded. EDIT: And the cvarStrList approach is awesome. therfiles is on the right track with a vstr/cycle therfiles likes this
Dusty Posted October 6, 2012 Author Posted October 6, 2012 I got it. I had to set it up like this. (Top of Loadscreen menu file):~onClose{exec "vstr tipcyclenext"} and then, cvar gameplaytipcvarFloatList (cvarstrlist didn't want to work){"First tip." "0""Second tip." "1"} Then I had a config file:vstr tip1seta tip1 "gameplaytip 0; set vstr tipcyclenext vstr tip2"seta tip2 "gameplaytip 1; set vstr tipcyclenext vstr tip1" Now it cycles between first tip and second tip each time I pass through the loading screen. Now I just need to add more tips B)
therfiles Posted October 6, 2012 Posted October 6, 2012 Good work, dusty! Main issue with animated shaders in loading screens is the renderer doesn't update the display when assets are being loaded. I though that's what MB2 used for their mod, the blue and red loading screens? Or was that something else?
Raz0r Posted October 7, 2012 Posted October 7, 2012 I think they do use animmap shaders, but the screen does not update very fast at all (not even 1 frame/sec)You have to time it right, and you can only really fit 2-3 textures in that time.I suppose if you had a very slow computer, you'd see the first screen again?Or maybe MB2 swap the texture used via code. Either is possible, and the code method is more reliable. therfiles likes this
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