Jump to content

Finagling an interesting UI cvar for SP.


Recommended Posts

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.

Link to comment

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. ;)

Link to comment

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

Link to comment

I got it.

 

I had to set it up like this.

 

(Top of Loadscreen menu file):

~

onClose

{

exec "vstr tipcyclenext"

}

 

and then,

 

cvar gameplaytip

cvarFloatList (cvarstrlist didn't want to work)

{

"First tip." "0"

"Second tip." "1"

}

 

Then I had a config file:

vstr tip1

seta 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)

Link to comment

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
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...