• Manipulating Sprays (Temp Entities)
    11 replies, posted
Hello, This is an extension of my thread here: [url]http://www.facepunch.com/threads/1051828-Manipulating-player-sprays[/url] After trying various different ways to accomplish removing sprays, I've come to the conclusion this isn't possible. As far as I can tell, no extra entity is created server, or client side when someone sprays, thus, I can't see any way to remove the sprays. A SourceMod plugin (sourcemod.net) can accomplish this, and it works just fine in GMod, but having a lua equivalent would be very nice. Plugin link (although down as of right now): [url]http://forums.alliedmods.net/showthread.php?p=665979[/url] The SourceMod plugin makes use of Temp Entities, which uses the following for manipulating temp entities: [code] "Offsets" { /* Offset into CBaseTempEntity constructor */ "s_pTempEntities" { "windows" "17" } "GetTEName" { "windows" "4" "linux" "4" "mac" "4" } "GetTENext" { "windows" "8" "linux" "8" "mac" "8" } "TE_GetServerClass" { "windows" "0" "linux" "0" "mac" "0" } } "Signatures" { "CBaseTempEntity" { "library" "server" "windows" "\x8B\xC1\x8B\x4C\x24\x04\xC7\x00\x2A\x2A\x2A\x2A\x89\x48\x04\x8B\x15\x2A\x2A\x2A\x2A\x89\x50\x08\xA3\x2A\x2A\x2A\x2A\xC2\x04\x00" } "s_pTempEntities" { "library" "server" "linux" "@_ZN15CBaseTempEntity15s_pTempEntitiesE" "mac" "@_ZN15CBaseTempEntity15s_pTempEntitiesE" } } [/code] Perhaps a module, or some extra lua bindings could be created so we can do something similar?
You can remove them by using r_cleardecals twice, I wonder if there is a class for decals that could be ported to gmod lua.
You can remove/replace the basetexture of the spray texture and hence remove the spray. If I remember right.
Using r_cleardecals wouldn't be good for cleaning just one of them. @FlapJack Really? How?
[QUOTE=jimbodude;27587460]Using r_cleardecals wouldn't be good for cleaning just one of them. @FlapJack Really? How?[/QUOTE] The basetexture of the spray should be temp/sprays/ something or other. If you get that texture, and then use SetMaterialString on it. I've never done it myself but it should theoretically work.
[QUOTE=|FlapJack|;27604005]The basetexture of the spray should be temp/sprays/ something or other. If you get that texture, and then use SetMaterialString on it. I've never done it myself but it should theoretically work.[/QUOTE] The problem I found with this is linking a spray to a player from those files. The file names are all weird and named differently on all clients and the server has a different folder where the sprays are held. Also I have never been able to display the client-side spray texture or server-side.
[QUOTE=Cardcapture1;27619520]The problem I found with this is linking a spray to a player from those files. The file names are all weird and named differently on all clients and the server has a different folder where the sprays are held. Also I have never been able to display the client-side spray texture or server-side.[/QUOTE] file.Time and link to the time sprayed possibly?
[QUOTE=Flapadar;27630775]file.Time and link to the time sprayed possibly?[/QUOTE] I was thinking of doing that. I think I might find problem when it comes to the client-side though because I don't see repeated spray files. I still see sprays from months ago. I wonder if there is any linkage between the spray file name on my client 'a6cdc17c.vtf' and this file: [url]http://www.filedropper.com/spray[/url] Could anybody find out?
[QUOTE=Cardcapture1;27631285]'a6cdc17c.vtf'[/QUOTE] It's the file's CRC.
[QUOTE=Chrisaster;27631494]It's the file's CRC.[/QUOTE] I checked for that already. It's not. I check a normal CRC32 checksum. Does Valve have it's own CRC check that's different from normal? Why is was the first thing I check: [URL=http://img153.imageshack.us/i/checksumthis.png/][IMG]http://img153.imageshack.us/img153/5040/checksumthis.png[/IMG][/URL]
It might be the CRC of the compressed version. SDK: [code] // custom files CRC for this player CRC32_t customFiles[MAX_CUSTOM_FILES];[/code] This is where it gets the name from. [editline]24th January 2011[/editline] [code] char logohex[ 16 ]; Q_binarytohex( (byte *)&info.customFiles[0], sizeof( info.customFiles[0] ), logohex, sizeof( logohex ) ); // See if logo has been downloaded. char texname[ 512 ]; Q_snprintf( texname, sizeof( texname ), "temp/%s", logohex ); char fulltexname[ 512 ]; Q_snprintf( fulltexname, sizeof( fulltexname ), "materials/temp/%s.vtf", logohex );[/code]
Thank you. :3
Sorry, you need to Log In to post a reply to this thread.