[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 - CSQC - display an image

CSQC - display an image

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

CSQC - display an image

Postby ajay » Sat Aug 24, 2013 2:58 pm

Hello!
I'm at an early dipping-my-toe-in-the-water stage of CSQC awareness. I'm really haven't covered the basics of it at yet, but I am reading whatever I can find. Anyway, what I'm planning to achieve:
- At various points in the mod, and event, trigger etc., would cause an image to be displayed to the screen (while the game is functionally paused) the aim of which is to provide either pictorial or written information to the player; it's not a menu, and would need to be cleared and the game restarted after the player clicks mouse button 1 for example
- The image would clearly need to be different each time and be of a reasonably high res >= 800x600

That's it really, I'm reasonably sure that's all doable, my problem is the details of the how! Anyway, are there any code examples that I could read to get a handle on CSQC generally, and this kind of thing specifically?

Although I'm reading http://www.fteqw.com/wiki/index.php?title=EXT_CSQC code examples bring things to life a bit for me.
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Re: CSQC - display an image

Postby Spike » Sat Aug 24, 2013 4:03 pm

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: CSQC - display an image

Postby ajay » Sat Aug 24, 2013 5:07 pm

Thanks spike
Just covering some basics also and to save mysefl some time:
* for CSQC, are there any qc files you have to have, or is it only those custom ones you want?
* do you need a progs.src?
* I'm using fteqcc, to compile CSQC files, do I just run as normal and it will compile them separately into csprogs.dat when compiling ordinary qc progs.dat?
Cheers
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Re: CSQC - display an image

Postby Spike » Sat Aug 24, 2013 5:40 pm

There are no specific .qc files you must have (in fact, if your .src file starts with a preprocessor directive, you don't need any .qc files at all, though that's impractical when its large, but hey, #include to the rescue).
That said, you will need some equivelent of defs.qc to get the system defs+fields right, and so the compiler knows what the builtins are and their names and arguments and stuff.
The file I linked serves this purpose, and contains no actual logic itself, just defs.
DP specific:
DP requires that the following four functions are defined. I don't really know why. Any dp-specific csqc def listings will thus define them as not var etc, and the compiler will complain about them not being defined.
CSQC_Init
CSQC_InputEvent
CSQC_UpdateView
CSQC_ConsoleCommand
The file I linked should have correct definitions for these and will not result in errors if they are omitted as fte has no issues with them missing (although skipping CSQC_UpdateView would defeat the point of most csqc mods).
InputEvent and ConsoleCommand can be implemented as stubs by just returning false. Init can simply contain nothing. UpdateView requires something like the code I already wrote in my previous post, just without the drawpic call obscuring the screen.

To compile both a csprogs.dat and a progs.dat, you need to run the compiler twice, with two separate foo.src files. As far as the qcc is concerned, there's no difference between the two (any warnings about crcs are purely cosmetic, and are in an attempt to warn about people who acidentilly changed the top of defs.qc or whatever).
menu.src is a third form of src file that you might have.

With FTEQCC, you can put '#pragma sourcefile csprogs.src' in your ssqc's defs.qc file or somewhere if you want. this will get fteqcc to attempt to compile from csprogs.src after it has finished compiling from progs.src (automatically restarting compiling with an alternative source file).
Personally I tend to have all the src files as $mod/src/*.src with the common qc files in the same dir, and the module-specific qc files in an appropriate subdir (fte's built-in qcc can then be used via 'compile csprogs.src', woo). If you're invoking qcc via double-clicking it, having files NOT called exactly progs.src can be annoying, separate subdirectories can help with that, or you can just use that pragma.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: CSQC - display an image

Postby ajay » Sat Aug 24, 2013 7:18 pm

Thanks spike, much appreciated
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Re: CSQC - display an image

Postby ceriux » Sat Aug 24, 2013 8:09 pm

also these are all the sites iv been reading over when looking for information for csqc.

http://quakewiki.org/wiki/EXT_CSQC

http://www.quakewiki.net/darkplaces-wik ... de-quakec/

http://www.inside3d.com/showtutorial.php?id=245

http://quakeone.com/forums/quake-mod-re ... ars-3.html

http://quakeone.com/forums/quake-mod-re ... -csqc.html

a lot of these the csqc is a little off, but easily fixable. just look at your original defs.qc. some are just open source csqc mods. but all kinds of information and knowlege is available.
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: CSQC - display an image

Postby goldenboy » Sun Aug 25, 2013 8:54 am

https://gitorious.org/salvatrix/salvatr ... sqc_gui.qc

here's my current hud csqc. Pops up a GUI image when TAB is pressed, and tracks mouse cursor movements drawing a cursor image too.

http://www.youtube.com/watch?v=R37q2XDM18M

The qc is for FTE, hence it doesn't bother with those DP required functions. It uses a list of engine builtings dumped directly from the engine to compile, instead of a csqc defs.qc. My aim is to eradicate most of defs.qc.
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Re: CSQC - display an image

Postby ajay » Sun Aug 25, 2013 12:24 pm

Ceriux and goldenboy; that's marvellous, thank you. GB your hud is very close, in terms of displaying an image, to what I want, except it won't need to be so complex. You're both really helpful, thank you.
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Re: CSQC - display an image

Postby gnounc » Tue Aug 27, 2013 6:22 pm

viewtopic.php?f=2&t=5194

My tutorial and basic codebase.
my
gnounc's
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest