[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/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/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/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/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 - 3 moderate QuakeC questions

3 moderate QuakeC questions

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

3 moderate QuakeC questions

Postby Baker » Thu Aug 21, 2008 4:30 am

User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby CocoT » Thu Aug 21, 2008 5:22 am

Okay, I'm a pretty goofy coder and my ways are often not the most direct ones and/or the ones more experienced coders would recommend, but here is still my two cents...

1 - You coul have a .wav file (it'll have to be shortish and not of the highest quality, otherwise it's going to be too big to precache, though) be played either in replacement of a environment sound or (the way I usually do it), just create a new, invisible entity which will play it throughout the level (something like "sound (self, CHAN_VOICE, "misc/yoursound.wav", 1, ATTN_NONE);" - I think) in loops of a time you'll preset (through nextthink). That way your music could also be heard in engines others than DP. This is how I did it in Quakability Bot Arena (and its first public, infamous "dance tracks" version :))

2 -Here, too, there might be less roundabout way to do it, but what I usually do is create a "dummy" entity in the level to which I assign various values in the map editor, then, in QuakeC, I add something like "if (self.tempyourvalue == 1) yourvalue = 1" if I want to make these values global. Again, this is maybe a ridiculous way to do it, but it works :P

3 - Can't help you there...
- New location: Update your bookmarks!
User avatar
CocoT
 
Posts: 695
Joined: Tue Dec 14, 2004 5:39 pm
Location: Belly-Gum

Postby Lardarse » Thu Aug 21, 2008 8:44 am

3: .gravity

Originally added to the engine in 1.07 (for the hipnotic missionpack), it allows an entity to feel gravity at a modified level. setting it to 2 will mean twice the gravity (1600), between 0 and 1 will make it be low gravity (0.125 for a mini Ziggurat Vertigo), below 0 may make it float upwards (untested). 0 acts as being 1, so it's impossible to make something not affected by gravity at all, but this allows you ignore it completely if you don't need to set it for some (or all) entities. Just add .float gravity; at the bottom of defs.qc

All custom engines support this, as they are all derived from the original engine source release (which I beleive was 1.10)

2: create a field for it

Say you want to check for a keypair... something like "price_of_beer" "200". What you need to do is add the declaration .float price_of_beer; in the usual place, and then in worldspawn() have something like if(self.price_of_beer > 250) bprint("Prices here are exhorbitant.\n");

A minor caveat is that if the keypair isn't defined, it will be set to 0, so you will need to find another way to let the QC know that it's happy hour...
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby Baker » Thu Aug 21, 2008 9:28 am

User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby negke » Thu Aug 21, 2008 12:44 pm

negke
 
Posts: 150
Joined: Wed Apr 16, 2008 5:53 pm

Postby CocoT » Thu Aug 21, 2008 2:13 pm

- New location: Update your bookmarks!
User avatar
CocoT
 
Posts: 695
Joined: Tue Dec 14, 2004 5:39 pm
Location: Belly-Gum

Postby frag.machine » Fri Aug 22, 2008 2:36 am

I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests