[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/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 - Traceline color to particle color?

Traceline color to particle color?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Traceline color to particle color?

Postby Mexicouger » Thu Apr 11, 2013 5:26 pm

Is it possible to get a color using a traceline, and spawn a particle with effectinfo.txt using that traced color? I know there is a bulitiin in Darkplaces to get a pixel color from a traceline, but I'm not sure if that data can be passed over to a particle in effectinfo.txt
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Re: Traceline color to particle color?

Postby Nahuel » Thu Apr 11, 2013 7:17 pm

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: Traceline color to particle color?

Postby Mexicouger » Thu Apr 11, 2013 7:59 pm

say there's a dirt texture and you want to get the color of that dirt and turn that color into a particle effect in real time. is that possible?
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Re: Traceline color to particle color?

Postby frag.machine » Thu Apr 11, 2013 10:37 pm

Reading the corresponding I'd say it's very unlikely you can redefine effectinfo.txt on-the-fly. But I may be wrong...
EDIT: OTOH, You could define 16 similar particle effects, changing only the color range to match every color row in Quake default palette, and select which one is used based on what the pixel check returns. At least you wouldn't have brown particles when hitting a blue/red/yellow/green texture.
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

Re: Traceline color to particle color?

Postby Seven » Fri Apr 12, 2013 11:40 am

Hello Mexicouger,

I also think that it is not possible to detect a color in the world and "create" a matching effect via effectinfo.

You COULD do it this way (because you use DP and can therefore also use other dpextensions):
Nahuel did this once in one of his amazing mods.
And also footsteps sound can be done this way to get different sounds according the texture you are walking on.
This is something Moon[drunk] was working on, but as far as I know didnt finish it (yet).

Detect the texture you are shooting at, via
DP_QC_GETSURFACE

Then (depending on how many textures you use in your maps) make checks accordingly and spawn an already existing effect with the color of texture.
Be aware that you can create hundreds effects in your effectinfo, there seems to be no limit.


Example:
When your texture-check results in "city1_4" then you would spawn effectnum "middle_brown"
("middle_brown" is declared in your effectinfo.txt)

For many Quake textures you can use similar effectnums, because they share almost the same color.
This means a quite big one-time-effort in creating the texture-checks (depending on how many you use in your maps),
but in the end it might work as you want.

Good luck,
Seven

PS: If this is not what you asked for, then I am sorry. I also have issues with english sometimes... :)
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: Traceline color to particle color?

Postby ceriux » Fri Apr 12, 2013 3:43 pm

use frikfile to over write the .txt file?
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Traceline color to particle color?

Postby Mexicouger » Fri Apr 12, 2013 4:47 pm

User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Re: Traceline color to particle color?

Postby leileilol » Fri Apr 12, 2013 9:44 pm

If I did this in Engoo i'd probably try to sample the average color for every texture loaded (at load time), and keep that averaged color as part of the mips themselves.
SiN did something similar in which it remapped little gunshot debris chunk models with the texture iself.
Last edited by leileilol on Fri Apr 12, 2013 9:45 pm, edited 2 times in total.
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Traceline color to particle color?

Postby frag.machine » Fri Apr 12, 2013 9:44 pm

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

Re: Traceline color to particle color?

Postby ceriux » Fri Apr 12, 2013 11:54 pm

cant frikfile also load files? but im sure ur right...
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Traceline color to particle color?

Postby frag.machine » Sat Apr 13, 2013 4:40 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 1 guest