Raised This Month: $ Target: $400
 0% 

Is it possible to remove a netprop's max value? (env_sprite does not scale properly)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sappykun
Member
Join Date: Nov 2019
Old 05-28-2021 , 04:01   Is it possible to remove a netprop's max value? (env_sprite does not scale properly)
Reply With Quote #1

Reposting from TF2Maps.net:

I'm trying to implement a "preview mode" in my resizable sprays plugin where users can see just how large their spray will become when placed on a surface.

I have a demo of what I have been able to create so far:
https://www.youtube.com/watch?v=RpbGUZmruhY

This approach uses an env_sprite_oriented entity that gets teleported to the user's crosshair. While the sprite has a scale keyvalue, I am only able to get the sprite to scale in-game at increments of 0.25, starting from 0.375. This means I effectively cannot preview how one's spray will look at precise scales.

What do I need to do to get the sprite to scale properly?

I can't change the VTF (image file) since the images are user-uploaded sprays and can vary in actual dimensions. The VMT file is being written and precached dynamically, but only one material is being used for the sprite preview.

If I set "m_bWorldSpaceScale" to 1 on the env_sprite entity, I can get it to scale more accurately. However, the scale factor only goes up to 64x64 Hammer units due to a hard-coded value. Is there any way to bypass this?

Last edited by Sappykun; 06-04-2021 at 02:14.
Sappykun is offline
Sappykun
Member
Join Date: Nov 2019
Old 06-04-2021 , 02:12   Re: env_sprite does not scale properly
Reply With Quote #2

Going back to the m_bWorldSpaceScale netprop, it seems like when this entity is networked, the server tells the client to clamp the value to something between 0 and 64.

https://github.com/ValveSoftware/sou...prite.cpp#L140

Is it possible to use Sourcemod to remove the upper limit? Will the client recognize that the upper limit has been removed and render the sprite accordingly?

Last edited by Sappykun; 06-04-2021 at 02:14.
Sappykun 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 17:46.


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