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

Scale a model?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ajr1234
Senior Member
Join Date: Mar 2011
Location: Chicago, IL, U.S.A.
Old 07-29-2011 , 01:57   Scale a model?
Reply With Quote #1

Is there a way to scale a model in sourcemod? I found "m_fScale" but idk how to use it...

Code:
new item = CreateEntityByName("prop_physics");
DispatchKeyValue(item, "model", MDLFILE);
DispatchKeyValue(item, "glowstate", "3");
DispatchKeyValue(item, "glowrange",	"3000");
DispatchKeyValue(item, "glowrangemin",	"0");
DispatchSpawn(item);
SetEntProp(item, Prop_Send, "m_fScale", 0.85); // like this?
TeleportEntity(item, pos, NULL_VECTOR, NULL_VECTOR);
ajr1234 is offline
Pawn 3-pg
Senior Member
Join Date: Jul 2009
Old 07-29-2011 , 08:47   Re: Scale a model?
Reply With Quote #2

Use m_flModelWidthScale instead of m_fScale.
The problem is that it only makes the model appear to be smaller - the collision model is still the same size. Also, you can only make the model smaller (< 1.0). Attempting to make it larger will crash the server.
Pawn 3-pg is offline
ajr1234
Senior Member
Join Date: Mar 2011
Location: Chicago, IL, U.S.A.
Old 07-30-2011 , 03:27   Re: Scale a model?
Reply With Quote #3

The model just disappears
ajr1234 is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-30-2011 , 03:40   Re: Scale a model?
Reply With Quote #4

Too bad, this looked like something fun...
__________________
zeroibis is offline
Martin
BANNED
Join Date: Mar 2009
Location: China
Old 08-08-2011 , 14:00   Re: Scale a model?
Reply With Quote #5

SetEntPropFloat(entity,Prop_Send, "m_flModelWidthScale",0.85);
Martin is offline
Send a message via ICQ to Martin
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 08-08-2011 , 17:47   Re: Scale a model?
Reply With Quote #6

don't use m_flModelWidthScale, as the name suggests it only changes the width. its used in hl2 for entities being swallowed by a barnacle. only vertices attached to the root bone of a model are affected.
blodia is offline
ajr1234
Senior Member
Join Date: Mar 2011
Location: Chicago, IL, U.S.A.
Old 08-09-2011 , 03:46   Re: Scale a model?
Reply With Quote #7

Quote:
Originally Posted by Martin View Post
SetEntPropFloat(entity,Prop_Send, "m_flModelWidthScale",0.85);
The model disappears unfortunately.
ajr1234 is offline
Martin
BANNED
Join Date: Mar 2009
Location: China
Old 08-09-2011 , 14:15   Re: Scale a model?
Reply With Quote #8

The little Gun.

Click image for larger version

Name:	未标题-1 拷贝.jpg
Views:	452
Size:	61.3 KB
ID:	90322
Martin is offline
Send a message via ICQ to Martin
ajr1234
Senior Member
Join Date: Mar 2011
Location: Chicago, IL, U.S.A.
Old 08-09-2011 , 23:27   Re: Scale a model?
Reply With Quote #9

I tried it on this model and it disappeared:
Code:
models/props_foliage/forestrock_cluster01.mdl
So idk.
ajr1234 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 19:31.


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