[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/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 - [SOLVED][FTE]Retrieve entity shader in CSQC

[SOLVED][FTE]Retrieve entity shader in CSQC

Discuss CSQC related programming.

Moderator: InsideQC Admins

[SOLVED][FTE]Retrieve entity shader in CSQC

Postby toneddu2000 » Fri Nov 15, 2019 4:31 pm

Last edited by toneddu2000 on Sat Nov 16, 2019 12:41 pm, edited 1 time in total.
- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: [FTE]Retrieve entity shader in CSQC

Postby Shpuld » Sat Nov 16, 2019 10:15 am

Considering that it's possible for an entity to be using multiple shaders, this sounds like a difficult thing to achieve. I'd approach the problem by maybe having custom fields where you can manually set the "default" shader for that entity, or just have default shaders for different types of entities stored in constants or something, might not be applicable for your case though.

What I would like to see would be being able to remove forced shader without having to actually know the originals, the engine should already know it.


EDIT: Actually that seems to work, if you do self.forceshader = 0; it seems to use the original shader again
User avatar
Shpuld
 
Posts: 104
Joined: Sat Feb 13, 2010 1:48 pm

Re: [FTE]Retrieve entity shader in CSQC

Postby toneddu2000 » Sat Nov 16, 2019 10:31 am

self.forceshader = 0; works like a charm, even on multi material entitities! incredible, it was so simple!

thanks a lot Shpuld, you saved me LOTS of head-walls interaction! :mrgreen:
- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: [SOLVED][FTE]Retrieve entity shader in CSQC

Postby Spike » Sat Nov 16, 2019 4:35 pm

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

Re: [SOLVED][FTE]Retrieve entity shader in CSQC

Postby toneddu2000 » Sat Nov 16, 2019 10:56 pm

thanks Spike for the explanation, but still I don't understand how skin format is structured, could you please post a .skin example? And which name should I use? I saw that SteelStorm (2011, Darkplaces engine) uses the format foo.dpm_0.skin. Steel Storm used dpm model format, but it's the same. Is it right the nomenclature?

Thanks
- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: [SOLVED][FTE]Retrieve entity shader in CSQC

Postby Spike » Sun Nov 17, 2019 12:25 am

you pasted it yourself, loadcustomskin's documentation specifies the accepted .skin file lines (ie: replace "surfacename" "replacementmaterial" one line per surface you want to override).
Also, use those optional args (and give an empy skinfilename) to avoid using actual files, generate that data at runtime if you want.

the foo.iqm_0.skin etc files are automatically parsed by the model loader (in both fte and dp) by just concatenating it onto the end of the model's name, and thus are limited to just replacements. Its probably worth noting that many model formats(md3/iqm/dpm) don't support numbered skins (like those used for progs/armor.mdl) but this gives you a way to define them without any extra code.
Steelstorm is a viable example I suppose, Xonotic also has a number of similar overrides.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: [SOLVED][FTE]Retrieve entity shader in CSQC

Postby toneddu2000 » Mon Nov 18, 2019 11:01 pm

Yeah, thanks Spike I only tried the foo.iqm_0.skin replacement, probably that's why it didn't work. I'll try to use custom skin and see if it works, I'll try also optional args to create skins on the fly
Thanks both for you help!
- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy


Return to CSQC Programming

Who is online

Users browsing this forum: No registered users and 1 guest