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

Dynamic Temp Entities?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chescos
Member
Join Date: Aug 2011
Old 10-10-2015 , 16:15   Dynamic Temp Entities?
Reply With Quote #1

Hey guys,

I want to use a temp entity to put a decal on a wall, I did that so far with that piece of code I found in the "Map Decals" plugin:

PHP Code:
public OnClientPostAdminCheck(client)
{
    
TE_SetupBSPDecal(g_fOrigin0g_iPrecacheID);
    
TE_SendToClient(client);
}

TE_SetupBSPDecal(const Float:vecOrigin[3], entityindex)
{
    
TE_Start("BSP Decal");
    
TE_WriteVector("m_vecOrigin"vecOrigin);
    
TE_WriteNum("m_nEntity"entity);
    
TE_WriteNum("m_nIndex"index);

Works great! My problem now is, I want to change the decal at the same position every X seconds. I thought about just putting the decals I want to switch between on top of each other and only transmit one at a time or about changing the TE's m_nIndex, is one of those possible?

Regards,
chescos
__________________

Last edited by chescos; 02-13-2022 at 14:42.
chescos is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-10-2015 , 16:28   Re: Dynamic Temp Entities?
Reply With Quote #2

...I would say, you need create "Sprite Spray" or else, then have texture which contain multiple pictures/frames.
Then you "play" it.

:/

*edit
or do you like re-create pictures top of previous one ?
__________________
Do not Private Message @me

Last edited by Bacardi; 10-10-2015 at 16:29.
Bacardi is offline
chescos
Member
Join Date: Aug 2011
Old 10-10-2015 , 17:30   Re: Dynamic Temp Entities?
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
...I would say, you need create "Sprite Spray" or else, then have texture which contain multiple pictures/frames.
Then you "play" it.

:/

*edit
or do you like re-create pictures top of previous one ?
I tested recreating them on top but that just seems to work one time, not multiple times... what is Sprite Spray? Searched for it, didn't find anything.
chescos is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-10-2015 , 18:34   Re: Dynamic Temp Entities?
Reply With Quote #4

is this for which game ?

you get temp entities list using SM server command
sm_dump_teprops teprops.txt

if I rember that command right.
This command can crash your server or else btw.
__________________
Do not Private Message @me
Bacardi is offline
chescos
Member
Join Date: Aug 2011
Old 10-10-2015 , 19:00   Re: Dynamic Temp Entities?
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
is this for which game ?

you get temp entities list using SM server command
sm_dump_teprops teprops.txt

if I rember that command right.
This command can crash your server or else btw.

Yesssss, ive seen that but what do i do with that information?
chescos is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 10-11-2015 , 10:09   Re: Dynamic Temp Entities?
Reply With Quote #6

just make an animated .vmt/.vtf
__________________
Chdata is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 10-12-2015 , 05:05   Re: Dynamic Temp Entities?
Reply With Quote #7

The thing with TE is that when sent to client, they can no longer be modified by server.

One solution is to use TE with life and refresh them when they die, but it's not very clean.
Or you could use a regular entity.
h3bus is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-12-2015 , 08:53   Re: Dynamic Temp Entities?
Reply With Quote #8

here example, animated texture
PHP Code:
public void OnPluginStart()
{
    
HookEventEx("bullet_impact"bullet_impact);
}

public 
void bullet_impact(Event event, const char[] namebool dontBroadcast)
{
    
float xyz[3];
    
xyz[0] = GetEventFloat(event"x");
    
xyz[1] = GetEventFloat(event"y");
    
xyz[2] = GetEventFloat(event"z");

    
TE_SetupBSPDecal(xyz0PrecacheDecal("decals/custom/test"));
    
TE_SendToClient(GetClientOfUserId(GetEventInt(event"userid")));
}

TE_SetupBSPDecal(const Float:vecOrigin[3], entityindex)
{
    
TE_Start("BSP Decal");
    
TE_WriteVector("m_vecOrigin"vecOrigin);
    
TE_WriteNum("m_nEntity"entity);
    
TE_WriteNum("m_nIndex"index);

Add zipped material files (vmt, vtf) in your server and in your own game in right path,
so you not spread those files to all players for testing purpose.

Making animated texture, create multiple TGA pictures,
in VTFEdit create New file and select all TGAs,
choose format (I choosed RGBA888,
save file vtf

bla blaa blaa
Attached Files
File Type: zip materials.zip (734.2 KB, 75 views)
__________________
Do not Private Message @me
Bacardi 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 11:16.


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