[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - transition - time in menu.dat

transition - time in menu.dat

Discuss CSQC related programming.

Moderator: InsideQC Admins

transition - time in menu.dat

Postby Nahuel » Mon Oct 09, 2017 6:56 pm

My objective is to add some small animations in a menu. dat
It would be just an image transition (like an introduction) before the menu is drawn. Just a couple of images in fade-out and fade-in, using alpha values for the transition.

This would be very simple to do using "time value" in csqc, ypou know, some drawpic + frametime in CSQC_UpdateView. But I can't figure out how I could use time on menu. dat.
There is something like CSQC_UpdateView in menu.dat? I can use something similar to frametime in menu.dat?
Is there any way to code -for example- this: an image displayed for a second, and then becomes transparent. ?????

How can I use time in the. dat menu without using any external data (such as ssqc time)???


I am using darkplaces :)
Any clue is appreciated, thanks :)
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: transition - time in menu.dat

Postby pitchatan » Tue Oct 10, 2017 1:12 pm

pitchatan
 
Posts: 31
Joined: Sun Aug 10, 2008 6:54 pm
Location: sweden

Re: transition - time in menu.dat

Postby Spike » Tue Oct 10, 2017 2:12 pm

float animtime = (time - starttime) * FRAMESPERSECOND;
float frame = floor(animtime);
float alphavalue = animtime-frame; //sawtooth. will reset to 0 any time it would reach 1.0
drawpic(xy, imageforframe(frame), sz, rgb, 1.0, 0); //alpha should be 1-alphavalue if you're using additive alpha.
drawpic(xy, imageforframe(frame+1), sz, rgb, alphavalue, 0);

be sure to check for frame overflows. you'll probably want to just end your animation then. or loop. whatever. your choice.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: transition - time in menu.dat

Postby Nahuel » Tue Oct 10, 2017 7:05 pm

Thank you guys!
it works like a charm :)

Is it necessary that I reset the time to 0 after some time?
Because I fear that after a few minutes I might be using "numbers" too high (given by get time).

Could there really be a problem with this? Because gettime doesn't seem to stop at any time (even when the client connects to the game) Should I reset gettime at some point? is this possible?

Would it be problematic if someone were playing for example 24 hours and gettime continued? what is its limit?

Thank you again :)
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata


Return to CSQC Programming

Who is online

Users browsing this forum: No registered users and 1 guest