Raised This Month: $ Target: $400
 0% 

[SNIPPET][L4D2] Laser Sight & Explosive Barrel Creation


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 10-05-2010 , 23:02   [SNIPPET][L4D2] Laser Sight & Explosive Barrel Creation
Reply With Quote #1

I thought I would post some handy snippets for Left 4 Dead 2.

Creating an explosive Barrel:
PHP Code:
        new ent CreateEntityByName("prop_fuel_barrel"); //Special prop type for the barrel
        
DispatchKeyValue(ent"model""models/props_industrial/barrel_fuel.mdl");
        
DispatchKeyValue(ent"BasePiece""models/props_industrial/barrel_fuel_partb.mdl");
        
DispatchKeyValue(ent"FlyingPiece01""models/props_industrial/barrel_fuel_parta.mdl"); //FlyingPiece01 - FlyingPiece04 are supported
        
DispatchKeyValue(ent"DetonateParticles""weapon_pipebomb"); //Particles to use, weapon_vomitjar might work haven't tested
        
DispatchKeyValue(ent"FlyingParticles""barrel_fly"); //Particles to use, I have never successfully gotten a list of L4D2 particle names yet
        
DispatchKeyValue(ent"DetonateSound""BaseGrenade.Explode"); //Scene File name that will be used as sound when barrel explodes
        
DispatchSpawn(ent); 
Now theres also the matter of laser sights which can't be created by the simple CreateEntityByName

Here's how:
PHP Code:
        new Float:pos[3], String:position[64];
        new 
ent CreateEntityByName("upgrade_spawn");      
        
DispatchKeyValue(ent"count""1"
        
DispatchKeyValue(ent"laser_sight""1"); 
        
Format(positionsizeof(position), "%1.1f %1.1f %1.1f"pos[0], pos[1], pos[2]); //Teleporting this entity will not work must use origin key value!
        
DispatchKeyValue(ent"origin"position); 
        
DispatchKeyValue(ent"classname""upgrade_spawn"); 
        
DispatchSpawn(ent); 
After DispatchSpawn you can use TeleportEntity how you like to teleport it somewhere. ALSO HANDY FOR STRIPPER!
__________________

Last edited by McFlurry; 10-05-2010 at 23:26.
McFlurry is offline
Send a message via Skype™ to McFlurry
 



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 18:50.


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