AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved move_rope, how to make it hangs (https://forums.alliedmods.net/showthread.php?t=312791)

Indarello 12-16-2018 02:51

move_rope, how to make it hangs
 
1 Attachment(s)
Somebody know how to make rope hang a bit?
- m_RopeLength (Offset 936) (Save)(4 Bytes)
I think it should do it, but dont know how to change it
PHP Code:

SpawnRopeFloat:nodes[][ ], NodeCount, const String:NodePrefix[], const String:RopeMaterial[] = "cable/cable.vmt"Float:width 2.0slack 0bool:LastNodeToFirst false )
{
    if( 
NodeCount )
        return 
0;
    
    new 
enti;
    
decl String:NodeName64 ], String:NextNodeName64 ];
    for(; 
NodeCounti++ )
    {
        if( 
== )
            
ent CreateEntityByName"move_rope" );
        else
            
ent CreateEntityByName"keyframe_rope" );
        
        if( !
IsValidEntityent ) )
            return 
i;
        
        
FormatNodeNamesizeofNodeName ), "%s%d"NodePrefix);
        
        if( 
NodeCount )
            
FormatNextNodeNamesizeofNextNodeName ), "%s%d"NodePrefix);
        else
        {
            if( 
LastNodeToFirst )
                
FormatNextNodeNamesizeofNextNodeName ), "%s0"NodePrefix );
            else
                
strcopyNextNodeNamesizeofNextNodeName ), "" );
        }
        
        
DispatchKeyValueent"targetname"NodeName );
        
DispatchKeyValueent"NextKey"NextNodeName );
        
DispatchKeyValueent"RopeMaterial"RopeMaterial );
        
DispatchKeyValueFloatent"Width"width );
        
DispatchKeyValueent"Slack""1" );
        
DispatchKeyValueent"Type""0" );
        
DispatchKeyValueent"TextureScale""1" );
        
DispatchKeyValueent"Subdiv""2" );
        
DispatchKeyValueFloatent"m_RopeLength"10.0 );           //this should change rope length? - m_RopeLength (Offset 936) (Save)(4 Bytes)
        
DispatchKeyValueent"MoveSpeed""0" );
        
DispatchKeyValueent"Dangling""0" );
        
DispatchKeyValueent"Collide""0" );
        
DispatchKeyValueent"Breakable""0" );
        
DispatchKeyValueent"Barbed""0" );
        
DispatchSpawnent );
        
TeleportEntityentnodes], NULL_VECTORNULL_VECTOR );
        
        
CreateTimer0.1Timer_ActivateEntityent );
    }
    
    return 
i;


https://forums.alliedmods.net/attach...9&d=1544946536

backwards 12-16-2018 05:29

Re: move_rope, how to make it hangs
 
Try setting Subdiv to 4 and Slack to a higher value like 10 or 25.

Keyframe_rope

Quote:

Slack
How much extra length the rope has (by default it has the length between its two endpoints in the editor).
Quote:

Subdivision
Number of subdivisions between each rope segment. Maximum value is 8. Higher values make smoother ropes, but are slower to render.

Indarello 12-16-2018 07:45

Re: move_rope, how to make it hangs
 
Slack 80
works good
thanks


All times are GMT -4. The time now is 22:51.

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