Raised This Month: $51 Target: $400
 12% 

[INFO] Fakemeta & Ham detailed function descriptions and examples


Post New Thread Reply   
 
Thread Tools Display Modes
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-11-2009 , 14:18   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #51

FakeMeta functions:
PHP Code:
EngFunc_TraceTextureDLLFunc_PM_FindTextureType 
Description:
The TraceTexture function detects the texture of an entity from a direction
The FindTextureType function allows to get the type of the material of the texture.

Parameters:
engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)
- ent is the entity that we want to get the texture
- start is the point from where the trace starts
- end is the point where the trace ends
- texture_name - here we save the texture name
- len - the texture_name string length
@Return
Nothing!

dllfunc(DLLFunc_PM_FindTextureType, texture_name)
- texture_name is the name of the texture that we have gotten with TraceTexture
@Return
It returns the material of the texture.


Constants:
The first function does not have any constants but if the name of the texture begins with '{' the texture is semi-transparent!

The letter constants are returned by the second function. "DLLFunc_PM_FindTextureType"
PHP Code:
/*
C : concrete        
D : dirt    
G : grate     
M : metal 
N : snow
P : computer    
S : slosh     
T : tile     
V : ventilation          
W : wood        
Y : glass
*/


new const material_array[] = 
{
    
'C''D''G''M''N''P''S''T''V''W''Y'


Usage:
PHP Code:
    new texture_name[64], texture_type
    engfunc
(EngFunc_TraceTexture0startendtexture_namecharsmax(texture_name))
    
texture_type dllfunc(DLLFunc_PM_FindTextureTypetexture_name
Notes:
- Improper use of these functions may crash the server!!!
- To avoid crashing the server use the TraceTexture:
-on any entities (even worldspawn) except players
-use this function only when there is at least one player connected
-the distance between the two points must be big! [> 2000.0]
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 09-11-2009 at 15:36.
ot_207 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-11-2009 , 14:41   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #52

You forget to say that the material returned is depending the materials.txt file. ( client ) So it's very limited. ( You forget N for Snow )
__________________

Last edited by Arkshine; 09-11-2009 at 14:44.
Arkshine is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-11-2009 , 14:42   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #53

Quote:
Originally Posted by Arkshine View Post
You forget to say that the material returned is depending the materials.txt file. ( client ) So it's very limited.
It depends on the server config.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-11-2009 , 15:02   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #54

What do you mean ?
__________________
Arkshine is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-11-2009 , 15:33   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #55

Quote:
Originally Posted by Arkshine View Post
What do you mean ?
I mean that every map has its own set of textures and every texture has its own material. And it is not client dependent.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-11-2009 , 15:34   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #56

Quote:
Originally Posted by Arkshine View Post
( You forget N for Snow )
Did someone call me?
SnoW is offline
Send a message via MSN to SnoW
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-11-2009 , 15:36   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #57

Quote:
Originally Posted by SnoW View Post
Did someone call me?
Added you to the constants
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-11-2009 , 15:38   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #58

Quote:
Originally Posted by ot_207 View Post
And it is not client dependent.
Yes it is, unfortunately.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-11-2009 , 15:41   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #59

Quote:
Originally Posted by ot_207 View Post
I mean that every map has its own set of textures and every texture has its own material. And it is not client dependent.
You're wrong. Most of maps use common textures from valve wad. But the material is listed in materials.txt (client file ) corresponding the texture. Only the default textures are listed there. ( it's possible that some maps when you install it on your pc modify the file to add its textures, but it rarely happens ). If you play a map which use custom textures not listed in this file, the default material will be 'Concrete'.
__________________

Last edited by Arkshine; 09-11-2009 at 15:44.
Arkshine is offline
Old 09-11-2009, 15:41
ot_207
This message has been deleted by ot_207. Reason: Doublepost
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-11-2009 , 15:42   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #60

Quote:
Originally Posted by ConnorMcLeod View Post
Yes it is, unfortunately.
How can this be?
It traces the map that you have on your server not the client map.

Quote:
Originally Posted by Arkshine View Post
You're wrong. Most of maps use common textures from valve wad. But the material is listed in materials.txt corresponding the texture. Only the default textures are listed there. If you play a map which use custom textures not listed in this file, the default material will be Concrete.
It is dependent on that but not on client!
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 09-11-2009 at 15:46.
ot_207 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode