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

Solidity Mins/Maxs mistake


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 01-08-2011 , 08:03   Solidity Mins/Maxs mistake
Reply With Quote #1

Hello,

I'm trying to spawn a block

PHP Code:
public SpawnBlock(client) {
    
    
decl Float:position[3];
    
GetClientAimLocation(clientposition);
    
    new 
index CreateEntityByName("prop_dynamic");
    if( !
IsValidEdict(index) )
        return;
    
    new 
String:model_path[128];
    
Format(model_path128"models/DeadlyDesire/props/blocks/block_%s.mdl"g_szSizeg_iData[data_size][client] ]);
    
    if ( !
IsModelPrecachedmodel_path ) ) {
        
PrecacheModelmodel_path );
    }
    
SetEntityModel(indexmodel_path);
    
    
decl String:skin[12];
    
IntToString(g_iData[data_color][client], skin11);
    
    
DispatchKeyValue(index"disableshadows""1");
    
DispatchKeyValue(index"StartDisabled""0");
    
DispatchKeyValue(index"PerformanceMode""1");
    
DispatchKeyValue(index"solid""2");
    
DispatchKeyValueVector(index"mins"g_fMinsg_iData[data_size][client] ]);
    
DispatchKeyValueVector(index"maxs"g_fMaxsg_iData[data_size][client] ]);
    
    
DispatchKeyValue(index"model"model_path);
    
DispatchKeyValue(index"Skin"skin);
    
    
ActivateEntityindex);
    
DispatchSpawnindex);
    
    
TeleportEntity(indexpositionNULL_VECTORNULL_VECTOR);
    
SetEntPropVectorindexProp_Send"m_vecMins"g_fMinsg_iData[data_size][client] ]);
    
SetEntPropVectorindexProp_Send"m_vecMaxs"g_fMaxsg_iData[data_size][client] ]);
    
    
AcceptEntityInputindex"DisableCollision" );
    
AcceptEntityInputindex"EnableCollision" );

The result for players are correct and fetch to the block, but for prop, completly wrong... Look what it's doing in game:
[IMG]http://img267.**************/img267/6521/solidity.jpg[/IMG]


why?


In advance, thank you
kossolax is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-08-2011 , 08:38   Re: Solidity Mins/Maxs mistake
Reply With Quote #2

The props don't have good built-in collision models, don't they?
__________________
FaTony is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 01-08-2011 , 08:41   Re: Solidity Mins/Maxs mistake
Reply With Quote #3

Thank you for your reply,

Actually, I've made it using hammer and propper.
The physic box look good in Model Viewer :/
kossolax is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-08-2011 , 08:47   Re: Solidity Mins/Maxs mistake
Reply With Quote #4

If it looks good then you shouldn't mess with any collision property at all.
__________________
FaTony is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 01-08-2011 , 09:05   Re: Solidity Mins/Maxs mistake
Reply With Quote #5

[IMG]http://img217.**************/img217/1579/blockq.jpg[/IMG]
So looks good...

Changing
PHP Code:
DispatchKeyValue(index"solid""2"); 
to
PHP Code:
DispatchKeyValue(index"solid""6"); 
Make a the block with a strange non-solidity, player are slowing down but can travers it... :/
kossolax is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-08-2011 , 09:37   Re: Solidity Mins/Maxs mistake
Reply With Quote #6

...and what if you don't set "solid" at all?

EDIT: Also, you should really precache all models OnMapStart.

Also:
PHP Code:
g_szSizeg_iData[data_size][client] ] 
This is SO ugly. Hold all model names fully in the adt_array (this would be most scalable solution).

And all paths should have PLATFORM_MAX_PATH size.

PHP Code:
DispatchKeyValue(index"StartDisabled""0");
    
DispatchKeyValue(index"PerformanceMode""1");
    
DispatchKeyValue(index"solid""2");
    
DispatchKeyValueVector(index"mins"g_fMinsg_iData[data_size][client] ]);
    
DispatchKeyValueVector(index"maxs"g_fMaxsg_iData[data_size][client] ]);
    
    
ActivateEntityindex);
    
    
AcceptEntityInputindex"DisableCollision" );
    
AcceptEntityInputindex"EnableCollision" ); 
All these lines are unnecessary I think.
__________________

Last edited by FaTony; 01-08-2011 at 09:53.
FaTony is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 01-08-2011 , 10:16   Re: Solidity Mins/Maxs mistake
Reply With Quote #7

Thank's you again for assists

Quote:
Originally Posted by FaTony View Post
PHP Code:
g_szSizeg_iData[data_size][client] ] 
This is SO ugly. Hold all model names fully in the adt_array (this would be most scalable solution).
Actually, this only contain few data:
PHP Code:
new String:g_szSize[3][12] = {
    
"16x16",
    
"32x32",
    
"64x8"
}; 
Quote:
Originally Posted by FaTony View Post
Also, you should really precache all models OnMapStart.
Everything, execpt .vmt/.vtf are precached and added in downloadtable on map start.

Quote:
Originally Posted by FaTony View Post
And all paths should have PLATFORM_MAX_PATH size.
Didn't know that, thank's





Now, I'm spawning them like this:

PHP Code:
public SpawnBlock(client) {
    
    
decl Float:position[3];
    
GetClientAimLocation(clientposition);
    
    new 
index CreateEntityByName("prop_dynamic");
    if( !
IsValidEdict(index) )
        return;
    
    new 
String:model_path[PLATFORM_MAX_PATH];
    
Format(model_pathPLATFORM_MAX_PATH"models/DeadlyDesire/props/blocks/block_%s.mdl"g_szSizeg_iData[data_size][client] ]);
    
    if ( !
IsModelPrecachedmodel_path ) ) {
        
PrecacheModelmodel_path );
    }
    
SetEntityModel(indexmodel_path);
    
    
decl String:skin[12];
    
IntToString(g_iData[data_color][client], skin11);
    
    
DispatchKeyValue(index"disableshadows""1");
    
    
DispatchKeyValue(index"model"model_path);
    
DispatchKeyValue(index"Skin"skin);
    
    
DispatchSpawnindex);
    
    
TeleportEntity(indexpositionNULL_VECTORNULL_VECTOR);
    
SetEntPropVectorindexProp_Send"m_vecMins"g_fMinsg_iData[data_size][client] ]);
    
SetEntPropVectorindexProp_Send"m_vecMaxs"g_fMaxsg_iData[data_size][client] ]);


And it's not solid at all...

PHP Code:
// Adding this make it solid for player, but mistake with props
DispatchKeyValue(index"solid""2");
// Adding this, slow down the player on entering it, but it's not solid
DispatchKeyValue(index"solid""6"); 

I don't get why, what I'm supposed to do?
kossolax is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-08-2011 , 10:25   Re: Solidity Mins/Maxs mistake
Reply With Quote #8

Are your props compiled with dynamic mode enabled?

I think this is unnecessary too:
PHP Code:
SetEntPropVectorindexProp_Send"m_vecMins"g_fMinsg_iData[data_size][client] ]);
SetEntPropVectorindexProp_Send"m_vecMaxs"g_fMaxsg_iData[data_size][client] ]); 
Quote:
Originally Posted by kossolax View Post
Everything, execpt .vmt/.vtf are precached and added in downloadtable on map start.
.vtf and .vmt should also be added to downloads table. Dunno about precaching.
__________________

Last edited by FaTony; 01-08-2011 at 10:27.
FaTony is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 01-08-2011 , 10:36   Re: Solidity Mins/Maxs mistake
Reply With Quote #9

Thank you again for your reply

Quote:
Originally Posted by FaTony View Post
Are your props compiled with dynamic mode enabled?
They are marked as in hammer's model viewer.

Quote:
Originally Posted by FaTony View Post
I think this is unnecessary too:
PHP Code:
SetEntPropVectorindexProp_Send"m_vecMins"g_fMinsg_iData[data_size][client] ]);
SetEntPropVectorindexProp_Send"m_vecMaxs"g_fMaxsg_iData[data_size][client] ]); 
Removed, now players got the same bug as props using "solid" = "2"
If I set solid = 6, it's like barrel in de_dust2, it's not really blocking you, but push you out of it...




I need them to be fully solid and blocking everything correctly...
kossolax is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-08-2011 , 10:40   Re: Solidity Mins/Maxs mistake
Reply With Quote #10

Ok... so what was the original problem? Did we break something while removing the lines?

Any errors in the console while spawning the prop?
__________________
FaTony 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 13:53.


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